aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips')
-rwxr-xr-xtarget/linux/ramips/base-files/etc/init.d/bootcount13
-rwxr-xr-xtarget/linux/ramips/base-files/lib/upgrade/platform.sh17
2 files changed, 27 insertions, 3 deletions
diff --git a/target/linux/ramips/base-files/etc/init.d/bootcount b/target/linux/ramips/base-files/etc/init.d/bootcount
index 0f260fa3fc..12326de0e3 100755
--- a/target/linux/ramips/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/base-files/etc/init.d/bootcount
@@ -5,8 +5,15 @@ START=99
start() {
. /lib/functions.sh
- local board=$(board_name)
- if [ $board = "sk-wb8" ]; then
+ case $(board_name) in
+ alfa-network,ac1200rm|\
+ alfa-network,awusfree1|\
+ alfa-network,tube-e4g)
+ [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\
+ echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s -
+ ;;
+ sk-wb8)
fw_setenv bootcount 0
- fi
+ ;;
+ esac
}
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index c4a09cb40e..eff2ba967c 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -5,6 +5,9 @@
PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
+RAMFS_COPY_BIN='fw_printenv fw_setenv'
+RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
+
platform_check_image() {
return 0
}
@@ -36,6 +39,20 @@ platform_do_upgrade() {
local board=$(board_name)
case "$board" in
+ alfa-network,ac1200rm|\
+ alfa-network,awusfree1|\
+ alfa-network,tube-e4g)
+ [ "$(fw_printenv -n dual_image 2>/dev/null)" = "1" ] &&\
+ [ -n "$(find_mtd_part backup)" ] && {
+ PART_NAME=backup
+ if [ "$(fw_printenv -n bootactive 2>/dev/null)" = "1" ]; then
+ fw_setenv bootactive 2 || exit 1
+ else
+ fw_setenv bootactive 1 || exit 1
+ fi
+ }
+ default_do_upgrade "$1"
+ ;;
hc5962|\
r6220|\
netgear,r6350|\