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)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 13 Sep 2019 20:24:03 +0000 (16:24 -0400)
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>
(cherry picked from commit 8b4bc7abe073489a3595eeb2d81818852319c148)
[rmilecki: dropping ARGV without this change broke sysupgrade]
Fixes: 6ac62c4b6cae ("base-files: don't set ARGV and ARGC")

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

index 58a011448b40e31207067624d09c8a36b3da5f7d..eac0aef1b83af87cf7a99dbeccf5869151dbd78e 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 49d9bab959daa55e6aab7f2e1b6601761c65d92b..af0c1b24732579529e8349d7a4d8d813efd82231 100755 (executable)
@@ -810,7 +810,7 @@ platform_do_upgrade() {
 
        case "$board" in
        all0258n)
-               platform_do_upgrade_allnet "0x9f050000" "$ARGV"
+               platform_do_upgrade_allnet "0x9f050000" "$1"
                ;;
        all0305|\
        eap7660d|\
@@ -822,19 +822,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|\
@@ -856,7 +856,7 @@ platform_do_upgrade() {
        om5p-ac|\
        om5p-acv2|\
        om5p-an)
-               platform_do_upgrade_openmesh "$ARGV"
+               platform_do_upgrade_openmesh "$1"
                ;;
        c-60|\
        hiveap-121|\
@@ -907,14 +907,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 795120239ad47160dda3e7c3230206b741745a00..679f46d079e14995e6fd18f9173daccf5f341c23 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
 }