xref: /openbmc/linux/usr/Kconfig (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2dbec4866SSam Ravnborg#
3dbec4866SSam Ravnborg# Configuration for initramfs
4dbec4866SSam Ravnborg#
5dbec4866SSam Ravnborg
6dbec4866SSam Ravnborgconfig INITRAMFS_SOURCE
7dbec4866SSam Ravnborg	string "Initramfs source file(s)"
8dbec4866SSam Ravnborg	default ""
9dbec4866SSam Ravnborg	help
10dbec4866SSam Ravnborg	  This can be either a single cpio archive with a .cpio suffix or a
11dbec4866SSam Ravnborg	  space-separated list of directories and files for building the
12dbec4866SSam Ravnborg	  initramfs image.  A cpio archive should contain a filesystem archive
13dbec4866SSam Ravnborg	  to be used as an initramfs image.  Directories should contain a
14dbec4866SSam Ravnborg	  filesystem layout to be included in the initramfs image.  Files
15dbec4866SSam Ravnborg	  should contain entries according to the format described by the
16dbec4866SSam Ravnborg	  "usr/gen_init_cpio" program in the kernel tree.
17dbec4866SSam Ravnborg
18dbec4866SSam Ravnborg	  When multiple directories and files are specified then the
19dbec4866SSam Ravnborg	  initramfs image will be the aggregate of all of them.
20dbec4866SSam Ravnborg
21ec4b78a0SMauro Carvalho Chehab	  See <file:Documentation/driver-api/early-userspace/early_userspace_support.rst> for more details.
22dbec4866SSam Ravnborg
23dbec4866SSam Ravnborg	  If you are not sure, leave it blank.
24dbec4866SSam Ravnborg
25cff75e0bSDaniel Thompsonconfig INITRAMFS_FORCE
26cff75e0bSDaniel Thompson	bool "Ignore the initramfs passed by the bootloader"
27cff75e0bSDaniel Thompson	depends on CMDLINE_EXTEND || CMDLINE_FORCE
28cff75e0bSDaniel Thompson	help
29cff75e0bSDaniel Thompson	  This option causes the kernel to ignore the initramfs image
30cff75e0bSDaniel Thompson	  (or initrd image) passed to it by the bootloader. This is
31cff75e0bSDaniel Thompson	  analogous to CMDLINE_FORCE, which is found on some architectures,
32cff75e0bSDaniel Thompson	  and is useful if you cannot or don't want to change the image
33cff75e0bSDaniel Thompson	  your bootloader passes to the kernel.
34cff75e0bSDaniel Thompson
35dbec4866SSam Ravnborgconfig INITRAMFS_ROOT_UID
36dbec4866SSam Ravnborg	int "User ID to map to 0 (user root)"
37dbec4866SSam Ravnborg	depends on INITRAMFS_SOURCE!=""
38dbec4866SSam Ravnborg	default "0"
39dbec4866SSam Ravnborg	help
40595a22acSRob Landley	  If INITRAMFS_SOURCE points to a directory, files owned by this UID
41595a22acSRob Landley	  (-1 = current user) will be owned by root in the resulting image.
42dbec4866SSam Ravnborg
43dbec4866SSam Ravnborg	  If you are not sure, leave it set to "0".
44dbec4866SSam Ravnborg
45dbec4866SSam Ravnborgconfig INITRAMFS_ROOT_GID
46dbec4866SSam Ravnborg	int "Group ID to map to 0 (group root)"
47dbec4866SSam Ravnborg	depends on INITRAMFS_SOURCE!=""
48dbec4866SSam Ravnborg	default "0"
49dbec4866SSam Ravnborg	help
50595a22acSRob Landley	  If INITRAMFS_SOURCE points to a directory, files owned by this GID
51595a22acSRob Landley	  (-1 = current group) will be owned by root in the resulting image.
52dbec4866SSam Ravnborg
53dbec4866SSam Ravnborg	  If you are not sure, leave it set to "0".
54fb9a4ca9SH. Peter Anvin
55fb9a4ca9SH. Peter Anvinconfig RD_GZIP
56f2e8954bSRob Landley	bool "Support initial ramdisk/ramfs compressed using gzip"
57ec72c666SAndi Kleen	default y
58fb9a4ca9SH. Peter Anvin	select DECOMPRESS_GZIP
59fb9a4ca9SH. Peter Anvin	help
60fb9a4ca9SH. Peter Anvin	  Support loading of a gzip encoded initial ramdisk or cpio buffer.
61fb9a4ca9SH. Peter Anvin	  If unsure, say Y.
62fb9a4ca9SH. Peter Anvin
63fb9a4ca9SH. Peter Anvinconfig RD_BZIP2
64f2e8954bSRob Landley	bool "Support initial ramdisk/ramfs compressed using bzip2"
65ec72c666SAndi Kleen	default y
66fb9a4ca9SH. Peter Anvin	select DECOMPRESS_BZIP2
67fb9a4ca9SH. Peter Anvin	help
68fb9a4ca9SH. Peter Anvin	  Support loading of a bzip2 encoded initial ramdisk or cpio buffer
69fb9a4ca9SH. Peter Anvin	  If unsure, say N.
70fb9a4ca9SH. Peter Anvin
71fb9a4ca9SH. Peter Anvinconfig RD_LZMA
72f2e8954bSRob Landley	bool "Support initial ramdisk/ramfs compressed using LZMA"
73ec72c666SAndi Kleen	default y
74fb9a4ca9SH. Peter Anvin	select DECOMPRESS_LZMA
75fb9a4ca9SH. Peter Anvin	help
7655d1d26fSH. Peter Anvin	  Support loading of a LZMA encoded initial ramdisk or cpio buffer
77fb9a4ca9SH. Peter Anvin	  If unsure, say N.
78ab76f3d7SAlain Knaff
793ebe1243SLasse Collinconfig RD_XZ
80f2e8954bSRob Landley	bool "Support initial ramdisk/ramfs compressed using XZ"
81ec72c666SAndi Kleen	default y
823ebe1243SLasse Collin	select DECOMPRESS_XZ
833ebe1243SLasse Collin	help
843ebe1243SLasse Collin	  Support loading of a XZ encoded initial ramdisk or cpio buffer.
853ebe1243SLasse Collin	  If unsure, say N.
863ebe1243SLasse Collin
87cacb246fSAlbin Tonnerreconfig RD_LZO
88f2e8954bSRob Landley	bool "Support initial ramdisk/ramfs compressed using LZO"
89ec72c666SAndi Kleen	default y
90cacb246fSAlbin Tonnerre	select DECOMPRESS_LZO
91cacb246fSAlbin Tonnerre	help
92cacb246fSAlbin Tonnerre	  Support loading of a LZO encoded initial ramdisk or cpio buffer
93cacb246fSAlbin Tonnerre	  If unsure, say N.
94cacb246fSAlbin Tonnerre
95e76e1fdfSKyungsik Leeconfig RD_LZ4
96f2e8954bSRob Landley	bool "Support initial ramdisk/ramfs compressed using LZ4"
97ec72c666SAndi Kleen	default y
98e76e1fdfSKyungsik Lee	select DECOMPRESS_LZ4
99e76e1fdfSKyungsik Lee	help
100e76e1fdfSKyungsik Lee	  Support loading of a LZ4 encoded initial ramdisk or cpio buffer
101e76e1fdfSKyungsik Lee	  If unsure, say N.
10235e669e1SFrancisco Blas Izquierdo Riera (klondike)
103*a30d8a39SNick Terrellconfig RD_ZSTD
104*a30d8a39SNick Terrell	bool "Support initial ramdisk/ramfs compressed using ZSTD"
105*a30d8a39SNick Terrell	default y
106*a30d8a39SNick Terrell	select DECOMPRESS_ZSTD
107*a30d8a39SNick Terrell	help
108*a30d8a39SNick Terrell	  Support loading of a ZSTD encoded initial ramdisk or cpio buffer.
109*a30d8a39SNick Terrell	  If unsure, say N.
110*a30d8a39SNick Terrell
111db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)choice
112db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	prompt "Built-in initramfs compression mode"
113d4e9056dSMasahiro Yamada	depends on INITRAMFS_SOURCE != ""
114db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	help
115db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  This option allows you to decide by which algorithm the builtin
116db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  initramfs will be compressed.  Several compression algorithms are
117db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  available, which differ in efficiency, compression and
118db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  decompression speed.  Compression speed is only relevant
119db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  when building a kernel.  Decompression speed is relevant at
120db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  each boot. Also the memory usage during decompression may become
121db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  relevant on memory constrained systems. This is usually based on the
122db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  dictionary size of the algorithm with algorithms like XZ and LZMA
123db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  featuring large dictionary sizes.
124db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
125db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  High compression options are mostly useful for users who are
126db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  low on RAM, since it reduces the memory consumption during
127db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  boot.
128db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
129db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  Keep in mind that your build system needs to provide the appropriate
130db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  compression tool to compress the generated initram cpio file for
131db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  embedding.
132db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
133db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  If in doubt, select 'None'
134db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
135db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_GZIP
136db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	bool "Gzip"
137db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	depends on RD_GZIP
138db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	help
139db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  Use the old and well tested gzip compression algorithm. Gzip provides
140db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  a good balance between compression ratio and decompression speed and
141db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  has a reasonable compression speed. It is also more likely to be
142db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  supported by your build system as the gzip tool is present by default
143db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  on most distros.
144db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
145db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_BZIP2
146db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	bool "Bzip2"
147db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	depends on RD_BZIP2
148db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	help
149db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  It's compression ratio and speed is intermediate. Decompression speed
150db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  is slowest among the choices. The initramfs size is about 10% smaller
151db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  with bzip2, in comparison to gzip. Bzip2 uses a large amount of
152db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  memory. For modern kernels you will need at least 8MB RAM or more for
153db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  booting.
154db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
155db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  If you choose this, keep in mind that you need to have the bzip2 tool
156db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  available to be able to compress the initram.
157db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
158db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_LZMA
159db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	bool "LZMA"
160db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	depends on RD_LZMA
161db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	help
162db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  This algorithm's compression ratio is best but has a large dictionary
163db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  size which might cause issues in memory constrained systems.
164db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  Decompression speed is between the other choices. Compression is
165db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  slowest. The initramfs size is about 33% smaller with LZMA in
166db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  comparison to gzip.
167db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
168db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  If you choose this, keep in mind that you may need to install the xz
169db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  or lzma tools to be able to compress the initram.
170db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
171db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_XZ
172db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	bool "XZ"
173db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	depends on RD_XZ
174db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	help
175db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  XZ uses the LZMA2 algorithm and has a large dictionary which may cause
176db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  problems on memory constrained systems. The initramfs size is about
177db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  30% smaller with XZ in comparison to gzip. Decompression speed is
178db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  better than that of bzip2 but worse than gzip and LZO. Compression is
179db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  slow.
180db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
181db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  If you choose this, keep in mind that you may need to install the xz
182db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  tool to be able to compress the initram.
183db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
184db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_LZO
185db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	bool "LZO"
186db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	depends on RD_LZO
187db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	help
188db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  It's compression ratio is the second poorest amongst the choices. The
189db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  kernel size is about 10% bigger than gzip. Despite that, it's
190db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  decompression speed is the second fastest and it's compression speed
191db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  is quite fast too.
192db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
193db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  If you choose this, keep in mind that you may need to install the lzop
194db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  tool to be able to compress the initram.
195db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
196db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_LZ4
197db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	bool "LZ4"
198db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	depends on RD_LZ4
199db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	help
200db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  It's compression ratio is the poorest amongst the choices. The kernel
201db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  size is about 15% bigger than gzip; however its decompression speed
202db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  is the fastest.
203db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
204db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  If you choose this, keep in mind that most distros don't provide lz4
205db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)	  by default which could cause a build failure.
206db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)
207*a30d8a39SNick Terrellconfig INITRAMFS_COMPRESSION_ZSTD
208*a30d8a39SNick Terrell	bool "ZSTD"
209*a30d8a39SNick Terrell	depends on RD_ZSTD
210*a30d8a39SNick Terrell	help
211*a30d8a39SNick Terrell	  ZSTD is a compression algorithm targeting intermediate compression
212*a30d8a39SNick Terrell	  with fast decompression speed. It will compress better than GZIP and
213*a30d8a39SNick Terrell	  decompress around the same speed as LZO, but slower than LZ4.
214*a30d8a39SNick Terrell
215*a30d8a39SNick Terrell	  If you choose this, keep in mind that you may need to install the zstd
216*a30d8a39SNick Terrell	  tool to be able to compress the initram.
217*a30d8a39SNick Terrell
218785d74ecSEugeniy Paltsevconfig INITRAMFS_COMPRESSION_NONE
219785d74ecSEugeniy Paltsev	bool "None"
220785d74ecSEugeniy Paltsev	help
221785d74ecSEugeniy Paltsev	  Do not compress the built-in initramfs at all. This may sound wasteful
222785d74ecSEugeniy Paltsev	  in space, but, you should be aware that the built-in initramfs will be
223785d74ecSEugeniy Paltsev	  compressed at a later stage anyways along with the rest of the kernel,
224785d74ecSEugeniy Paltsev	  on those architectures that support this. However, not compressing the
225785d74ecSEugeniy Paltsev	  initramfs may lead to slightly higher memory consumption during a
226785d74ecSEugeniy Paltsev	  short time at boot, while both the cpio image and the unpacked
227785d74ecSEugeniy Paltsev	  filesystem image will be present in memory simultaneously
228785d74ecSEugeniy Paltsev
229db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)endchoice
230