check empty init_boot partition

For upgrading devices that continue to use Android 12 or older kernel versions, the generic ramdisk remains where it was with no requirement for a new init_boot image.
This commit is contained in:
vvb2060 2024-07-01 01:29:54 +08:00 committed by John Wu
parent be5ff68140
commit 7dca5b831a

View File

@ -385,6 +385,9 @@ find_boot_image() {
else
BOOTIMAGE=$(find_block ramdisk recovery_ramdisk kern-a android_boot kernel bootimg init_boot boot lnx boot_a)
fi
if [ "$BOOTIMAGE" = "init_boot$SLOT" ]; then
uname -r | grep -q "android12-" && BOOTIMAGE="boot$SLOT"
fi
if [ -z $BOOTIMAGE ]; then
# Lets see what fstabs tells me
BOOTIMAGE=$(grep -v '#' /etc/*fstab* | grep -E '/boot(img)?[^a-zA-Z]' | grep -oE '/dev/[a-zA-Z0-9_./-]*' | head -n 1)