diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index bbba83f36..0a3c19178 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -207,7 +207,7 @@ find_block() { for BLOCK in "$@"; do DEVICE=$(find /dev/block \( -type b -o -type c -o -type l \) -iname $BLOCK | head -n 1) 2>/dev/null if [ ! -z $DEVICE ]; then - readlink -f $DEVICE + echo $DEVICE return 0 fi done @@ -226,7 +226,7 @@ find_block() { for DEV in "$@"; do DEVICE=$(find /dev \( -type b -o -type c -o -type l \) -maxdepth 1 -iname $DEV | head -n 1) 2>/dev/null if [ ! -z $DEVICE ]; then - readlink -f $DEVICE + echo $DEVICE return 0 fi done @@ -371,13 +371,13 @@ find_boot_image() { BOOTIMAGE= if $RECOVERYMODE; then BOOTIMAGE=$(find_block "recovery$SLOT" "sos") - elif [ -L "/dev/block/by-name/init_boot$SLOT" ] && uname -r | grep -vq "android12-"; then + elif [ -e "/dev/block/by-name/init_boot$SLOT" ] && uname -r | grep -vq "android12-"; then # 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. - BOOTIMAGE=$(readlink -f "/dev/block/by-name/init_boot$SLOT") - elif [ -L "/dev/block/by-name/boot$SLOT" ]; then + BOOTIMAGE="/dev/block/by-name/init_boot$SLOT" + elif [ -e "/dev/block/by-name/boot$SLOT" ]; then # Standard location since AOSP Android 10+ - BOOTIMAGE=$(readlink -f "/dev/block/by-name/boot$SLOT") + BOOTIMAGE="/dev/block/by-name/boot$SLOT" elif [ -n "$SLOT" ]; then # Fallback for A/B devices running < Android 10 BOOTIMAGE=$(find_block "ramdisk$SLOT" "boot$SLOT")