X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Framips%2Fmt7620%2Fbase-files%2Flib%2Fupgrade%2Fplatform.sh;h=aad243c1f9776d6bb0368fc4bc923cb55c0841c7;hb=bc173ddd8381b03dde8cc2e6c66d0cd392c62bbd;hp=786d57fc70432f526d98734ad778f8c7ac0ab65d;hpb=19724e28c81e3ff642f09c49f612cd147c54a697;p=openwrt%2Fstaging%2Fmkresin.git diff --git a/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh index 786d57fc70..aad243c1f9 100755 --- a/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7620/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 } @@ -13,6 +16,19 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in + alfa-network,ac1200rm|\ + 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" + ;; *) default_do_upgrade "$1" ;;