return 1
}
-platform_nand_pre_upgrade() {
- local board=$(board_name)
+platform_do_upgrade_mikrotik_rb() {
+ CI_KERNPART=none
+ local fw_mtd=$(find_mtd_part kernel)
+ fw_mtd="${fw_mtd/block/}"
+ [ -n "$fw_mtd" ] || return
+ mtd erase kernel
+ tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
+
+ nand_do_upgrade "$1"
+}
- case "$board" in
- rb*)
- CI_KERNPART=none
- local fw_mtd=$(find_mtd_part kernel)
- fw_mtd="${fw_mtd/block/}"
- [ -n "$fw_mtd" ] || return
- mtd erase kernel
- tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
+platform_do_upgrade_nokia() {
+ case "$(fw_printenv -n dualPartition)" in
+ imgA)
+ fw_setenv dualPartition imgB
+ fw_setenv ActImg NokiaImageB
;;
- wi2a-ac200i)
- case "$(fw_printenv -n dualPartition)" in
- imgA)
- fw_setenv dualPartition imgB
- fw_setenv ActImg NokiaImageB
- ;;
- imgB)
- fw_setenv dualPartition imgA
- fw_setenv ActImg NokiaImageA
- ;;
- esac
- ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
- rm -f /dev/ubiblock0_0
- ubidetach -d 0 2>/dev/null >/dev/null
- CI_UBIPART=ubi_alt
- CI_KERNPART=kernel_alt
+ imgB)
+ fw_setenv dualPartition imgA
+ fw_setenv ActImg NokiaImageA
;;
esac
+ ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
+ rm -f /dev/ubiblock0_0
+ ubidetach -d 0 2>/dev/null >/dev/null
+ CI_UBIPART=ubi_alt
+ CI_KERNPART=kernel_alt
+
+ nand_do_upgrade "$1"
}
platform_do_upgrade() {
nbg6716|\
r6100|\
rambutan|\
+ wndr3700v4|\
+ wndr4300)
+ nand_do_upgrade "$1"
+ ;;
+ mr18|\
+ z1)
+ merakinand_do_upgrade "$1"
+ ;;
rb-411|\
rb-411u|\
rb-433|\
rb-2011uias-2hnd|\
rb-2011uias-2hnd-r2|\
rb-sxt2n|\
- rb-sxt5n|\
- wi2a-ac200i|\
- wndr3700v4|\
- wndr4300)
- nand_do_upgrade "$1"
- ;;
- mr18|\
- z1)
- merakinand_do_upgrade "$1"
+ rb-sxt5n)
+ platform_do_upgrade_mikrotik_rb "$1"
;;
uap-pro|\
unifi-outdoor-plus)
MTD_CONFIG_ARGS="-s 0x180000"
default_do_upgrade "$1"
;;
+ wi2a-ac200i)
+ platform_do_upgrade_nokia "$1"
+ ;;
wp543|\
wpe72)
platform_do_upgrade_compex "$1"
platform_do_upgrade() {
case "$(board_name)" in
8dev,jalapeno |\
- alfa-network,ap120c-ac |\
avm,fritzbox-7530 |\
avm,fritzrepeater-3000 |\
qxwlan,e2600ac-c2)
nand_do_upgrade "$1"
;;
+ alfa-network,ap120c-ac)
+ part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
+ if [ "$part" = "rootfs1" ]; then
+ fw_setenv active 2 || exit 1
+ CI_UBIPART="rootfs2"
+ else
+ fw_setenv active 1 || exit 1
+ CI_UBIPART="rootfs1"
+ fi
+ nand_do_upgrade "$1"
+ ;;
asus,map-ac2200)
CI_KERNPART="linux"
nand_do_upgrade "$1"
;;
esac
}
-
-platform_nand_pre_upgrade() {
- case "$(board_name)" in
- alfa-network,ap120c-ac)
- part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
- if [ "$part" = "rootfs1" ]; then
- fw_setenv active 2 || exit 1
- CI_UBIPART="rootfs2"
- else
- fw_setenv active 1 || exit 1
- CI_UBIPART="rootfs1"
- fi
- ;;
- asus,rt-ac58u)
- CI_UBIPART="UBI_DEV"
- CI_KERNPART="linux"
- ;;
- meraki,mr33)
- CI_KERNPART="part.safe"
- ;;
- esac
-}
return 0
}
-platform_nand_pre_upgrade() {
- local board=$(board_name)
-
- case "$board" in
- ubiquiti,edgerouterx|\
- ubiquiti,edgerouterx-sfp)
- platform_upgrade_ubnt_erx "$1"
- ;;
- esac
-}
-
platform_do_upgrade() {
local board=$(board_name)
hiwifi,hc5962|\
netgear,r6220|\
netgear,r6350|\
- ubiquiti,edgerouterx|\
- ubiquiti,edgerouterx-sfp|\
xiaomi,mir3g|\
xiaomi,mir3p)
nand_do_upgrade "$1"
MTD_ARGS="-t romfile"
default_do_upgrade "$1"
;;
+ ubiquiti,edgerouterx|\
+ ubiquiti,edgerouterx-sfp)
+ platform_upgrade_ubnt_erx "$1"
+ ;;
*)
default_do_upgrade "$1"
;;