summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChukun Pan2024-06-10 15:18:19 +0000
committerRobert Marko2024-06-13 16:01:03 +0000
commit0a76244a72157ff06d2c7d309b477522d4975a95 (patch)
tree4ae218603c778491fd47369c68f51cdd5c24be24
parentce51f27fb0f8461e61966e01dcd3a91201b5b382 (diff)
downloadopenwrt-0a76244a72157ff06d2c7d309b477522d4975a95.tar.gz
qualcommax: ipq807x: fix sysupgrade for ZBT-Z800AX
This router has two rootfs partitions and dualboot is used. Vendor firmware may swap the rootfs partition location, u-boot append 'ubi.mtd=rootfs' in the end of cmdline. Since we use fixed-partitions, force boot from the first rootfs partition to avoid boot failure. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> Link: https://github.com/openwrt/openwrt/pull/15700 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts2
-rw-r--r--target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh15
2 files changed, 13 insertions, 4 deletions
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts
index c352b72567..814a7cb2bd 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts
@@ -154,13 +154,11 @@
partition@60000 {
label = "0:bootconfig";
reg = <0x60000 0x20000>;
- read-only;
};
partition@80000 {
label = "0:bootconfig1";
reg = <0x80000 0x20000>;
- read-only;
};
partition@a0000 {
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 2008334213..5d89554133 100644
--- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
@@ -53,8 +53,7 @@ platform_do_upgrade() {
netgear,sxs80|\
netgear,wax218|\
netgear,wax620|\
- netgear,wax630|\
- zbtlink,zbt-z800ax)
+ netgear,wax630)
nand_do_upgrade "$1"
;;
buffalo,wxr-5950ax12)
@@ -132,6 +131,18 @@ platform_do_upgrade() {
fw_setenv upgrade_available 1
nand_do_upgrade "$1"
;;
+ zbtlink,zbt-z800ax)
+ local mtdnum="$(find_mtd_index 0:bootconfig)"
+ local alt_mtdnum="$(find_mtd_index 0:bootconfig1)"
+ part_num="$(hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd$mtdnum | cut -f 1 -d "|" | head -n1)"
+ # vendor firmware may swap the rootfs partition location, u-boot append: ubi.mtd=rootfs
+ # since we use fixed-partitions, need to force boot from the first rootfs partition
+ if [ "$part_num" -eq "1" ]; then
+ mtd erase /dev/mtd$mtdnum
+ mtd erase /dev/mtd$alt_mtdnum
+ fi
+ nand_do_upgrade "$1"
+ ;;
zte,mf269)
CI_KERN_UBIPART="ubi_kernel"
CI_ROOT_UBIPART="rootfs"