From 9ff18b1e8b9417c50566f469d8b3f5f36bef746a Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Fri, 11 Mar 2022 16:13:41 +0100
Subject: [PATCH] ipq40xx: disable dualboot on ecw5211

Signed-off-by: John Crispin <john@phrozen.org>
---
 target/linux/ipq40xx/base-files/etc/init.d/bootcount | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/target/linux/ipq40xx/base-files/etc/init.d/bootcount b/target/linux/ipq40xx/base-files/etc/init.d/bootcount
index d2a4abcadd..36b5d56d0c 100755
--- a/target/linux/ipq40xx/base-files/etc/init.d/bootcount
+++ b/target/linux/ipq40xx/base-files/etc/init.d/bootcount
@@ -13,5 +13,13 @@ boot() {
 	linksys,mr8300)
 		mtd resetbc s_env || true
 		;;
+	edgecore,spw2ac1200|\
+	edgecore,spw2ac1200-lan-poe|\
+	edgecore,ecw5211)
+		avail=$(fw_printenv -n upgrade_available)
+		[ ${avail} -eq 0 ] || {
+			fw_setenv bootcount 0
+			fw_setenv upgrade_available 0
+		}
 	esac
 }
-- 
2.25.1

