[openwrt/openwrt] build: fix incorrect initramfs bzip2 compression

LEDE Commits lede-commits at lists.infradead.org
Tue Apr 18 04:57:56 PDT 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/69bc620180d2ec670e7a936171262fc3e9e99179

commit 69bc620180d2ec670e7a936171262fc3e9e99179
Author: Tony Butler <spudz76 at gmail.com>
AuthorDate: Mon Apr 17 19:28:36 2023 -0700

    build: fix incorrect initramfs bzip2 compression
    
    Requires: tools/bzip2
    
    fix consistency of executable to use `$(STAGING_DIR_HOST)/bin/bzip2`, and
    not system-installed ones from the usual environment `PATH`;
    this affects option `CONFIG_KERNEL_INITRAMFS_COMPRESSION_BZIP2`
    
    this may have worked in the past but only via side effect of having the
    binaries on the host system (and whatever unpredictable version or
    patchset those might be)
    
    Fixes: 330bd380e8b6 ("image: allow building FIT and uImage with ramdisk")
    Signed-off-by: Tony Butler <spudz76 at gmail.com>
---
 include/kernel-defaults.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 37c1141139..c1976ee6c7 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -177,7 +177,7 @@ else
 	( cd $(TARGET_DIR); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
 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_BZIP2),$(STAGING_DIR_HOST)/bin/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)




More information about the lede-commits mailing list