[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] taurelio:
From LineageOS Website

A/B devices: a whole new world

Addon.d-v2

Many around the Android community have bashed A/B as being “hard to support” and “not developer friendly”, when in fact, properly implemented it is easier to support and just as developer friendly.

Our Updater app has long supported the A/B process and as of this week it is now addon.d capable! This means you will be able to seamlessly update via the app, just as on stock, and retain your addon.d compatible mods such as GApps.

Currently, the only GApps compatible with this new addon.d system (deemed addon.d-v2) is MindTheGApps. OpenGApps addon.d script in its current form is too complicated for addon.d-v2 to handle (as A/B was never meant to handle this sort of thing), though we’ve reached out, and alerted them what needs to be done. If you wish to make your addon.d mod v2 compliant, please look here for an example addon.d script, and here for the flag to make it compatible. Any third party mods not flagged with the above will be ignored by addon.d-v2, and not backed up as they are incompatible.

A/B Install Process

A/B’s new “payload” install format is a tad odd, as it installs to the opposite slot by default.

So, prepare yourselves, this is far from the standard install process you are all used to, but it will be the standard from here on out:

Boot a custom recovery (either fastboot booting, or flashing and then booting will do)

Wipe Data

Flash LineageOS

Reboot to Recovery (it is important you reboot to the installed recovery, which will be Lineage Recovery - more on this one later - unless you hand flashed another, which is not recommended for A/B devices)

Install whatever addon.d-v2 compliant mods you’d like to (please note that OpenGApps is not addon.d-v2 capable yet)

Reboot

Enjoy!

If you attempt to install GApps/Mods to system in the same boot as LineageOS, thanks to slot logic, none of it will persist. You need to reboot to recovery between flashing the ROM and any mods, however, do not reboot to OS between ROM flash and other mods.

Worthwhile note, if at any point you wish to go back a build, you can always run “fastboot set_active other” and jump back to the last/other slot, which houses the last update you had.

Lineage Recovery

A/B devices have the recovery image built in into the boot image (as those old Sony Xperia devices for those of you who remember). This means that there’s no recovery partition and recovery will have to be included at build time into the OS.

So we created the Lineage Recovery: our brand new recovery that supports both A/B and non A/B devices. It’s based upon AOSP recovery but with many improvements needed for the world of custom ROMs. It’s simple, light and secure: in Lineage Recovery, SELinux is in enforcing mode, limiting each process’ capabilities.

Due to compatibility issues with some OEM’s encryption implementations and to reduce attack surface, whenever your device is encrypted, the internal storage won’t be available for access at all. To install packages, you will be required to sideload using adb. Through adb you will also be able to perform backups and restore them, using the adb backup and adb restore commands too.

This recovery will be installed by default on all A/B devices and you won’t be able to change it, but given that these are A/B devices, you won’t need to boot into the recovery too much. Stay tuned for the release of Lineage Recovery for non-A/B devices.