[Google Pixel XL Guides, News, & Discussion] Mikkey81:
How To Flash Roms with the Ridiculous Slots... yep. You're a rookie again because these things are going to drive you onto a drunken crazy bender... You'll probably wake up in Mexico married to someone you've never met and tied in with the Chicago Mob in debt for a quarter million. THIS IS WHAT WORKS FOR ME. I do the same thing Every time and have done this wrong so many times I've lost count.

Note number 1...

You have or know how to use adb and fastboot basics... if not... Of not Google the Adb and fastboot set up for your devices and/or PC/Laptop etc... There are a lot of forums and Q&A on setting this up to get fastboot cmds running. You should be familiar regardless and at least have the stock flashall.bat for a Google Stock IMG JUST IN CASE. I am assuming everyone is already at the install for TWRP and is working with 3.2.0-0 only. You cannot flash roms without it. Any other version for 8.1 will NOT work at this time...

Note number 2...

Roms will vary. Some may include the vendor image and you don't need to flash it. Some may include gapps and you don't need to flash those... Some may include everything and have you flash to slot_a and that is all. In other words do what the OP says, they built it. They know what's in it and how it works.

Here's the trick... It doesn't mean you can't do these in any other way but you will NOT get stuck if you follow some simple rules...

Roms only flash while in Slot_A

Gapps only Flash in Slot_B

Kernels only flash in Slot_B

Magisk only flash in Slot_B

IMG Flash to Slot_B

TWRP 3.2.0-0 ONLY

TWRP 3.2.0-0 to either slot

Do NOT EVER Flash anything other then TWRP, Rom Gapps and Vendor until GOING through first boot. Yes you can but it increases your issues.

Always always always double check between every install the status of your Overlays folder. Before every rom install Mount System then Go to File Manager and Delete that folder from Slot B before you boot to Slot A to flash the rom. This can hold Data from Magisk and Mods that get all tore up Everytime... It also happens when you reflash Magisk or dirty flash a rom. I'm going to put together a fresh flash below and I'll get into that a little later.

So from stock Google image...

Clean flash... MAKE SURE YOUR LOCKSCREEN IS OFF... No fingerprint set up... Not a pin set up... No pattern set up. If your more secure than swiping up to open your screen your not getting in to TWRP 3.2.0-0 decrypted.

Either... Reboot recovery (you'll be in slot B) if you already have TWRP installed....

Or....If you're just booting TWRP for the first time...from bootloader you fastboot boot (not flash really the terminology is BOOT) TWRP-3.2.0-0-marlin.img (you'll be in slot B)

Read your bootloader screen or go to TWRP 3.2.0-0 Reboot menu to find out which slot you're in.

FLASHING YOUR FIRST ROM...

note... Most are going to require before flashing your coming from stock. Just do it. At least the initial install... Dirty flash or clean flash after that without going back to stock but you don't have to flash the stock image.

Ready... You're in slot b remember...in order here...

- Wipe Data System Cache

- Flash TWRP 3.2.0-0 the ZIP

This is why you can't have your lockscreen on... If you didn't listen just go back to your bootloader and start over with the flash-all.bat. Sorry but I warned you... You can't get anything to flash at this point because you can't decrypt 3.2.0-0.

- Go to MOUNT then make sure your system box is checked

- Go to ADVANCED and then File Manager and make sure you have no overlay folder. If you do... click on it and hit delete from the options on the bottom portion of TWRP.

- HIT HOME and Go to the actual reboot menu choice (Not the swipe reboot system)

-Click on slot_A and then reboot back into recovery. ...NOTE... I usually don't use the reboot recovery option.(reboot recovery seems wonky and doesnt work for me all the time) I reboot system and just hold volume down until I hit the bootloader and the choose recovery in the bootloader options...

You ARE in Slot A now... Right... You can Double check in the bootloader or TWRP in the reboot menu.

- if you really really really like to wipe you can wipe Data system and cache in Slot_A... I never do from slot_a but to each their own.

- Flash rom and flash TWRP 3.2.0-0. Nothing else.

- Reboot back to recovery again.

