aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/base-files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-07-17 11:32:54 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-07-22 14:27:37 +0200
commit1cbe0d659c4438cc6348093385a24e969aeadac0 (patch)
treef901d8057341186f0fe8a8bee22ae9398f54b649 /target/linux/ar71xx/base-files
parent3b30ff29757258a0e16f51a86cdbb2a74a67ff7e (diff)
downloadupstream-1cbe0d659c4438cc6348093385a24e969aeadac0.tar.gz
upstream-1cbe0d659c4438cc6348093385a24e969aeadac0.tar.bz2
upstream-1cbe0d659c4438cc6348093385a24e969aeadac0.zip
treewide: sysupgrade: get rid of platform_nand_pre_upgrade()
1) nand_do_upgrade() is always called by a target code 2) nand_do_upgrade() starts with calling platform_nand_pre_upgrade() It means there is no need for the platform_nand_pre_upgrade() callback at all. All code that was present there could bo moved & simplly called by a target right before the nand_do_upgrade(). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/ar71xx/base-files')
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/upgrade/platform.sh73
1 files changed, 38 insertions, 35 deletions
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 5de7af667f..6898c0e0c2 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -746,36 +746,35 @@ platform_check_image() {
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() {
@@ -859,6 +858,14 @@ platform_do_upgrade() {
nbg6716|\
r6100|\
rambutan|\
+ wndr3700v4|\
+ wndr4300)
+ nand_do_upgrade "$1"
+ ;;
+ mr18|\
+ z1)
+ merakinand_do_upgrade "$1"
+ ;;
rb-411|\
rb-411u|\
rb-433|\
@@ -890,21 +897,17 @@ platform_do_upgrade() {
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"