qualcommax: fix upgrade function for Linksys MX dual boot devices
authorPaweł Owoc <frut3k7@gmail.com>
Mon, 24 Feb 2025 12:18:46 +0000 (13:18 +0100)
committerRobert Marko <robimarko@gmail.com>
Mon, 24 Feb 2025 20:11:41 +0000 (21:11 +0100)
Function remove_oem_ubi_volume was called before CI_UBIPART variable was defined.

Fixes: https://github.com/openwrt/openwrt/commit/df1f6e1e186a99b2180abac5da87f071b7f6b3fa (qualcommax: ipq807x: Remove OEM UBI volume before upgrade for Linksys MX devices)
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18090
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh

index bafbc7bbdb717b3ffd913510c4482cb4f4e1dd32..aa71b8992e7e52c0b8df68a1df4fb24544f65545 100644 (file)
@@ -27,7 +27,7 @@ remove_oem_ubi_volume() {
        fi
 }
 
-linksys_mx_do_upgrade() {
+linksys_mx_pre_upgrade() {
        local setenv_script="/tmp/fw_env_upgrade"
 
        CI_UBIPART="rootfs"
@@ -63,7 +63,6 @@ linksys_mx_do_upgrade() {
                        return 1
                }
        fi
-       nand_do_upgrade "$1"
 }
 
 platform_check_image() {
@@ -75,8 +74,9 @@ platform_do_upgrade() {
        linksys,mx2000|\
        linksys,mx5500|\
        linksys,spnmx56)
+               linksys_mx_pre_upgrade "$1"
                remove_oem_ubi_volume squashfs
-               linksys_mx_do_upgrade "$1"
+               nand_do_upgrade "$1"
                ;;
        *)
                default_do_upgrade "$1"
index 431491c14121d8bd87da8b5babf0d304bfc4fc53..ec8d0f58b0601e26d0d22d74696b1dd918e3fcfa 100644 (file)
@@ -108,7 +108,7 @@ tplink_do_upgrade() {
        nand_do_upgrade "$1"
 }
 
-linksys_mx_do_upgrade() {
+linksys_mx_pre_upgrade() {
        local setenv_script="/tmp/fw_env_upgrade"
 
        CI_UBIPART="rootfs"
@@ -144,7 +144,6 @@ linksys_mx_do_upgrade() {
                        return 1
                }
        fi
-       nand_do_upgrade "$1"
 }
 
 platform_check_image() {
@@ -222,13 +221,15 @@ platform_do_upgrade() {
        linksys,mx4200v1|\
        linksys,mx4200v2|\
        linksys,mx4300)
+               linksys_mx_pre_upgrade "$1"
                remove_oem_ubi_volume squashfs
-               linksys_mx_do_upgrade "$1"
+               nand_do_upgrade "$1"
                ;;
        linksys,mx5300|\
        linksys,mx8500)
+               linksys_mx_pre_upgrade "$1"
                remove_oem_ubi_volume ubifs
-               linksys_mx_do_upgrade "$1"
+               nand_do_upgrade "$1"
                ;;
        prpl,haze|\
        qnap,301w)