From 20f15802dfce185e1442fd654e346c03448973a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 14 Jul 2019 19:03:19 +0200 Subject: [PATCH] treewide: sysupgrade: don't use $ARGV in platform_do_upgrade() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 8b4bc7abe073489a3595eeb2d81818852319c148) [rmilecki: dropping ARGV without this change broke sysupgrade] Fixes: 6ac62c4b6cae ("base-files: don't set ARGV and ARGC") --- .../ar71xx/base-files/lib/upgrade/dir825.sh | 4 ++-- .../ar71xx/base-files/lib/upgrade/platform.sh | 18 +++++++++--------- .../ath79/base-files/lib/upgrade/platform.sh | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh b/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh index 58a011448b..eac0aef1b8 100644 --- a/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh @@ -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 } diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 49d9bab959..af0c1b2473 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -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 } diff --git a/target/linux/ath79/base-files/lib/upgrade/platform.sh b/target/linux/ath79/base-files/lib/upgrade/platform.sh index 795120239a..679f46d079 100644 --- a/target/linux/ath79/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/base-files/lib/upgrade/platform.sh @@ -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 } -- 2.25.1