wlan-ap-Telecominfraproject/patches/0029-ipq40xx-enable-dualboot-on-ecw5211.patch
John Crispin 73d949cf3f 23.05: update patches
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00

96 lines
2.9 KiB
Diff

From 97f0b48681010e9b6c4b224da5e28101dd9dd5a5 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Sat, 15 Jul 2023 11:59:02 +0200
Subject: [PATCH] ipq40xx: enable dualboot on ecw5211
Signed-off-by: John Crispin <john@phrozen.org>
---
.../ipq40xx/base-files/etc/init.d/bootcount | 11 +++++++++++
.../base-files/lib/upgrade/platform.sh | 19 ++++++++++++++++++-
.../arm/boot/dts/qcom-ipq4018-ecw5211.dts | 10 ++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/target/linux/ipq40xx/base-files/etc/init.d/bootcount b/target/linux/ipq40xx/base-files/etc/init.d/bootcount
index df656c9b85..f6921089bd 100755
--- a/target/linux/ipq40xx/base-files/etc/init.d/bootcount
+++ b/target/linux/ipq40xx/base-files/etc/init.d/bootcount
@@ -8,6 +8,17 @@ boot() {
[ -n "$(fw_printenv bootcount changed 2>/dev/null)" ] &&\
echo -e "bootcount\nchanged\n" | /usr/sbin/fw_setenv -s -
;;
+ edgecore,ecw5211)
+ part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | cut -d " " -f1)"
+ case "$part" in
+ rootfs1|\
+ rootfs2)
+ avail=$(fw_printenv -n upgrade_available)
+ [ ${avail} -ne 1 ] && fw_setenv upgrade_available 1
+ fw_setenv bootcount 0
+ ;;
+ esac
+ ;;
linksys,ea6350v3|\
linksys,ea8300|\
linksys,mr8300|\
diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
index e6e99b9d21..651ddb8177 100644
--- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
@@ -110,7 +110,6 @@ platform_do_upgrade() {
avm,fritzrepeater-3000 |\
buffalo,wtr-m2133hp |\
cilab,meshpoint-one |\
- edgecore,ecw5211 |\
edgecore,oap100 |\
engenius,eap2200 |\
glinet,gl-a1300 |\
@@ -157,6 +156,24 @@ platform_do_upgrade() {
compex,wpj419)
nand_do_upgrade "$1"
;;
+ edgecore,ecw5211)
+ mkdir -p /var/lock/
+ part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | cut -d " " -f 1)"
+ case "$part" in
+ rootfs1)
+ fw_setenv active 2 || exit 1
+ CI_UBIPART="rootfs2"
+ ;;
+ rootfs2)
+ fw_setenv active 1 || exit 1
+ CI_UBIPART="rootfs1"
+ ;;
+ *)
+ # legacy bootloader
+ ;;
+ esac
+ nand_do_upgrade "$1"
+ ;;
google,wifi)
export_bootdevice
export_partdevice CI_ROOTDEV 0
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts
index 3060b7bd1c..e3e1785e1f 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts
@@ -255,6 +255,16 @@
label = "rootfs";
reg = <0x00000000 0x04000000>;
};
+
+ partition@1 {
+ label = "rootfs1";
+ reg = <0x00000000 0x04000000>;
+ };
+
+ partition@4000000 {
+ label = "rootfs2";
+ reg = <0x04000000 0x04000000>;
+ };
};
};
};
--
2.34.1