build: fix incomplete initramfs compression options
authorTony Butler <spudz76@gmail.com>
Tue, 29 Nov 2022 01:37:20 +0000 (17:37 -0800)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 17 Jan 2023 00:16:35 +0000 (00:16 +0000)
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@gmail.com>
[remove blocking dependencies for separate ramdisk, fix lzop options]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
config/Config-images.in
include/image-commands.mk
include/kernel-defaults.mk

index 5615141b750ed39ae9927dcd5ad0eb6e3e7771e8..6e43793ef5301147836f98a8c517f73acbd673cf 100644 (file)
@@ -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
index ff8acf96c4f316570572eb3c736b9056045cc7f3..70055cc576485f706636bedb2c2601631927801c 100644 (file)
@@ -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
index dcba319a0f239de66496ab77544bfc0e3a639a14..127fa8563afbc5d5b59ed772586e2af3cd57253f 100644 (file)
@@ -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