From 93e1266ee7dbaeca1452c07ac57b623b5464f5d6 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Sun, 21 Mar 2021 19:34:33 -0300 Subject: [PATCH] scripts: fix find_boot_image using wrong partition list on non-slot - revert logic changes introduced by ec8fffe61cf6c2ce66a52d9e8b33cd6e60c7ceb8 which break find_boot_image on NAND devices and any others using non-standard naming supported by the A-only device boot partition name list - despite being accepted equivalents in modern shells -n does not work on Android in some shell/env scenarios where ! -z always does --- scripts/util_functions.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index 34abf0c84..f56dceefc 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -37,9 +37,9 @@ getvar() { local VARNAME=$1 local VALUE local PROPPATH='/data/.magisk /cache/.magisk' - [ -n $MAGISKTMP ] && PROPPATH="$MAGISKTMP/config $PROPPATH" + [ ! -z $MAGISKTMP ] && PROPPATH="$MAGISKTMP/config $PROPPATH" VALUE=$(grep_prop $VARNAME $PROPPATH) - [ -n $VALUE ] && eval $VARNAME=\$VALUE + [ ! -z $VALUE ] && eval $VARNAME=\$VALUE } is_mounted() { @@ -50,7 +50,7 @@ is_mounted() { abort() { ui_print "$1" $BOOTMODE || recovery_cleanup - [ -n $MODPATH ] && rm -rf $MODPATH + [ ! -z $MODPATH ] && rm -rf $MODPATH rm -rf $TMPDIR exit 1 } @@ -394,7 +394,7 @@ find_boot_image() { BOOTIMAGE= if $RECOVERYMODE; then BOOTIMAGE=`find_block recovery_ramdisk$SLOT recovery$SLOT sos` - elif [ -n $SLOT ]; then + elif [ ! -z $SLOT ]; then BOOTIMAGE=`find_block ramdisk$SLOT recovery_ramdisk$SLOT boot$SLOT` else BOOTIMAGE=`find_block ramdisk recovery_ramdisk kern-a android_boot kernel bootimg boot lnx boot_a`