]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
base-files: handle name collision between kernel UBI volume and MTD partition
authorLukas Stockner <lukas@lukasstockner.de>
Sat, 2 May 2026 17:32:23 +0000 (19:32 +0200)
committerPaul Spooren <mail@aparcar.org>
Tue, 16 Jun 2026 14:07:58 +0000 (16:07 +0200)
On the AP-325 (and variants), the bootloader enforces a particular UBI volume
layout and naming, so unfortunately the kernel's UBI volume and MTD partition
end up with the name, which confuses the current logic.

Therefore, add an option to ignore the MTD partition.

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Paul Spooren <mail@aparcar.org>
package/base-files/files/lib/upgrade/nand.sh

index e4a255b9c0ec53e75020c97b007e82d2491e1b5a..4bf9fc993eff5386faa769a772aaffb24703991e 100644 (file)
@@ -328,6 +328,10 @@ nand_upgrade_tar() {
        local rootfs_type
        [ "$rootfs_length" ] && rootfs_type="$(identify_tar "$tar_file" "$cmd" "$board_dir/root")"
 
+       # If CI_SKIP_KERNEL_MTD is set, ignore any potential kernel MTD partition that was found.
+       # This is needed if there's an MTD partition with the same name as the kernel's UBI volume.
+       [ "${CI_SKIP_KERNEL_MTD:-}" ] && kernel_mtd=
+
        local ubi_kernel_length
        if [ "$kernel_length" ]; then
                if [ "$kernel_mtd" ]; then