diff options
author | osm0sis <osm0sis@outlook.com> | 2019-08-06 18:46:47 -0300 |
---|---|---|
committer | osm0sis <osm0sis@outlook.com> | 2019-08-06 18:53:08 -0300 |
commit | 0e3b7304e6591beda61a2dc8f296c1189cac3e6a (patch) | |
tree | b0dd7b1df9c57514670b313d08dbfecd96ff1180 | |
parent | f3f80014cc4f053a8ed7230136bee83cd42644d1 (diff) |
AK3: fix partition detection taking first match on older devices
- `test -e` could fail due to unexpanded *'s in $target
-rwxr-xr-x | tools/ak3-core.sh | 6 |
1 files 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 |