From: Robert Marko Date: Mon, 20 Sep 2021 17:13:43 +0000 (+0200) Subject: base-files: dont always create kernel UBI volume X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f2c4064ecb76bca69d4ce3fbc52209992f2334dc;p=openwrt%2Fstaging%2Frobimarko.git base-files: dont always create kernel UBI volume Currently nand_upgrade_tar() will pass the kernel length to nand_upgrade_prepare_ubi() in all cases except for when the kernel is to be installed in a separate partition as a binary with the MTD tool. While this is fine for almost all cases newer MikroTik NAND devices like hAP ac3 require the kernel to be installed as a UBIFS packed UBI volume in its own partition. So, since we have a custom recipe to use ubiformat to flash the kernel in its partition it makes no sense for sysupgrade to also install the kernel as a UBI volume in the "ubi" partition as it only wastes space and will never be used. So, simply check whether CI_KERNPART is set to "none" and if so unset the "has_kernel" variable which will in turn prevent the kernel length from being passed on and then the kernel UBI volume wont be created for no usefull purpose. The ath79 MikroTik NAND target has been setting CI_KERNPART to "none" for a while now altough that was not preventing the kernel to be installed as UBI volume as well. Signed-off-by: Robert Marko --- diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index faeb3d6fc1..9b29266479 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -296,6 +296,7 @@ nand_upgrade_tar() { tar xf "$tar_file" ${board_dir}/kernel -O | mtd write - $CI_KERNPART } [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel= + [ "$CI_KERNPART" = "none" ] && has_kernel= nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "${has_kernel:+$kernel_length}" "$has_env"