From 87a77e5225d1bbcc0ea3f871512c0e3de47a9adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Sat, 24 Feb 2024 20:47:58 +0100 Subject: [PATCH] qualcommax: ipq807x: Add ability to perform upgrade on current partition for MX4200/MX5300/MX8500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dual firmware devices like Linksys MX4200, MX5300 and MX8500 use separate rootfs partition. This option helps to keep all configuration during upgrade. Signed-off-by: Paweł Owoc --- .../ipq807x/base-files/lib/upgrade/platform.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 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 22fcd5b632ddd6..8c6cd601703f83 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -176,13 +176,19 @@ platform_do_upgrade() { 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" + if [ -n "$UPGRADE_OPT_CURR_PARTITION" ]; then + if [ "$boot_part" -eq "2" ]; then + CI_KERNPART="alt_kernel" + CI_UBIPART="alt_rootfs" + fi else - fw_setenv boot_part 1 - CI_UBIPART="rootfs" + 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