Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

initramfs: do not show compression mode choice if INITRAMFS_SOURCE is empty

Since commit ddd09bcc899f ("initramfs: make compression options not
depend on INITRAMFS_SOURCE"), Kconfig asks the compression mode for
the built-in initramfs regardless of INITRAMFS_SOURCE.

It is technically simpler, but pointless from a UI perspective,
Linus says [1].

When INITRAMFS_SOURCE is empty, usr/Makefile creates a tiny default
cpio, which is so small that nobody cares about the compression.

This commit hides the Kconfig choice in that case. The default cpio
is embedded without compression, which was the original behavior.

[1]: https://lkml.org/lkml/2020/2/1/160

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Masahiro Yamada and committed by
Linus Torvalds
d4e9056d ad801428

+2 -1
+1
usr/Kconfig
··· 102 102 103 103 choice 104 104 prompt "Built-in initramfs compression mode" 105 + depends on INITRAMFS_SOURCE != "" 105 106 help 106 107 This option allows you to decide by which algorithm the builtin 107 108 initramfs will be compressed. Several compression algorithms are
+1 -1
usr/Makefile
··· 8 8 # with unpack_to_rootfs(). Make size_append no-op. 9 9 override size_append := : 10 10 11 - compress-$(CONFIG_INITRAMFS_COMPRESSION_NONE) := shipped 11 + compress-y := shipped 12 12 compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP) := gzip 13 13 compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2 14 14 compress-$(CONFIG_INITRAMFS_COMPRESSION_LZMA) := lzma