AK3: fix partition detection taking first match on older devices

- `test -e` could fail due to unexpanded *'s in $target
This commit is contained in:
osm0sis committed 2019-08-06 18:53:08 -03:00
1 parent f3f80014cc
commit 0e3b7304e6
1 file changed
+4 -2
+4 -2
View File
@@ -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