[Nexus 6  General] SeekingRest2019:
This is the process I used to lock the bootloader on my Nexus 6.

Currently my Nexus 6 has LineageOS "lineage-15.1-20191212-nightly-shamu-signed.zip" installed. Magisk "Magisk-v20.1.zip" is also installed. I also have TWRP "twrp-3.3.1-0-shamu.img" installed.

These are the procedures I am taking to relock my bootloader.

I will write out these steps as I do them and put them in My Detailed Procedure. I'll also write the quick instructions for people who know what they're doing. I'm pretty sure I almost hard bricked my device doing this. Make sure your phone isn't bootlooping before locking the bootloader.

My Detailed Procedure

• Google "nexus 6 factory image" and the first link has the stock ROM with the version "7.1.1 (N6F27M, Oct 2017)" under "shamu" for Nexus 6. Download from the link.

• Unzip the folder "shamu-n6f27m-factory-bf5cce08.zip", and then move the contents from the folder "shamu-n6f27m" into the same folder you have adb.exe and fastboot.exe. This means "flash-all.bat" is in the same folder as "adb.exe".

• Make sure your Nexus 6 has the drivers to connect to Windows. Connect the Nexus 6 to a computer with the charging cable, then turn the phone on using the key combination power + volume down to boot into the bootloader. Open a command prompt and type "cd "C:/folder/location/of/adb.exe"". Double click the "flash-all.bat" file. This will flash the stock ROM to the Nexus 6 device. This also removes TWRP, all of your data, and internal storage files. Wait until it says "Press any key to exit...". Then press the key and you are not on stock android. Note: the previous line said "fastboot: error: Command failed". Looks a little ominous to me, but I don't think it's an issue. I am proceeding.

• Now use the arrow keys to select "START". Wait a few minutes while it loads, then set up the phone without setting up any screen locks, without adding any accounts, and without connecting to WiFi. I'm not sure if the WiFi part matters, but I also don't have a SIM card in it either, so I'm just leaving the phone offline.

• Verify "OEM unlocking" is enabled. Go to Settings > About phone > Build number and tap "Build number" 7 times. Hit back, and go into Developer options. For me "OEM unlocking" is grayed out, the switch is ticked to the right, and it says "Bootloader is already unlocked". I am going to restart my phone to make sure it "OEM unlocking" stays enabled. I believe this is the problem that was in Android 5.1, so it shouldn't be a problem here in Android 7.1.1? Correct me if I'm wrong. My reboot is taking a lot of time hanging on the "Google" splash screen with an unlock symbol underneath. I got impatient and held the power button until the splash screen blinked. Umm... is it bootlooping? I've held power button a few times and it seems to just restart it; the screen flashes and then it hangs. I'll just be a little more patient... I'm gonna hold power button one last time and time it with a stopwatch. I'm 6 minutes in and no luck. It must be bootlooping. New plan! That's scary... IF I HAD LOCKED THE BOOTLOADER HERE WITHOUT REBOOTING ONE MORE TIME TO CHECK THINGS, I WOULD HAVE BEEN SCREWED. IT WOULD BE BOOTLOOPING WITH A LOCKED BOOTLOADER AND NO CUSTOM RECOVERY. I WOULDN'T BE ABLE TO USE FASTBOOT OR TWRP TO FIX THINGS. FASTBOOT IS REQUIRED TO FLASH THE FACTORY IMAGE. NO UNLOCKED BOOTLOADER MEANS NO FASTBOOT.

• I'm gonna reflash the stock image and repeat the steps. It says from naldotech, in step 9 of "How To Flash Factory Image on Nexus 6 & Go Back To Stock" (I can't submit links), after you flash the factory image, "In Recovery, wipe data and cache so the phone doesn’t get stuck in a bootloop." Since I won't have any recovery to do that, what I'm going to do is do a factory reset from within stock Android one time, then see if any bootlooping occurs after I do that. I'll strikethrough these bullet points that are unnecessary errors on my part.

• Factory reset the phone from within Android 7.1.1 before rebooting the phone to prevent a bootloop. This is to delete data and cache (I believe it will do that). Go to Settings > Backup & reset > Factory data reset. Then select "RESET PHONE" and then "ERASE EVERYTHING". Set up the phone the same way with no accounts, screen locks, or WiFi.

• Verify "OEM unlocking" is enabled. Go to Settings > About phone > Build number and tap "Build number" 7 times. Hit back, and go into Developer options. For me "OEM unlocking" is grayed out, the switch is ticked to the right, and it says "Bootloader is already unlocked". Restart the phone to make sure it "OEM unlocking" stays enabled. Yay, no bootloop. I'm gonna restart 3 more times, but I imagine I'm good to go now. And verified. No bootloop after 3 reboots.

• And now is the important part. This is the first time I will be locking a bootloader. I'm beginning to think the "OEM unlocking" was not greyed out in previous versions and that it is actually a safeguard they added after 5.1. Mine is still ticked right and grayed out after the reboots. Let's continue.

• Enable USB debugging in "Developer options" so that you can run the fastboot command to lock the bootloader.

• Shut down the phone and boot into the bootloader (power button + volume down) in order to run fastboot commands.

• Make sure the device is connected to your PC and open a command prompt and type "cd C:/correct/folder/with/fastboot".

• Run "fastboot oem lock". Press the power button to confirm. Let's see if I'm in the clear...

• Selecting "START" from the bootloader...

• Device is starting with the "Google" logo but without the unlock symbol. Let's hope there is no bootloop... Whew, got past the Google screen and it's starting android with the colorful animation!

• I set up the phone one last time and the option "OEM unlocking" is no longer grayed out. I went ahead and unchecked it and factory reset the phone one last time. The factory reset took quite a while, but it worked.

Quick Instructions

• Get factory image (the stock ROM) "7.1.1 (N6F27M, Oct 2017)" from Google and flash it using "flash-all.bat".

• Set up phone without accounts or screenlocks. I also didn't allow it to connect to the internet.

• Factory reset from within Android 7.1.1 (this supposedly clears data and cache that could cause a bootloop).

• Restart the phone a few times to make sure it runs without bootlooping.

• Verify "OEM unlocking" is enabled. Mine is enabled and grayed out. I don't think this is an issue on this version.

• Enable USB debugging.

• Lock bootloader with "fastboot oem lock".