[openwrt/openwrt] build: fix incomplete initramfs compression options

LEDE Commits lede-commits at lists.infradead.org
Mon Jan 16 16:17:57 PST 2023


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4a444e576fd26764ed11aed8c3bdf2281bba3cc6

commit 4a444e576fd26764ed11aed8c3bdf2281bba3cc6
Author: Tony Butler <spudz76 at gmail.com>
AuthorDate: Mon Nov 28 17:37:20 2022 -0800

    build: fix incomplete initramfs compression options
    
    Requires: tools/lz4, tools/lzop
    
    complete the wiring so that these options work:
    * `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZO`
    * `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZ4`
    
    Signed-off-by: Tony Butler <spudz76 at gmail.com>
    [remove blocking dependencies for separate ramdisk, fix lzop options]
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 config/Config-images.in    | 2 --
 include/image-commands.mk  | 2 ++
 include/kernel-defaults.mk | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 5615141b75..6e43793ef5 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -37,11 +37,9 @@ menu "Target Images"
 				bool "lzma"
 
 			config TARGET_INITRAMFS_COMPRESSION_LZO
-				depends on !TARGET_ROOTFS_INITRAMFS_SEPARATE
 				bool "lzo"
 
 			config TARGET_INITRAMFS_COMPRESSION_LZ4
-				depends on !TARGET_ROOTFS_INITRAMFS_SEPARATE
 				bool "lz4"
 
 			config TARGET_INITRAMFS_COMPRESSION_XZ
diff --git a/include/image-commands.mk b/include/image-commands.mk
index ff8acf96c4..70055cc576 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -277,7 +277,9 @@ endef
 define Build/initrd_compression
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),.bzip2) \
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),.gzip) \
+	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),.lz4) \
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),.lzma) \
+	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),.lzo) \
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),.xz) \
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),.zstd)
 endef
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index dcba319a0f..127fa8563a 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -179,10 +179,10 @@ endif
 	$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(KERNEL_BUILD_DIR)/initrd.cpio)
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -n -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
+	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),$(STAGING_DIR_HOST)/bin/lz4c -l -c1 -fz --favor-decSpeed $(KERNEL_BUILD_DIR)/initrd.cpio)
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma)
-# ?	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
+	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),$(STAGING_DIR_HOST)/bin/lzop -9 -f $(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 $(KERNEL_BUILD_DIR)/initrd.cpio)
-# ?	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio)
 endif
 	+$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) modules




More information about the lede-commits mailing list