[openwrt/openwrt] kernel: skip rebuilding kernel with ROOTFS_INITRAMFS_SEPARATE
LEDE Commits
lede-commits at lists.infradead.org
Sat Jul 6 07:20:56 PDT 2024
ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0137fbd74bff2ca3273da3725eb27d2262e3973d
commit 0137fbd74bff2ca3273da3725eb27d2262e3973d
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sat Jul 6 13:40:40 2024 +0200
kernel: skip rebuilding kernel with ROOTFS_INITRAMFS_SEPARATE
With PER_DEVICE_ROOTFS, rebuilding kernel is needed to embed the cpio
image in the kernel image. With ROOTFS_INITRAMFS_SEPARATE, the cpio
image is external hence we can reuse the same kernel image without
rebuilding it.
Link: https://github.com/openwrt/openwrt/pull/12959
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
include/kernel-defaults.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index b624405661..84d686cafc 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -183,11 +183,13 @@ 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)
-endif
+ $(call Kernel/CopyImage,-initramfs$(2))
+else
+$(call locked,$(if $(2),$(CP) $(LINUX_DIR)$(2)/.config* $(LINUX_DIR) && touch $(LINUX_DIR)/.config && )\
rm -rf $(LINUX_DIR)/usr/initramfs_data.cpio* $(LINUX_DIR)/.config.prev && \
$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) && \
{ $(call Kernel/CopyImage,-initramfs$(2)) },gen-initramfs)
+endif
endef
else
define Kernel/CompileImage/Initramfs
More information about the lede-commits
mailing list