Skip to content

Commit e397a60

Browse files
Parth Pancholimasahir0y
authored andcommitted
kbuild: switch from lz4c to lz4 for compression
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: lz4/lz4#553 Suggested-by: Francesco Dolcini <[email protected]> Signed-off-by: Parth Pancholi <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 1b466b2 commit e397a60

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ KGZIP = gzip
533533
KBZIP2 = bzip2
534534
KLZOP = lzop
535535
LZMA = lzma
536-
LZ4 = lz4c
536+
LZ4 = lz4
537537
XZ = xz
538538
ZSTD = zstd
539539

scripts/Makefile.lib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,10 @@ quiet_cmd_lzo_with_size = LZO $@
425425
cmd_lzo_with_size = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@
426426

427427
quiet_cmd_lz4 = LZ4 $@
428-
cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout > $@
428+
cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -9 - - > $@
429429

430430
quiet_cmd_lz4_with_size = LZ4 $@
431-
cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout; \
431+
cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -9 - -; \
432432
$(size_append); } > $@
433433

434434
# U-Boot mkimage

0 commit comments

Comments
 (0)