You ARE in slot B. Yep automatically... When a rom is flashed it goes to the opposite slot. And reboots you there on the next recovery reboot so DO NOT GO change your slot to B unless an OP actually directs you to do so.

So... We're in slot B

- Flash Gapps and Vendor... nothing else until after you boot up.

Yeah yeah... You want to be rooted... Well boot up first and we'll hopefully be able to walk through that too.

Your booted up. Go to your development options and double check to make sure USB Debugging is enabled... Really whatever, you're really pretty safe if you have Your fastboot drivers and they must be installed because you installed TWRP to get this far so if something goes wrong from here we can still always do the flash-all.bat so your phone shouldn't implode and brick out.

Reboot recovery. Yep you're in slot B... You should now always boot recovery to slot_b unless you mess something up and get stuck in a loop. I've seen it but couldn't duplicate. It was always me flashing out of order.

GAINING ROOT... MAGISK INSTALL

- Choose the zip, flash and reboot.

Nothing further needed, make sure it's compatible with 8.1 and at least 15 to 16 are Oreo compatible. Easy right.

Well even when I'm updating... the wonderful Overlay folder can get jacked. I'm pretty sure I've heard it laugh at me as I stuck in bootloop after bootloop... If you delete the overlay folder anytime BEFORE you update to the next version of Magisk you'll be ok

UPDATING MAGISK...

So if you're on 15.3 and you want to get to 16.0 without getting stuck or having issues on boot.

- Reboot from Rom to recovery... You WILL always be in slot B by default.

- Go to Mount

- Mount System

- Go to Advanced and then File Manager, find your Overlay folder.

- Click on the overlay folder

- Click Delete

- Hit Home

- Flash your updated Magisk 16.0

MAGISK AND KERNEL

To get Magisk and a kernel going can give you to madness. It gets a little tricky. But honestly devs have really really improved the process. If you're rooted already most you can flash reboot into the rom reboot to recovery again and then do this again...

- Reboot from Rom to recovery... You WILL always be in slot B by default.

- Go to Mount

- Mount System

- Go to Advanced and then File Manager, find your Overlay folder.

- Click on the overlay folder

- Click Delete

- Hit Home

- Flash your updated Magisk 16.0

For the most part the current kernels do not blow out your Recovery anymore however some do. In fact the only one I know that will is Noexezshades. Probably spelled that wrong but you'll catch my drift if you read his OP.

SERIOUSLY YOU BETTER ALREADY HAVE BOOTED INTO YOUR ROM FOR THE FIRST TIME.. You'll hate your life if you set this up during your initial install.

INSTALLING KERNEL WITH MAGISK

- Reboot Recovery (hahaha. Ha. You turned your fingerprint scanner on... Reboot and turn it back off)

- Flash Magisk

- Reboot

I know... right now you're saying WTF... I didn't flash the kernel. This is just a fail safe... Points in Any Kernel need Root to install... I haven't had issues but really probably because I always flash Magisk first.

If you already had Magisk installed start here.

Now we're going to Flash the kernel. It's going to unroot you so we'll just immediately install Magisk I recommend always installing Magisk after a kernel because it also Patches the boot otherwise there are times when patching the boot.img is required however I believe most DEVs have surpassed that FOR MOST KERNELS.

- Reboot recovery (Dang. You forgot to turn off your fingerprint sensor again, sorry life's rough turn off your lockscreen again)

- Flash kernel

- Reboot system

- Reboot recovery (you might lose TWRP however every Newer version I'm using--- unless noted by the OP--- is working at present)

- DON'T flash Magisk... No dont flash Magisk. If you were following along you can see you need to go delete the overlay folder before you flash Magisk it will almost always go bad at this point if you don't delete the overlay folder

- Flash Magisk

- Reboot.

Hopefully you learned what's happening now in the background. I try to explain things from a user level and do this as part of my daily work every day. I don't understand things unless someone tells me what's going on along the way and keeps me partially entertained...

Talk amongst yourselves or don't post Anything. The goal is to take the issues out of the day to day so the devs aren't getting the questions.