]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
kbuild: switch from lz4c to lz4 for compression
authorParth Pancholi <parth.pancholi@toradex.com>
Thu, 14 Nov 2024 14:56:44 +0000 (15:56 +0100)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 27 Nov 2024 23:11:56 +0000 (08:11 +0900)
Replace lz4c with lz4 for kernel image compression.
Although lz4 and lz4c are functionally similar, lz4c has been deprecated
upstream since 2018. Since as early as Ubuntu 16.04 and Fedora 25, lz4
and lz4c have been packaged together, making it safe to update the
requirement from lz4c to lz4.

Consequently, some distributions and build systems, such as OpenEmbedded,
have fully transitioned to using lz4. OpenEmbedded core adopted this
change in commit fe167e082cbd ("bitbake.conf: require lz4 instead of
lz4c"), causing compatibility issues when building the mainline kernel
in the latest OpenEmbedded environment, as seen in the errors below.

This change also updates the LZ4 compression commands to make it backward
compatible by replacing stdin and stdout with the '-' option, due to some
unclear reason, the stdout keyword does not work for lz4 and '-' works for
both. In addition, this modifies the legacy '-c1' with '-9' which is also
compatible with both. This fixes the mainline kernel build failures with
the latest master OpenEmbedded builds associated with the mentioned
compatibility issues.

LZ4     arch/arm/boot/compressed/piggy_data
/bin/sh: 1: lz4c: not found
...
...
ERROR: oe_runmake failed

Link: https://github.com/lz4/lz4/pull/553
Suggested-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Parth Pancholi <parth.pancholi@toradex.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile
scripts/Makefile.lib

index 215d5fd95a2842f05beeb1f77e14276ae1bf2f0f..f7f43c8997ae1f41018cee5529becc2e6a57405b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -533,7 +533,7 @@ KGZIP               = gzip
 KBZIP2         = bzip2
 KLZOP          = lzop
 LZMA           = lzma
-LZ4            = lz4c
+LZ4            = lz4
 XZ             = xz
 ZSTD           = zstd
 
index 01040a767c1dbe7fb208e7ce860d88eab9a5d534..7395200538da89a2f6e6d21f8959f3f60d291d79 100644 (file)
@@ -425,10 +425,10 @@ quiet_cmd_lzo_with_size = LZO     $@
       cmd_lzo_with_size = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@
 
 quiet_cmd_lz4 = LZ4     $@
-      cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout > $@
+      cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -9 - - > $@
 
 quiet_cmd_lz4_with_size = LZ4     $@
-      cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout; \
+      cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -9 - -; \
                   $(size_append); } > $@
 
 # U-Boot mkimage