ar71xx: remove bogus "rb*)" catch-all from platform.sh
authorThibaut VARENE <hacks@slashdirt.org>
Wed, 15 Feb 2017 12:23:27 +0000 (13:23 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 22 Feb 2017 21:52:19 +0000 (22:52 +0100)
This patch replaces a dangerous catch-all with the exhaustive list of devices.

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

index 0175f6d32c606f20dba05b15a567ce7a2eb284c6..7423c38c5f544feb4a6deae4f0187f3d528be854 100755 (executable)
@@ -486,7 +486,33 @@ platform_check_image() {
        tew-673gru)
                dir825b_check_image "$1" && return 0
                ;;
-       rb*)
+       rb-411|\
+       rb-411u|\
+       rb-433|\
+       rb-433u|\
+       rb-435g|\
+       rb-450|\
+       rb-450g|\
+       rb-493|\
+       rb-493g|\
+       rb-750|\
+       rb-750gl|\
+       rb-751|\
+       rb-751g|\
+       rb-911g-2hpnd|\
+       rb-911g-5hpnd|\
+       rb-911g-5hpacd|\
+       rb-912uag-2hpnd|\
+       rb-912uag-5hpnd|\
+       rb-951g-2hnd|\
+       rb-951ui-2hnd|\
+       rb-2011l|\
+       rb-2011uas|\
+       rb-2011uias|\
+       rb-2011uas-2hnd|\
+       rb-2011uias-2hnd|\
+       rb-sxt2n|\
+       rb-sxt5n)
                nand_do_platform_check routerboard $1
                return $?
                ;;
@@ -621,16 +647,36 @@ platform_pre_upgrade() {
        local board=$(ar71xx_board_name)
 
        case "$board" in
-       rb-750-r2|\
-       rb-750up-r2|\
-       rb-941-2nd|\
-       rb-951ui-2nd|\
-       rb-mapl-2nd)
-               ;;
-       rb*|\
        c-60|\
        nbg6716|\
        r6100|\
+       rb-411|\
+       rb-411u|\
+       rb-433|\
+       rb-433u|\
+       rb-435g|\
+       rb-450|\
+       rb-450g|\
+       rb-493|\
+       rb-493g|\
+       rb-750|\
+       rb-750gl|\
+       rb-751|\
+       rb-751g|\
+       rb-911g-2hpnd|\
+       rb-911g-5hpnd|\
+       rb-911g-5hpacd|\
+       rb-912uag-2hpnd|\
+       rb-912uag-5hpnd|\
+       rb-951g-2hnd|\
+       rb-951ui-2hnd|\
+       rb-2011l|\
+       rb-2011uas|\
+       rb-2011uias|\
+       rb-2011uas-2hnd|\
+       rb-2011uias-2hnd|\
+       rb-sxt2n|\
+       rb-sxt5n|\
        wndr3700v4|\
        wndr4300)
                nand_do_upgrade "$1"