]> git.ipfire.org Git - thirdparty/openwrt.git/commit
qualcommax: ipq60xx: enable dual-boot for 360v6 21154/head
authorZhenyu Qi <qzydustin@hotmail.com>
Sat, 13 Dec 2025 21:04:51 +0000 (14:04 -0700)
committerRobert Marko <robimarko@gmail.com>
Sun, 28 Dec 2025 11:45:40 +0000 (12:45 +0100)
commitfa3b9f514942aab672dc4473d218370970c221b3
tree2fca5718bd29d902a12a908a88a5f20cb6fc3a8f
parent08a1cace9f06c9d13f0634c6dbf467d0edbde86c
qualcommax: ipq60xx: enable dual-boot for 360v6

Add dual-partition upgrade support for Qihoo 360v6 using the generic
bootconfig.sh library. This enables safe system upgrades with automatic
failover capability.

The device uses Qualcomm's bootconfig structure to control A/B partition
switching. The bootloader dynamically maps physical NAND partitions to
logical MTD devices based on the bootconfig, ensuring firmware always
writes to the inactive partition.

Implementation details:
- Use bootconfig.sh library (copied from ipq50xx) for bootconfig operations
- Operate on 'rootfs' partition by name instead of hardcoded offset
- Add magic header validation for safety
- Remove OEM UBI volumes (wifi_fw and ubi_rootfs) before sysupgrade
- Toggle bootconfig before removing OEM volumes

Hardware details:
- SoC: Qualcomm IPQ6000
- Flash: NAND with dual rootfs partitions (mtd16/mtd17)
- Bootconfig: controls slot selection via partition name lookup

Installation:
Standard sysupgrade process. After upgrade, the system will boot
from the new partition while preserving the old system as backup.

The OEM volume cleanup is necessary because these volumes are created
by the stock firmware and are not automatically cleaned by the standard
nand_upgrade_prepare_ubi() function, which only removes volumes named
'kernel', 'rootfs', and 'rootfs_data'. Without this cleanup, the remaining
OEM volumes consume available space, causing the creation of rootfs_data
to fail during sysupgrade.

Tested on Qihoo 360v6 running stock firmware and OpenWrt.

Signed-off-by: Zhenyu Qi <qzydustin@hotmail.com>
Link: https://github.com/openwrt/openwrt/pull/21154
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/ipq60xx/base-files/lib/functions/bootconfig.sh [new file with mode: 0644]
target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh