From: Arvind Sankar <nivedita@alum.mit.edu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Greg Thelen <gthelen@google.com>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH] initramfs: don't double-compress built-in initramfs if the kernel is compressed
Date: Mon, 3 Feb 2020 16:16:44 -0500 [thread overview]
Message-ID: <20200203211644.39847-1-nivedita@alum.mit.edu> (raw)
In-Reply-To: <20200203200656.GA455151@rani.riverdale.lan>
If the kernel is going to be compressed anyway, there is no point in
double-compressing the built-in initramfs. Hide the built-in initramfs
compression choice in this case.
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
---
init/Kconfig | 9 +++++++++
usr/Kconfig | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/init/Kconfig b/init/Kconfig
index 24b23d843df1..88da0976bbfa 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -176,6 +176,9 @@ config HAVE_KERNEL_LZ4
config HAVE_KERNEL_UNCOMPRESSED
bool
+config KERNEL_COMPRESSED
+ bool
+
choice
prompt "Kernel compression mode"
default KERNEL_GZIP
@@ -201,6 +204,7 @@ choice
config KERNEL_GZIP
bool "Gzip"
depends on HAVE_KERNEL_GZIP
+ select KERNEL_COMPRESSED
help
The old and tried gzip compression. It provides a good balance
between compression ratio and decompression speed.
@@ -208,6 +212,7 @@ config KERNEL_GZIP
config KERNEL_BZIP2
bool "Bzip2"
depends on HAVE_KERNEL_BZIP2
+ select KERNEL_COMPRESSED
help
Its compression ratio and speed is intermediate.
Decompression speed is slowest among the choices. The kernel
@@ -218,6 +223,7 @@ config KERNEL_BZIP2
config KERNEL_LZMA
bool "LZMA"
depends on HAVE_KERNEL_LZMA
+ select KERNEL_COMPRESSED
help
This compression algorithm's ratio is best. Decompression speed
is between gzip and bzip2. Compression is slowest.
@@ -226,6 +232,7 @@ config KERNEL_LZMA
config KERNEL_XZ
bool "XZ"
depends on HAVE_KERNEL_XZ
+ select KERNEL_COMPRESSED
help
XZ uses the LZMA2 algorithm and instruction set specific
BCJ filters which can improve compression ratio of executable
@@ -241,6 +248,7 @@ config KERNEL_XZ
config KERNEL_LZO
bool "LZO"
depends on HAVE_KERNEL_LZO
+ select KERNEL_COMPRESSED
help
Its compression ratio is the poorest among the choices. The kernel
size is about 10% bigger than gzip; however its speed
@@ -249,6 +257,7 @@ config KERNEL_LZO
config KERNEL_LZ4
bool "LZ4"
depends on HAVE_KERNEL_LZ4
+ select KERNEL_COMPRESSED
help
LZ4 is an LZ77-type compressor with a fixed, byte-oriented encoding.
A preliminary version of LZ4 de/compression tool is available at
diff --git a/usr/Kconfig b/usr/Kconfig
index bdf5bbd40727..f39eeb9ea2e3 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -102,7 +102,7 @@ config RD_LZ4
choice
prompt "Built-in initramfs compression mode"
- depends on INITRAMFS_SOURCE != ""
+ depends on INITRAMFS_SOURCE != "" && !KERNEL_COMPRESSED
help
This option allows you to decide by which algorithm the builtin
initramfs will be compressed. Several compression algorithms are
--
2.24.1
next prev parent reply other threads:[~2020-02-03 21:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 16:47 [PATCH] initramfs: do not show compression mode choice if INITRAMFS_SOURCE is empty Masahiro Yamada
2020-02-03 17:33 ` Linus Torvalds
2020-02-03 17:35 ` Linus Torvalds
2020-02-06 1:53 ` Masahiro Yamada
2020-02-03 20:06 ` Arvind Sankar
2020-02-03 21:16 ` Arvind Sankar [this message]
2020-02-04 2:22 ` [PATCH] initramfs: don't double-compress built-in initramfs if the kernel is compressed Masahiro Yamada
2020-02-04 16:29 ` Arvind Sankar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200203211644.39847-1-nivedita@alum.mit.edu \
--to=nivedita@alum.mit.edu \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=gthelen@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).