treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()
authorRafał Miłecki <rafal@milecki.pl>
Sun, 14 Jul 2019 17:03:19 +0000 (19:03 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 17 Jul 2019 06:05:38 +0000 (08:05 +0200)
stage2 passes image path to platform_do_upgrade() as an argument so it
can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 files changed:
target/linux/apm821xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/base-files/lib/upgrade/dir825.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ath79/base-files/lib/upgrade/platform.sh
target/linux/cns3xxx/base-files/lib/upgrade/platform.sh
target/linux/gemini/base-files/lib/upgrade/platform.sh
target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
target/linux/ipq806x/base-files/lib/upgrade/platform.sh
target/linux/ixp4xx/base-files/lib/upgrade/platform.sh
target/linux/kirkwood/base-files/lib/upgrade/platform.sh
target/linux/lantiq/base-files/lib/upgrade/platform.sh
target/linux/layerscape/base-files/lib/upgrade/platform.sh
target/linux/mediatek/base-files/lib/upgrade/platform.sh
target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
target/linux/mvebu/base-files/lib/upgrade/platform.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh

index 02c750130ce704733d6e7b3b04a1f74f80f972e5..32e87513f3d2f8b40c94912588c1595fdb7e6601 100755 (executable)
@@ -22,7 +22,7 @@ platform_do_upgrade() {
 
        case "$board" in
        wd,mybooklive)
-               mbl_do_upgrade "$ARGV"
+               mbl_do_upgrade "$1"
                ;;
        meraki,mr24|\
        meraki,mx60|\
@@ -32,7 +32,7 @@ platform_do_upgrade() {
                nand_do_upgrade "$1"
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index 7ad3dd8e1faa866ebbfd378145527716df1c26be..430df251a02c291c74d6bfa59fe7b232704bc03d 100644 (file)
@@ -148,7 +148,7 @@ platform_do_upgrade_dir825b() {
                else
                        PART_NAME="firmware"
                fi
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        "43493030")
                if [ -z "$fw_mtd" ]; then
@@ -159,7 +159,7 @@ platform_do_upgrade_dir825b() {
                                exit 1
                        }
                fi
-               dir825b_do_upgrade_combined "firmware" "$ARGV"
+               dir825b_do_upgrade_combined "firmware" "$1"
                ;;
        esac
 }
index c0f383b4e3beec62f7356b38a022efc88a3c2284..5de7af667fa940e57818f4e6b1a6d7d4ef122a71 100755 (executable)
@@ -806,7 +806,7 @@ platform_do_upgrade() {
 
        case "$board" in
        all0258n)
-               platform_do_upgrade_allnet "0x9f050000" "$ARGV"
+               platform_do_upgrade_allnet "0x9f050000" "$1"
                ;;
        all0305|\
        eap7660d|\
@@ -818,19 +818,19 @@ platform_do_upgrade() {
        pb44|\
        routerstation|\
        routerstation-pro)
-               platform_do_upgrade_combined "$ARGV"
+               platform_do_upgrade_combined "$1"
                ;;
        all0315n)
-               platform_do_upgrade_allnet "0x9f080000" "$ARGV"
+               platform_do_upgrade_allnet "0x9f080000" "$1"
                ;;
        cap4200ag|\
        eap300v2|\
        ens202ext)
-               platform_do_upgrade_allnet "0xbf0a0000" "$ARGV"
+               platform_do_upgrade_allnet "0xbf0a0000" "$1"
                ;;
        dir-825-b1|\
        tew-673gru)
-               platform_do_upgrade_dir825b "$ARGV"
+               platform_do_upgrade_dir825b "$1"
                ;;
        a40|\
        a60|\
@@ -852,7 +852,7 @@ platform_do_upgrade() {
        om5p-ac|\
        om5p-acv2|\
        om5p-an)
-               platform_do_upgrade_openmesh "$ARGV"
+               platform_do_upgrade_openmesh "$1"
                ;;
        c-60|\
        hiveap-121|\
@@ -903,14 +903,14 @@ platform_do_upgrade() {
        uap-pro|\
        unifi-outdoor-plus)
                MTD_CONFIG_ARGS="-s 0x180000"
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        wp543|\
        wpe72)
