Skip to content
This repository was archived by the owner on Dec 25, 2023. It is now read-only.

Commit 389f041

Browse files
Eugeniy Paltsevgregkh
Eugeniy Paltsev
authored andcommitted
initramfs: restore default compression behavior
[ Upstream commit 785d74ec3bbf26ac7f6e92e6e96a259aec0f107a ] Even though INITRAMFS_SOURCE kconfig option isn't set in most of defconfigs it is used (set) extensively by various build systems. Commit f26661e12765 ("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 <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent f8c1e65 commit 389f041

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

usr/Kconfig

+11-11
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)