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) 103db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)choice 104db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) prompt "Built-in initramfs compression mode" 105d4e9056dSMasahiro Yamada depends on INITRAMFS_SOURCE != "" 106db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) help 107db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) This option allows you to decide by which algorithm the builtin 108db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) initramfs will be compressed. Several compression algorithms are 109db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) available, which differ in efficiency, compression and 110db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) decompression speed. Compression speed is only relevant 111db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) when building a kernel. Decompression speed is relevant at 112db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) each boot. Also the memory usage during decompression may become 113db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) relevant on memory constrained systems. This is usually based on the 114db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) dictionary size of the algorithm with algorithms like XZ and LZMA 115db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) featuring large dictionary sizes. 116db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 117db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) High compression options are mostly useful for users who are 118db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) low on RAM, since it reduces the memory consumption during 119db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) boot. 120db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 121db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) Keep in mind that your build system needs to provide the appropriate 122db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) compression tool to compress the generated initram cpio file for 123db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) embedding. 124db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 125db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) If in doubt, select 'None' 126db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 127db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_GZIP 128db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) bool "Gzip" 129db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) depends on RD_GZIP 130db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) help 131db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) Use the old and well tested gzip compression algorithm. Gzip provides 132db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) a good balance between compression ratio and decompression speed and 133db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) has a reasonable compression speed. It is also more likely to be 134db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) supported by your build system as the gzip tool is present by default 135db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) on most distros. 136db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 137db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_BZIP2 138db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) bool "Bzip2" 139db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) depends on RD_BZIP2 140db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) help 141db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) It's compression ratio and speed is intermediate. Decompression speed 142db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) is slowest among the choices. The initramfs size is about 10% smaller 143db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) with bzip2, in comparison to gzip. Bzip2 uses a large amount of 144db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) memory. For modern kernels you will need at least 8MB RAM or more for 145db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) booting. 146db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 147db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) If you choose this, keep in mind that you need to have the bzip2 tool 148db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) available to be able to compress the initram. 149db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 150db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_LZMA 151db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) bool "LZMA" 152db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) depends on RD_LZMA 153db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) help 154db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) This algorithm's compression ratio is best but has a large dictionary 155db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) size which might cause issues in memory constrained systems. 156db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) Decompression speed is between the other choices. Compression is 157db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) slowest. The initramfs size is about 33% smaller with LZMA in 158db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) comparison to gzip. 159db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 160db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) If you choose this, keep in mind that you may need to install the xz 161db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) or lzma tools to be able to compress the initram. 162db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 163db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_XZ 164db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) bool "XZ" 165db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) depends on RD_XZ 166db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) help 167db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) XZ uses the LZMA2 algorithm and has a large dictionary which may cause 168db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) problems on memory constrained systems. The initramfs size is about 169db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 30% smaller with XZ in comparison to gzip. Decompression speed is 170db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) better than that of bzip2 but worse than gzip and LZO. Compression is 171db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) slow. 172db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 173db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) If you choose this, keep in mind that you may need to install the xz 174db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) tool to be able to compress the initram. 175db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 176db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_LZO 177db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) bool "LZO" 178db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) depends on RD_LZO 179db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) help 180db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) It's compression ratio is the second poorest amongst the choices. The 181db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) kernel size is about 10% bigger than gzip. Despite that, it's 182db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) decompression speed is the second fastest and it's compression speed 183db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) is quite fast too. 184db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 185db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) If you choose this, keep in mind that you may need to install the lzop 186db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) tool to be able to compress the initram. 187db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 188db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)config INITRAMFS_COMPRESSION_LZ4 189db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) bool "LZ4" 190db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) depends on RD_LZ4 191db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) help 192db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) It's compression ratio is the poorest amongst the choices. The kernel 193db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) size is about 15% bigger than gzip; however its decompression speed 194db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) is the fastest. 195db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 196db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) If you choose this, keep in mind that most distros don't provide lz4 197db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) by default which could cause a build failure. 198db2aa7fdSFrancisco Blas Izquierdo Riera (klondike) 199*785d74ecSEugeniy Paltsevconfig INITRAMFS_COMPRESSION_NONE 200*785d74ecSEugeniy Paltsev bool "None" 201*785d74ecSEugeniy Paltsev help 202*785d74ecSEugeniy Paltsev Do not compress the built-in initramfs at all. This may sound wasteful 203*785d74ecSEugeniy Paltsev in space, but, you should be aware that the built-in initramfs will be 204*785d74ecSEugeniy Paltsev compressed at a later stage anyways along with the rest of the kernel, 205*785d74ecSEugeniy Paltsev on those architectures that support this. However, not compressing the 206*785d74ecSEugeniy Paltsev initramfs may lead to slightly higher memory consumption during a 207*785d74ecSEugeniy Paltsev short time at boot, while both the cpio image and the unpacked 208*785d74ecSEugeniy Paltsev filesystem image will be present in memory simultaneously 209*785d74ecSEugeniy Paltsev 210db2aa7fdSFrancisco Blas Izquierdo Riera (klondike)endchoice 211