-               platform_do_upgrade_compex "$ARGV"
+               platform_do_upgrade_compex "$1"
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index c2fe08154d9e297fc4c79443465257af0ef3290b..8c5a8e52fe28a2758010acc31727add542f2762d 100644 (file)
@@ -41,14 +41,14 @@ platform_do_upgrade() {
 
        case "$board" in
        jjplus,ja76pf2)
-               redboot_fis_do_upgrade "$ARGV" linux
+               redboot_fis_do_upgrade "$1" linux
                ;;
        ubnt,routerstation|\
        ubnt,routerstation-pro)
-               redboot_fis_do_upgrade "$ARGV" kernel
+               redboot_fis_do_upgrade "$1" kernel
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index aa98b472444e2cbbd1534e61b3158f0cc1d44c78..58dd6d7590f91828f8557e22ea8e077f0f4dcaa1 100644 (file)
@@ -15,5 +15,5 @@ platform_check_image() {
 }
 
 platform_do_upgrade() {
-       default_do_upgrade "$ARGV"
+       default_do_upgrade "$1"
 }
index 4fd169d0de5af703355793135edaf407e533ad80..bab2f9878e759c6827901f09026c58cfc5d25e28 100644 (file)
@@ -19,7 +19,7 @@ platform_do_upgrade() {
        case "$board" in
        dlink,dir-685)
                PART_NAME=firmware
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index e62d16c4493ed2bad42ef842354aedc582f798db..a5e39c280c5f2b8fcedb3170b52fd9164f747e77 100644 (file)
@@ -51,7 +51,7 @@ platform_do_upgrade() {
        avm,fritzbox-7530 |\
        avm,fritzrepeater-3000 |\
        qxwlan,e2600ac-c2)
-               nand_do_upgrade "$ARGV"
+               nand_do_upgrade "$1"
                ;;
        asus,map-ac2200)
                CI_KERNPART="linux"
@@ -64,7 +64,7 @@ platform_do_upgrade() {
                ;;
        linksys,ea6350v3 |\
        linksys,ea8300)
-               platform_do_upgrade_linksys "$ARGV"
+               platform_do_upgrade_linksys "$1"
                ;;
        meraki,mr33)
                CI_KERNPART="part.safe"
@@ -73,13 +73,13 @@ platform_do_upgrade() {
        openmesh,a42 |\
        openmesh,a62)
                PART_NAME="inactive"
-               platform_do_upgrade_openmesh "$ARGV"
+               platform_do_upgrade_openmesh "$1"
                ;;
        zyxel,nbg6617)
                zyxel_do_upgrade "$1"
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index 2f0190629e2c28d4665b84b89eba97898102c8a2..5919613cb9fb3a345fda729dcce3e5cc2fcf876a 100644 (file)
@@ -13,7 +13,7 @@ platform_do_upgrade() {
        buffalo,wxr-2533dhp)
                buffalo_upgrade_prepare_ubi
                CI_ROOTPART="ubi_rootfs"
-               nand_do_upgrade "$ARGV"
+               nand_do_upgrade "$1"
                ;;
        compex,wpq864|\
        netgear,d7800 |\
@@ -23,24 +23,24 @@ platform_do_upgrade() {
        qcom,ipq8064-ap148 |\
        qcom,ipq8064-ap161 |\
        zyxel,nbg6817)
-               nand_do_upgrade "$ARGV"
+               nand_do_upgrade "$1"
                ;;
        linksys,ea8500)
-               platform_do_upgrade_linksys "$ARGV"
+               platform_do_upgrade_linksys "$1"
                ;;
        tplink,c2600)
                PART_NAME="os-image:rootfs"
                MTD_CONFIG_ARGS="-s 0x200000"
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        tplink,vr2600v)
                PART_NAME="kernel:rootfs"
                MTD_CONFIG_ARGS="-s 0x200000"
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        nec,wg2600hp |\
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index 92eeaffef635c6cb26d5e8e9929ec159ac9085ee..3ba591fb3c14f9fe0d4c4da39748ccd51e85490c 100644 (file)
@@ -128,10 +128,10 @@ platform_do_upgrade() {
        v "board=$board"
        case "$board" in
        avila | cambria )
