From 73f42e3c6f7f2a6a26b2498ef1bc74af63232b64 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 21 Apr 2022 11:49:20 +0200 Subject: [PATCH] ipq807x: enable dual boot on HFCL ION4X* Signed-off-by: John Crispin --- .../ipq807x/ipq807x/base-files/etc/init.d/bootcount | 4 ++++ .../ipq807x/base-files/lib/upgrade/platform.sh | 13 +++++++++++-- .../tip/certificates/files/etc/init.d/certificates | 8 ++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount b/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount index 999cc3809..d0fc40e3c 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount +++ b/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount @@ -4,6 +4,10 @@ START=99 boot() { case "$(board_name)" in + hfcl,ion4xe|\ + hfcl,ion4xi) + fw_setenv boot_count 0 + ;; edgecore,eap101|\ edgecore,eap102) avail=$(fw_printenv -n upgrade_available) diff --git a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh index 6fd9828d9..13672a979 100755 --- a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh +++ b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh @@ -70,8 +70,6 @@ platform_do_upgrade() { edgecore,eap104|\ glinet,ax1800|\ glinet,axt1800|\ - hfcl,ion4xi|\ - hfcl,ion4xe|\ qcom,ipq6018-cp01|\ qcom,ipq807x-hk01|\ qcom,ipq807x-hk14|\ @@ -83,6 +81,17 @@ platform_do_upgrade() { tplink,ex227) nand_upgrade_tar "$1" ;; + hfcl,ion4xi|\ + hfcl,ion4xe) + if grep -q rootfs_1 /proc/cmdline; then + CI_UBIPART="rootfs" + fw_setenv primary 0 || exit 1 + else + CI_UBIPART="rootfs_1" + fw_setenv primary 1 || exit 1 + fi + nand_upgrade_tar "$1" + ;; edgecore,eap106) CI_UBIPART="rootfs1" [ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs" diff --git a/feeds/tip/certificates/files/etc/init.d/certificates b/feeds/tip/certificates/files/etc/init.d/certificates index fd8f59bd2..67c5680da 100755 --- a/feeds/tip/certificates/files/etc/init.d/certificates +++ b/feeds/tip/certificates/files/etc/init.d/certificates @@ -53,6 +53,14 @@ boot() { PART_NAME=rootfs1 fi ;; + hfcl,ion4xi|\ + hfcl,ion4xe) + if grep -q rootfs_1 /proc/cmdline; then + PART_NAME=rootfs + else + PART_NAME=rootfs_1 + fi + ;; *) return 1 ;;