[openwrt/openwrt] qualcommax: ipq807x: Add ability to perform upgrade on current partition for Linksys MX devices

LEDE Commits lede-commits at lists.infradead.org
Wed Jan 29 07:53:26 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f1f1b08db553d874666a0da8435d50b1ab827a3c

commit f1f1b08db553d874666a0da8435d50b1ab827a3c
Author: Paweł Owoc <frut3k7 at gmail.com>
AuthorDate: Sat Feb 24 20:47:58 2024 +0100

    qualcommax: ipq807x: Add ability to perform upgrade on current partition for Linksys MX devices
    
    Dual firmware devices like Linksys MX4200, MX4300, MX5300 and MX8500 use separate rootfs partition.
    This option helps to keep all configuration during upgrade.
    
    Signed-off-by: Paweł Owoc <frut3k7 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/14720
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../ipq807x/base-files/lib/upgrade/platform.sh     | 35 ++++++++++++++--------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
index 2d68ec62ed..3bfeb1366b 100644
--- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
@@ -108,6 +108,28 @@ tplink_do_upgrade() {
 	nand_do_upgrade "$1"
 }
 
+linksys_mx_do_upgrade() {
+	CI_UBIPART="rootfs"
+	boot_part="$(fw_printenv -n boot_part)"
+	if [ -n "$UPGRADE_OPT_USE_CURR_PART" ]; then
+		if [ "$boot_part" -eq "2" ]; then
+			CI_KERNPART="alt_kernel"
+			CI_UBIPART="alt_rootfs"
+		fi
+	else
+		if [ "$boot_part" -eq "1" ]; then
+			fw_setenv boot_part 2
+			CI_KERNPART="alt_kernel"
+			CI_UBIPART="alt_rootfs"
+		else
+			fw_setenv boot_part 1
+		fi
+	fi
+	fw_setenv boot_part_ready 3
+	fw_setenv auto_recovery yes
+	nand_do_upgrade "$1"
+}
+
 platform_check_image() {
 	return 0;
 }
@@ -176,18 +198,7 @@ platform_do_upgrade() {
 	linksys,mx4300|\
 	linksys,mx5300|\
 	linksys,mx8500)
-		boot_part="$(fw_printenv -n boot_part)"
-		if [ "$boot_part" -eq "1" ]; then
-			fw_setenv boot_part 2
-			CI_KERNPART="alt_kernel"
-			CI_UBIPART="alt_rootfs"
-		else
-			fw_setenv boot_part 1
-			CI_UBIPART="rootfs"
-		fi
-		fw_setenv boot_part_ready 3
-		fw_setenv auto_recovery yes
-		nand_do_upgrade "$1"
+		linksys_mx_do_upgrade "$1"
 		;;
 	prpl,haze|\
 	qnap,301w)




More information about the lede-commits mailing list