summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Marangi2024-07-09 02:27:11 +0000
committerChristian Marangi2024-07-09 06:43:16 +0000
commit3c95641366f78e34bbf147da5840d7d3217ac4e1 (patch)
tree784d7f9483d4137b4b6039626b20f60d312d7d65
parent3d7cb14211bb2b9f7ad34d001c40ac0bd1558767 (diff)
downloadopenwrt-3c95641366f78e34bbf147da5840d7d3217ac4e1.tar.gz
kernel: fix broken initramfs images for Separate cpio
Commit 0137fbd74bff ("kernel: skip rebuilding kernel with ROOTFS_INITRAMFS_SEPARATE") had a logic error error and didn't account that the generic initramfs is still needed to be built to enable support for the cpio compression and other config specific to initramfs. With that commit we completely skip rebuilding the kernel with those new options. To better handle this, skip kernel build ONLY when we are handling Per Device Rootfs, permitting the first generic build to be actually called with the new options. Fixes: 0137fbd74bff ("kernel: skip rebuilding kernel with ROOTFS_INITRAMFS_SEPARATE") Link: https://github.com/openwrt/openwrt/pull/15912 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--include/kernel-defaults.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index ff6c60d5b0..f6997ecf9e 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -166,6 +166,8 @@ endef
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
# $1: Custom TARGET_DIR. If omitted TARGET_DIR is used.
# $2: If defined Generate Per Rootfs Kernel Directory and use it
+# For Separate Initramf with $2 declared, skip kernel compile, it has
+# already been done previously on generic image build
define Kernel/CompileImage/Initramfs
$(if $(2),$(call Kernel/PrepareConfigPerRootfs,$(LINUX_DIR)$(2)))
$(call Kernel/Configure/Initramfs,$(if $(1),$(1),$(TARGET_DIR)),$(LINUX_DIR)$(2))
@@ -185,6 +187,7 @@ endif
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),$(STAGING_DIR_HOST)/bin/lzop -9 -f $(if $(2),$(LINUX_DIR)$(2),$(KERNEL_BUILD_DIR))/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -T$(if $(filter 1,$(NPROC)),2,0) -9 -fz --check=crc32 $(if $(2),$(LINUX_DIR)$(2),$(KERNEL_BUILD_DIR))/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(if $(2),$(LINUX_DIR)$(2),$(KERNEL_BUILD_DIR))/initrd.cpio.zstd $(if $(2),$(LINUX_DIR)$(2),$(KERNEL_BUILD_DIR))/initrd.cpio)
+ $(if $(2),,$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all))
$(call Kernel/CopyImage,-initramfs,$(2))
else
+$(call locked,$(if $(2),$(CP) $(LINUX_DIR)$(2)/.config* $(LINUX_DIR) && touch $(LINUX_DIR)/.config && )\