mirror of https://github.com/hak5/openwrt.git
treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()
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>master
parent
d9593b0809
commit
8b4bc7abe0
|
@ -22,7 +22,7 @@ platform_do_upgrade() {
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
wd,mybooklive)
|
wd,mybooklive)
|
||||||
mbl_do_upgrade "$ARGV"
|
mbl_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
meraki,mr24|\
|
meraki,mr24|\
|
||||||
meraki,mx60|\
|
meraki,mx60|\
|
||||||
|
@ -32,7 +32,7 @@ platform_do_upgrade() {
|
||||||
nand_do_upgrade "$1"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,7 @@ platform_do_upgrade_dir825b() {
|
||||||
else
|
else
|
||||||
PART_NAME="firmware"
|
PART_NAME="firmware"
|
||||||
fi
|
fi
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
"43493030")
|
"43493030")
|
||||||
if [ -z "$fw_mtd" ]; then
|
if [ -z "$fw_mtd" ]; then
|
||||||
|
@ -159,7 +159,7 @@ platform_do_upgrade_dir825b() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
dir825b_do_upgrade_combined "firmware" "$ARGV"
|
dir825b_do_upgrade_combined "firmware" "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -806,7 +806,7 @@ platform_do_upgrade() {
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
all0258n)
|
all0258n)
|
||||||
platform_do_upgrade_allnet "0x9f050000" "$ARGV"
|
platform_do_upgrade_allnet "0x9f050000" "$1"
|
||||||
;;
|
;;
|
||||||
all0305|\
|
all0305|\
|
||||||
eap7660d|\
|
eap7660d|\
|
||||||
|
@ -818,19 +818,19 @@ platform_do_upgrade() {
|
||||||
pb44|\
|
pb44|\
|
||||||
routerstation|\
|
routerstation|\
|
||||||
routerstation-pro)
|
routerstation-pro)
|
||||||
platform_do_upgrade_combined "$ARGV"
|
platform_do_upgrade_combined "$1"
|
||||||
;;
|
;;
|
||||||
all0315n)
|
all0315n)
|
||||||
platform_do_upgrade_allnet "0x9f080000" "$ARGV"
|
platform_do_upgrade_allnet "0x9f080000" "$1"
|
||||||
;;
|
;;
|
||||||
cap4200ag|\
|
cap4200ag|\
|
||||||
eap300v2|\
|
eap300v2|\
|
||||||
ens202ext)
|
ens202ext)
|
||||||
platform_do_upgrade_allnet "0xbf0a0000" "$ARGV"
|
platform_do_upgrade_allnet "0xbf0a0000" "$1"
|
||||||
;;
|
;;
|
||||||
dir-825-b1|\
|
dir-825-b1|\
|
||||||
tew-673gru)
|
tew-673gru)
|
||||||
platform_do_upgrade_dir825b "$ARGV"
|
platform_do_upgrade_dir825b "$1"
|
||||||
;;
|
;;
|
||||||
a40|\
|
a40|\
|
||||||
a60|\
|
a60|\
|
||||||
|
@ -852,7 +852,7 @@ platform_do_upgrade() {
|
||||||
om5p-ac|\
|
om5p-ac|\
|
||||||
om5p-acv2|\
|
om5p-acv2|\
|
||||||
om5p-an)
|
om5p-an)
|
||||||
platform_do_upgrade_openmesh "$ARGV"
|
platform_do_upgrade_openmesh "$1"
|
||||||
;;
|
;;
|
||||||
c-60|\
|
c-60|\
|
||||||
hiveap-121|\
|
hiveap-121|\
|
||||||
|
@ -903,14 +903,14 @@ platform_do_upgrade() {
|
||||||
uap-pro|\
|
uap-pro|\
|
||||||
unifi-outdoor-plus)
|
unifi-outdoor-plus)
|
||||||
MTD_CONFIG_ARGS="-s 0x180000"
|
MTD_CONFIG_ARGS="-s 0x180000"
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
wp543|\
|
wp543|\
|
||||||
wpe72)
|
wpe72)
|
||||||
platform_do_upgrade_compex "$ARGV"
|
platform_do_upgrade_compex "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,14 +41,14 @@ platform_do_upgrade() {
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
jjplus,ja76pf2)
|
jjplus,ja76pf2)
|
||||||
redboot_fis_do_upgrade "$ARGV" linux
|
redboot_fis_do_upgrade "$1" linux
|
||||||
;;
|
;;
|
||||||
ubnt,routerstation|\
|
ubnt,routerstation|\
|
||||||
ubnt,routerstation-pro)
|
ubnt,routerstation-pro)
|
||||||
redboot_fis_do_upgrade "$ARGV" kernel
|
redboot_fis_do_upgrade "$1" kernel
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@ platform_check_image() {
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_do_upgrade() {
|
platform_do_upgrade() {
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ platform_do_upgrade() {
|
||||||
case "$board" in
|
case "$board" in
|
||||||
dlink,dir-685)
|
dlink,dir-685)
|
||||||
PART_NAME=firmware
|
PART_NAME=firmware
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ platform_do_upgrade() {
|
||||||
avm,fritzbox-7530 |\
|
avm,fritzbox-7530 |\
|
||||||
avm,fritzrepeater-3000 |\
|
avm,fritzrepeater-3000 |\
|
||||||
qxwlan,e2600ac-c2)
|
qxwlan,e2600ac-c2)
|
||||||
nand_do_upgrade "$ARGV"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
asus,map-ac2200)
|
asus,map-ac2200)
|
||||||
CI_KERNPART="linux"
|
CI_KERNPART="linux"
|
||||||
|
@ -64,7 +64,7 @@ platform_do_upgrade() {
|
||||||
;;
|
;;
|
||||||
linksys,ea6350v3 |\
|
linksys,ea6350v3 |\
|
||||||
linksys,ea8300)
|
linksys,ea8300)
|
||||||
platform_do_upgrade_linksys "$ARGV"
|
platform_do_upgrade_linksys "$1"
|
||||||
;;
|
;;
|
||||||
meraki,mr33)
|
meraki,mr33)
|
||||||
CI_KERNPART="part.safe"
|
CI_KERNPART="part.safe"
|
||||||
|
@ -73,13 +73,13 @@ platform_do_upgrade() {
|
||||||
openmesh,a42 |\
|
openmesh,a42 |\
|
||||||
openmesh,a62)
|
openmesh,a62)
|
||||||
PART_NAME="inactive"
|
PART_NAME="inactive"
|
||||||
platform_do_upgrade_openmesh "$ARGV"
|
platform_do_upgrade_openmesh "$1"
|
||||||
;;
|
;;
|
||||||
zyxel,nbg6617)
|
zyxel,nbg6617)
|
||||||
zyxel_do_upgrade "$1"
|
zyxel_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ platform_do_upgrade() {
|
||||||
buffalo,wxr-2533dhp)
|
buffalo,wxr-2533dhp)
|
||||||
buffalo_upgrade_prepare_ubi
|
buffalo_upgrade_prepare_ubi
|
||||||
CI_ROOTPART="ubi_rootfs"
|
CI_ROOTPART="ubi_rootfs"
|
||||||
nand_do_upgrade "$ARGV"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
compex,wpq864|\
|
compex,wpq864|\
|
||||||
netgear,d7800 |\
|
netgear,d7800 |\
|
||||||
|
@ -23,24 +23,24 @@ platform_do_upgrade() {
|
||||||
qcom,ipq8064-ap148 |\
|
qcom,ipq8064-ap148 |\
|
||||||
qcom,ipq8064-ap161 |\
|
qcom,ipq8064-ap161 |\
|
||||||
zyxel,nbg6817)
|
zyxel,nbg6817)
|
||||||
nand_do_upgrade "$ARGV"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
linksys,ea8500)
|
linksys,ea8500)
|
||||||
platform_do_upgrade_linksys "$ARGV"
|
platform_do_upgrade_linksys "$1"
|
||||||
;;
|
;;
|
||||||
tplink,c2600)
|
tplink,c2600)
|
||||||
PART_NAME="os-image:rootfs"
|
PART_NAME="os-image:rootfs"
|
||||||
MTD_CONFIG_ARGS="-s 0x200000"
|
MTD_CONFIG_ARGS="-s 0x200000"
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
tplink,vr2600v)
|
tplink,vr2600v)
|
||||||
PART_NAME="kernel:rootfs"
|
PART_NAME="kernel:rootfs"
|
||||||
MTD_CONFIG_ARGS="-s 0x200000"
|
MTD_CONFIG_ARGS="-s 0x200000"
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
nec,wg2600hp |\
|
nec,wg2600hp |\
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,10 +128,10 @@ platform_do_upgrade() {
|
||||||
v "board=$board"
|
v "board=$board"
|
||||||
case "$board" in
|
case "$board" in
|
||||||
avila | cambria )
|
avila | cambria )
|
||||||
platform_do_upgrade_combined "$ARGV"
|
platform_do_upgrade_combined "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ platform_do_upgrade() {
|
||||||
case "$board" in
|
case "$board" in
|
||||||
"linksys,audi"|\
|
"linksys,audi"|\
|
||||||
"linksys,viper")
|
"linksys,viper")
|
||||||
platform_do_upgrade_linksys "$ARGV"
|
platform_do_upgrade_linksys "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
nand_do_upgrade "$ARGV"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ platform_do_upgrade() {
|
||||||
nand_do_upgrade $1
|
nand_do_upgrade $1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ platform_do_upgrade_traverse_nandubi() {
|
||||||
CI_UBIPART="nandubi"
|
CI_UBIPART="nandubi"
|
||||||
CI_KERNPART="kernel${newbootsys}"
|
CI_KERNPART="kernel${newbootsys}"
|
||||||
CI_ROOTPART="rootfs${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() {
|
platform_check_image() {
|
||||||
|
@ -42,7 +42,7 @@ platform_do_upgrade() {
|
||||||
case "$board" in
|
case "$board" in
|
||||||
traverse,ls1043v | \
|
traverse,ls1043v | \
|
||||||
traverse,ls1043s)
|
traverse,ls1043s)
|
||||||
platform_do_upgrade_traverse_nandubi "$ARGV"
|
platform_do_upgrade_traverse_nandubi "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Sysupgrade is not currently supported on $board"
|
echo "Sysupgrade is not currently supported on $board"
|
||||||
|
|
|
@ -19,7 +19,7 @@ platform_do_upgrade() {
|
||||||
umount /tmp/recovery
|
umount /tmp/recovery
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,10 @@ platform_do_upgrade() {
|
||||||
case "$board" in
|
case "$board" in
|
||||||
ocedo,panda|\
|
ocedo,panda|\
|
||||||
sophos,red-15w-rev1)
|
sophos,red-15w-rev1)
|
||||||
nand_do_upgrade "$ARGV"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,14 +22,14 @@ platform_check_image() {
|
||||||
platform_do_upgrade() {
|
platform_do_upgrade() {
|
||||||
case "$(board_name)" in
|
case "$(board_name)" in
|
||||||
linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
|
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|\
|
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)
|
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
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ platform_nand_pre_upgrade() {
|
||||||
case "$board" in
|
case "$board" in
|
||||||
ubiquiti,edgerouterx|\
|
ubiquiti,edgerouterx|\
|
||||||
ubiquiti,edgerouterx-sfp)
|
ubiquiti,edgerouterx-sfp)
|
||||||
platform_upgrade_ubnt_erx "$ARGV"
|
platform_upgrade_ubnt_erx "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -39,14 +39,14 @@ platform_do_upgrade() {
|
||||||
ubiquiti,edgerouterx-sfp|\
|
ubiquiti,edgerouterx-sfp|\
|
||||||
xiaomi,mir3g|\
|
xiaomi,mir3g|\
|
||||||
xiaomi,mir3p)
|
xiaomi,mir3p)
|
||||||
nand_do_upgrade "$ARGV"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
tplink,archer-c50-v4)
|
tplink,archer-c50-v4)
|
||||||
MTD_ARGS="-t romfile"
|
MTD_ARGS="-t romfile"
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
default_do_upgrade "$ARGV"
|
default_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue