Notes for upgrading major versions (LineageOS 19 to LineageOS 20) as well as OTA and Magisk notes.
My notes are based off an A/B slot device.
Note that the firmware update is done in fastbootd and not fastboot; trying to run the commands in regular fastboot will yield the error:
fastboot: error: Could not check if partition abl has slot all
Using the official documentation:
While still in Recovery, use the volume keys to pop back into the bootloader
Continue with the adb sideload
command to upload the Lineage 20 zip.
Overlooking this will uninstall root.
From official Magisk wiki:
NOTE: In order to apply OTAs, you HAVE to make sure you haven’t modified and read-only partitions yourself (such as /system or /vendor) in any way. Even remounting the partition to rw will tamper block verification!!
Go to the Magisk app > Uninstall > Restore Images
After completing step 1, apply the OTA as you normally would (Settings > System > System Update)
Wait for the installation complete. Do not press “Restart now” or “Reboot” yet
Go to Magisk app > Install > Install to Inactive Slot, to install Magisk to the updated slot
After step 4 is done, press the reboot button in the Magisk app. This forces your device to switch to the updated slot, bypassing any possible post-OTA verifications
If any step is missed for Magisk after an OTA, simply do a fresh patching of boot and vbmeta images and reflash:
Download the full zip of the latest upgrade from Lineage or microG Lineage (matching your existing OS)
Verify the sha256 hash to ensure it wasn't tampered with in transit:
sha256sum lineage-20.0-20230207-microG-lemonade.zip
Unzip
Run payload dumper go on it:
./payload-dumper-go /home/angela/Downloads/lineage-20.0-20230207-microG-lemonade/payload.bin
Upload boot.img to your phone's Download
folder via USB or adb (navigate to the directory in your terminal where boot.img
is, first):
adb push boot.img /storage/emulated/0/Download/boot.img
Open the Magisk app and click Install on the top 'Magisk' card
After patching is complete, download the patched boot.img back to your PC (drag via a file manager) or adb -- be sure to replace the original boot.img from your magisk
folder location and ensure vbmeta.img is in the same directory, otherwise you'll need to specify an absolute path in your CLI command later:
adb pull /sdcard/Download/magisk_patched_[random_strings].img
Run adb reboot bootloader
in your terminal while connected to the phone via USB
While in fastboot mode, run:
fastboot flash boot_a magisk_patched-[random keystrokes].img
fastboot flash boot_b magisk_patched-[random keystrokes].img
fastboot flash vbmeta_a --disable-verity --disable-verification vbmeta.img
fastboot flash vbmeta_b --disable-verity --disable-verification vbmeta.img