find_boot_image: test previous kernels (<=4.19)

This commit is contained in:
vvb2060 2024-08-13 02:49:27 +08:00 committed by John Wu
parent ab04c6ab39
commit 4b724c7257

View File

@ -371,9 +371,9 @@ find_boot_image() {
BOOTIMAGE= BOOTIMAGE=
if $RECOVERYMODE; then if $RECOVERYMODE; then
BOOTIMAGE=$(find_block "recovery$SLOT" "sos") BOOTIMAGE=$(find_block "recovery$SLOT" "sos")
elif [ -e "/dev/block/by-name/init_boot$SLOT" ] && uname -r | grep -vq "android12-"; then elif [ -e "/dev/block/by-name/init_boot$SLOT" ] && [ "$(uname -r | cut -d. -f1)" -ge 5 ] && uname -r | grep -vq "android12-"; then
# init_boot is only used with GKI 13+. It is possible that some devices with init_boot # init_boot is only used with GKI 13+. It is possible that some devices with init_boot
# partition still uses Android 12 GKI, so we need to explicitly detect that scenario. # partition still uses Android 12 GKI or previous kernels, so we need to explicitly detect that scenario.
BOOTIMAGE="/dev/block/by-name/init_boot$SLOT" BOOTIMAGE="/dev/block/by-name/init_boot$SLOT"
elif [ -e "/dev/block/by-name/boot$SLOT" ]; then elif [ -e "/dev/block/by-name/boot$SLOT" ]; then
# Standard location since AOSP Android 10+ # Standard location since AOSP Android 10+