-               platform_do_upgrade_combined "$ARGV"
+               platform_do_upgrade_combined "$1"
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index a25d90a096f6d186f78c478581f243d788e480d0..6d63a0a4b7602850f7aea145340136349d547f40 100644 (file)
@@ -13,10 +13,10 @@ platform_do_upgrade() {
        case "$board" in
        "linksys,audi"|\
        "linksys,viper")
-               platform_do_upgrade_linksys "$ARGV"
+               platform_do_upgrade_linksys "$1"
                ;;
        *)
-               nand_do_upgrade "$ARGV"
+               nand_do_upgrade "$1"
                ;;
        esac
 }
index 840ebe7e47cb4e978b0e3b4bf1b9276bdbf37dd4..c47ff78fb228216dc0c65559055756715e41222c 100755 (executable)
@@ -21,7 +21,7 @@ platform_do_upgrade() {
                nand_do_upgrade $1
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index 1c924997e62d7d3bcb9120069313b25516e88668..3bbf6f3dc6cc311270aa4e5616aac9ce3424c5c1 100644 (file)
@@ -17,7 +17,7 @@ platform_do_upgrade_traverse_nandubi() {
        CI_UBIPART="nandubi"
        CI_KERNPART="kernel${newbootsys}"
        CI_ROOTPART="rootfs${newbootsys}"
-       nand_do_upgrade "$ARGV" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys)
+       nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys)
 
 }
 platform_check_image() {
@@ -42,7 +42,7 @@ platform_do_upgrade() {
        case "$board" in
        traverse,ls1043v | \
        traverse,ls1043s)
-               platform_do_upgrade_traverse_nandubi "$ARGV"
+               platform_do_upgrade_traverse_nandubi "$1"
                ;;
        *)
                echo "Sysupgrade is not currently supported on $board"
index 487a262dc20a83cc46b324811ad57e3efcd1f7a9..d812a48720b83edbcf8e01f41462f3a749e9d44e 100755 (executable)
@@ -19,7 +19,7 @@ platform_do_upgrade() {
                umount /tmp/recovery
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index 0e9a68ebdf86da5d011cd84805c5b8aa2676f710..064eeb35bc950202421e78557d876d0a6efaf7cc 100755 (executable)
@@ -15,10 +15,10 @@ platform_do_upgrade() {
        case "$board" in
        ocedo,panda|\
        sophos,red-15w-rev1)
-               nand_do_upgrade "$ARGV"
+               nand_do_upgrade "$1"
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index 744ed4f132cdcbb57c732ddc1cf730692b367a3e..981fa2aa2e4afa96cab60a9110f9facf18fc393e 100755 (executable)
@@ -22,14 +22,14 @@ platform_check_image() {
 platform_do_upgrade() {
        case "$(board_name)" in
        linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
-               platform_do_upgrade_linksys "$ARGV"
+               platform_do_upgrade_linksys "$1"
                ;;
        cznic,turris-omnia|globalscale,espressobin|globalscale,espressobin-emmc|globalscale,espressobin-v7|globalscale,espressobin-v7-emmc|\
        marvell,armada8040-mcbin|solidrun,clearfog-base-a1|solidrun,clearfog-pro-a1)
-               platform_do_upgrade_sdcard "$ARGV"
+               platform_do_upgrade_sdcard "$1"
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }
index 4eaaffe029d133fbb54b4671d728cb3965352ab9..ae7a72c6494f24388ef6f2545c587020edecd2aa 100755 (executable)
@@ -15,7 +15,7 @@ platform_nand_pre_upgrade() {
        case "$board" in
        ubiquiti,edgerouterx|\
        ubiquiti,edgerouterx-sfp)
-               platform_upgrade_ubnt_erx "$ARGV"
+               platform_upgrade_ubnt_erx "$1"
                ;;
        esac
 }
@@ -39,14 +39,14 @@ platform_do_upgrade() {
        ubiquiti,edgerouterx-sfp|\
        xiaomi,mir3g|\
        xiaomi,mir3p)
-               nand_do_upgrade "$ARGV"
+               nand_do_upgrade "$1"
                ;;
        tplink,archer-c50-v4)
                MTD_ARGS="-t romfile"
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        *)
-               default_do_upgrade "$ARGV"
+               default_do_upgrade "$1"
                ;;
        esac
 }