ar71xx: fix platform_find_rootfspart()
authorThibaut VARENE <hacks@slashdirt.org>
Sat, 11 Feb 2017 10:10:37 +0000 (11:10 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 12 Feb 2017 14:57:37 +0000 (15:57 +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 cf2aab2737b274c072caee515c62d557c6b26cfb..c87fbff75b969f4801d252260b7638020a9c2620 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
 }