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 a16812ca9199fdd1fe39d99196c69a1e5fa6098a..4f479ce8585df7988ebe1492b614bd5c27109ee8 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
 }