Awesome news for custom ROM users! If your custom kernel is up-to-date with the AnyKernel3
git HEAD, it automatically has support for my new FlashAfterUpdate addon.d-v2
script, so you can easily keep a custom kernel installed through an A/B ROM OTA!
My development work on my many projects comes out of my free time, so if you enjoy this project or anything else I've done on xda, please consider sponsoring my ongoing work using my GitHub Sponsors profile. For a one-time donation you can hit the donate link from my profile. Thank you for your support!
Setup is simple!
Download my latest 999-flashafterupdate.sh
from the attachments of the scripts post
in my Odds & Ends thread (read the blurb there/follow the links for more info).
Put the script at /system/addon.d/999-flashafterupdate.sh
and give it rwxr-xr-x (755) permissions.
Create the /sdcard/FlashAfterUpdate
directory and put the latest kernel zip there.
When you get an A/B OTA update the custom kernel zip should now be automatically flashed again at the end, over the boot partition of the updated slot, as part of the update process. Magisk root is required
, and the latest Canary build is recommended.
You can also keep TWRP
installed on A/B devices where recovery is inside the boot.img (boot-as-recovery)! See my 98-twrp_ab.sh
addon.d-v2 script at the above link. With all of these in place, then TWRP, Magisk, and AK3 (via FlashAfterUpdate) all get retained through an OTA!
The script gets logged in logcat during booted OTAs, just like my TWRP A/B addon.d-v2 and Magisk addon.d-v2 scripts, so keep an eye there if you're curious, AND the next TWRP will also have support for addon.d-v2 thanks to the amazing work of @k4y0z
, so keep an eye out for that.
P.S. If there are any other mod zips out there that would benefit from FlashAfterUpdate addon-d.v2 support (i.e. they wouldn't be better handled by their own addon.d-v2 script), then contact the mod developer and point them to this post so they can follow my instructions for adding support.
Lastly, also feel free to pester any and all kernel devs who aren't up-to-date with their AK3 zips yet, and please link them to this post, so that we can make things easier for everyone on custom ROMs and custom kernels.