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