AK3: add magiskboot KEEPVBMETAFLAG support

- some devices fail to boot when magiskboot changes the vbmeta flag is set in the AVBv2 signature from 00 to 03, this allows disabling that behavior
- set keep_vbmeta_flag=1 in anykernel.sh to force it to keep whatever's there, =auto will take it from the existing image if Magisk-patched (Canary 23016 or later), and =0 will allow the default magiskboot behavior
This commit is contained in:
osm0sis committed 2021-12-10 23:30:24 -04:00
1 parent 66f42c1951
commit 6e7fcd6d28
2 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -3,4 +3,4 @@
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
#
#
# AK_BASE_VERSION=20211207
# AK_BASE_VERSION=20211210
+7 -1
View File
@@ -349,13 +349,19 @@ flash_boot() {
*-dtb) rm -f kernel_dtb;;
esac;
fi;
unset magisk_patched KEEPFORCEENCRYPT KEEPVERITY SHA1 TWOSTAGEINIT;
unset magisk_patched KEEPFORCEENCRYPT KEEPVERITY SHA1 TWOSTAGEINIT; # leave KEEPVBMETAFLAG set for repack
;;
esac;
case $ramdisk_compression in
none|cpio) nocompflag="-n";;
esac;
case $keep_vbmeta_flag in
auto) [ "$KEEPVBMETAFLAG" ] || export KEEPVBMETAFLAG=false;;
1) export KEEPVBMETAFLAG=true;;
*) export KEEPVBMETAFLAG=false;;
esac;
$bin/magiskboot repack $nocompflag $bootimg $home/boot-new.img;
unset KEEPVBMETAFLAG;
fi;
if [ $? != 0 ]; then
abort "Repacking image failed. Aborting...";