Calling nand_do_upgrade() from platform_pre_upgrade() was deprecated
with
30f61a34b4cf ("base-files: always use staged sysupgrade").
Update the platform upgrade code to use platform_do_upgrade() for NAND
images as well.
Signed-off-by: Mathias Kresin <dev@kresin.me>
esac
}
-platform_pre_upgrade() {
- local board=$(board_name)
-
- case "$board" in
- meraki,mr24|\
- meraki,mx60|\
- netgear,wndr4700)
- nand_do_upgrade "$1"
- ;;
-
- *)
- ;;
- esac
-}
-
platform_do_upgrade() {
local board=$(board_name)
wd,mybooklive-duo)
mbl_do_upgrade "$ARGV"
;;
-
+ meraki,mr24|\
+ meraki,mx60|\
+ netgear,wndr4700)
+ nand_do_upgrade "$1"
+ ;;
*)
default_do_upgrade "$ARGV"
;;
local board=$(board_name)
case "$board" in
- c-60|\
- hiveap-121|\
- nbg6716|\
- r6100|\
- rambutan|\
- 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-5hpacd|\
- rb-911g-5hpnd|\
- rb-912uag-2hpnd|\
- rb-912uag-5hpnd|\
- rb-921gs-5hpacd-r2|\
- rb-951g-2hnd|\
- rb-951ui-2hnd|\
- rb-2011il|\
- rb-2011l|\
- rb-2011uas|\
- rb-2011uas-2hnd|\
- rb-2011uias|\
- rb-2011uias-2hnd|\
- rb-sxt2n|\
- rb-sxt5n|\
- wi2a-ac200i|\
- wndr3700v4|\
- wndr4300)
- nand_do_upgrade "$1"
- ;;
rb-750-r2|\
rb-750p-pbr2|\
rb-750up-r2|\
# erase firmware if booted from initramfs
[ -z "$(rootfs_type)" ] && mtd erase firmware
;;
- mr18|\
- z1)
- merakinand_do_upgrade "$1"
- ;;
esac
}
om5p-an)
platform_do_upgrade_openmesh "$ARGV"
;;
+ c-60|\
+ hiveap-121|\
+ nbg6716|\
+ r6100|\
+ rambutan|\
+ 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-5hpacd|\
+ rb-911g-5hpnd|\
+ rb-912uag-2hpnd|\
+ rb-912uag-5hpnd|\
+ rb-921gs-5hpacd-r2
+ rb-951g-2hnd|\
+ rb-951ui-2hnd|\
+ rb-2011il|\
+ rb-2011l|\
+ rb-2011uas|\
+ rb-2011uas-2hnd|\
+ rb-2011uias|\
+ rb-2011uias-2hnd|\
+ rb-sxt2n|\
+ rb-sxt5n|\
+ wi2a-ac200i|\
+ wndr3700v4|\
+ wndr4300)
+ nand_do_upgrade "$1"
+ ;;
+ mr18|\
+ z1)
+ merakinand_do_upgrade "$1"
+ ;;
uap-pro|\
unifi-outdoor-plus)
MTD_CONFIG_ARGS="-s 0x180000"
return 1
}
-platform_pre_upgrade() {
+platform_do_upgrade() {
local board=$(board_name)
case "$board" in
return 0
}
-platform_pre_upgrade() {
+platform_do_upgrade() {
local board=$(board_name)
case "$board" in
bt,homehub-v2b|bt,homehub-v3a|bt,homehub-v5a|zyxel,p-2812hnu-f1|zyxel,p-2812hnu-f3)
nand_do_upgrade $1
;;
+ *)
+ default_do_upgrade "$ARGV"
+ ;;
esac
}
-
-# use default for platform_do_upgrade()
local tar_file="$1"
local board="$(board_name)"
- echo "flashing kernel"
- tar xf $tar_file sysupgrade-$board/kernel -O | mtd write - kernel
+ case "$(board_name)" in
+ mediatek,mt7623-rfb-nand-ephy |\
+ mediatek,mt7623-rfb-nand)
+ nand_do_upgrade $1
+ ;;
+ *)
+ echo "flashing kernel"
+ tar xf $tar_file sysupgrade-$board/kernel -O | mtd write - kernel
- echo "flashing rootfs"
- tar xf $tar_file sysupgrade-$board/root -O | mtd write - rootfs
+ echo "flashing rootfs"
+ tar xf $tar_file sysupgrade-$board/root -O | mtd write - rootfs
- return 0
+ return 0
+ ;;
+ esac
}
platform_check_image() {
return $?
}
-platform_pre_upgrade() {
+platform_do_upgrade() {
nand_do_upgrade $1
}
return $?
}
-platform_pre_upgrade() {
+platform_do_upgrade() {
# TODO no need to switch to ramfs with dual partitions in
# fact we don't even want to reboot as part of seamless
# upgrades. Instead just upgrade opposite partition and mark
return 0;
}
-platform_pre_upgrade() {
- nand_do_upgrade "$1"
-}
-
platform_nand_pre_upgrade() {
mtd erase kernel
tar xf "$1" "sysupgrade-$(board_name)/kernel" -O | nandwrite -o /dev/mtd0 -
}
platform_do_upgrade() {
- default_do_upgrade "$ARGV"
+ nand_do_upgrade "$1"
}