Skip to content

Commit d2faee4

Browse files
Eugeniy Paltsevgregkh
authored andcommitted
initramfs: restore default compression behavior
[ Upstream commit 785d74e ] Even though INITRAMFS_SOURCE kconfig option isn't set in most of defconfigs it is used (set) extensively by various build systems. Commit f26661e ("initramfs: make initramfs compression choice non-optional") has changed default compression mode. Previously we compress initramfs using available compression algorithm. Now we don't use any compression at all by default. It significantly increases the image size in case of build system chooses embedded initramfs. Initially I faced with this issue while using buildroot. As of today it's not possible to set preferred compression mode in target defconfig as this option depends on INITRAMFS_SOURCE being set. Modification of all build systems either doesn't look like good option. Let's instead rewrite initramfs compression mode choices list the way that "INITRAMFS_COMPRESSION_NONE" will be the last option in the list. In that case it will be chosen only if all other options (which implements any compression) are not available. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4a8ba74 commit d2faee4

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

‎usr/Kconfig‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,6 @@ choice
131131

132132
If in doubt, select 'None'
133133

134-
config INITRAMFS_COMPRESSION_NONE
135-
bool "None"
136-
help
137-
Do not compress the built-in initramfs at all. This may sound wasteful
138-
in space, but, you should be aware that the built-in initramfs will be
139-
compressed at a later stage anyways along with the rest of the kernel,
140-
on those architectures that support this. However, not compressing the
141-
initramfs may lead to slightly higher memory consumption during a
142-
short time at boot, while both the cpio image and the unpacked
143-
filesystem image will be present in memory simultaneously
144-
145134
config INITRAMFS_COMPRESSION_GZIP
146135
bool "Gzip"
147136
depends on RD_GZIP
@@ -214,6 +203,17 @@ config INITRAMFS_COMPRESSION_LZ4
214203
If you choose this, keep in mind that most distros don't provide lz4
215204
by default which could cause a build failure.
216205

206+
config INITRAMFS_COMPRESSION_NONE
207+
bool "None"
208+
help
209+
Do not compress the built-in initramfs at all. This may sound wasteful
210+
in space, but, you should be aware that the built-in initramfs will be
211+
compressed at a later stage anyways along with the rest of the kernel,
212+
on those architectures that support this. However, not compressing the
213+
initramfs may lead to slightly higher memory consumption during a
214+
short time at boot, while both the cpio image and the unpacked
215+
filesystem image will be present in memory simultaneously
216+
217217
endchoice
218218

219219
config INITRAMFS_COMPRESSION

0 commit comments

Comments
 (0)