From 0e3b7304e6591beda61a2dc8f296c1189cac3e6a Mon Sep 17 00:00:00 2001 From: osm0sis Date: Tue, 6 Aug 2019 18:46:47 -0300 Subject: [PATCH] AK3: fix partition detection taking first match on older devices - `test -e` could fail due to unexpanded *'s in $target --- tools/ak3-core.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 97b0e2e..ce5586e 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -678,7 +678,9 @@ setup_ak() { else abort "Unable to determine mtd $block partition. Aborting..."; fi; - target=/dev/mtd/$mtdname; + if [ -e /dev/mtd/$mtdname ]; then + target=/dev/mtd/$mtdname; + fi; elif [ -e /dev/block/by-name/$part ]; then target=/dev/block/by-name/$part; elif [ -e /dev/block/bootdevice/by-name/$part ]; then @@ -690,7 +692,7 @@ setup_ak() { elif [ -e /dev/$part ]; then target=/dev/$part; fi; - test -e "$target" && break 2; + test "$target" && break 2; done; done; if [ "$target" ]; then