ar71xx: fix platform_find_rootfspart()
authorThibaut VARENE <hacks@slashdirt.org>
Sat, 11 Feb 2017 10:10:37 +0000 (11:10 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 1 Mar 2017 19:37:36 +0000 (20:37 +0100)
platform_find_rootfspart() fails if the kernel partition comes before the
rootfs partition. The proposed patch fixes this while preserving what I
understand was the original idea: stop at first match.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
target/linux/ar71xx/base-files/lib/upgrade/platform.sh

index a16812c..4f479ce 100755 (executable)
@@ -46,7 +46,7 @@ platform_find_kernelpart() {
 platform_find_rootfspart() {
        local part
        for part in "${1%:*}" "${1#*:}"; do
-               [ "$part" != "$2" ] && echo "$part"; break
+               [ "$part" != "$2" ] && echo "$part" && break
        done
 }