Skip to main content

Updating Lineage OS while keeping root working with Magisk

Decided it would be nice to document how to perform an update, because the releases appear fairly frequently and the process isn't exactly straightforward like clicking Download and Install button.

Perform update normally trough OTA

Navigate to Settings --> System --> Advanced --> Updater. Pick the newest update, download and install. After it has finished, reboot your device.

image-1630097882100.png

image-1630097896700.png

image-1630097917300.png

After reboot, open Magisk to check if you are still rooted. Most likely, you are not. Now how to fix it. The only way I found working is to basically repeat the whole root process again. In short:

  • Download the latest build from Lineage OS website, extract boot.img using payload_dumper
  • Copy boot.img to Android, patch with Magisk
  • Copy patched image back to PC
  • Use fastboot to flash the patched image

These steps are decribed in more detail over here: https://selfhostedfuture.xyz/books/everything-nix-and-libre-software/page/rooting-xperia-xa2-on-lineage-os