230 lines · plain
1# SPDX-License-Identifier: GPL-2.02#3# Configuration for initramfs4#5 6config INITRAMFS_SOURCE7 string "Initramfs source file(s)"8 default ""9 help10 This can be either a single cpio archive with a .cpio suffix or a11 space-separated list of directories and files for building the12 initramfs image. A cpio archive should contain a filesystem archive13 to be used as an initramfs image. Directories should contain a14 filesystem layout to be included in the initramfs image. Files15 should contain entries according to the format described by the16 "usr/gen_init_cpio" program in the kernel tree.17 18 When multiple directories and files are specified then the19 initramfs image will be the aggregate of all of them.20 21 See <file:Documentation/driver-api/early-userspace/early_userspace_support.rst> for more details.22 23 If you are not sure, leave it blank.24 25config INITRAMFS_FORCE26 bool "Ignore the initramfs passed by the bootloader"27 depends on CMDLINE_EXTEND || CMDLINE_FORCE28 help29 This option causes the kernel to ignore the initramfs image30 (or initrd image) passed to it by the bootloader. This is31 analogous to CMDLINE_FORCE, which is found on some architectures,32 and is useful if you cannot or don't want to change the image33 your bootloader passes to the kernel.34 35config INITRAMFS_ROOT_UID36 int "User ID to map to 0 (user root)"37 depends on INITRAMFS_SOURCE!=""38 default "0"39 help40 If INITRAMFS_SOURCE points to a directory, files owned by this UID41 (-1 = current user) will be owned by root in the resulting image.42 43 If you are not sure, leave it set to "0".44 45config INITRAMFS_ROOT_GID46 int "Group ID to map to 0 (group root)"47 depends on INITRAMFS_SOURCE!=""48 default "0"49 help50 If INITRAMFS_SOURCE points to a directory, files owned by this GID51 (-1 = current group) will be owned by root in the resulting image.52 53 If you are not sure, leave it set to "0".54 55config RD_GZIP56 bool "Support initial ramdisk/ramfs compressed using gzip"57 default y58 select DECOMPRESS_GZIP59 help60 Support loading of a gzip encoded initial ramdisk or cpio buffer.61 If unsure, say Y.62 63config RD_BZIP264 bool "Support initial ramdisk/ramfs compressed using bzip2"65 default y66 select DECOMPRESS_BZIP267 help68 Support loading of a bzip2 encoded initial ramdisk or cpio buffer69 If unsure, say N.70 71config RD_LZMA72 bool "Support initial ramdisk/ramfs compressed using LZMA"73 default y74 select DECOMPRESS_LZMA75 help76 Support loading of a LZMA encoded initial ramdisk or cpio buffer77 If unsure, say N.78 79config RD_XZ80 bool "Support initial ramdisk/ramfs compressed using XZ"81 default y82 select DECOMPRESS_XZ83 help84 Support loading of a XZ encoded initial ramdisk or cpio buffer.85 If unsure, say N.86 87config RD_LZO88 bool "Support initial ramdisk/ramfs compressed using LZO"89 default y90 select DECOMPRESS_LZO91 help92 Support loading of a LZO encoded initial ramdisk or cpio buffer93 If unsure, say N.94 95config RD_LZ496 bool "Support initial ramdisk/ramfs compressed using LZ4"97 default y98 select DECOMPRESS_LZ499 help100 Support loading of a LZ4 encoded initial ramdisk or cpio buffer101 If unsure, say N.102 103config RD_ZSTD104 bool "Support initial ramdisk/ramfs compressed using ZSTD"105 default y106 select DECOMPRESS_ZSTD107 help108 Support loading of a ZSTD encoded initial ramdisk or cpio buffer.109 If unsure, say N.110 111choice112 prompt "Built-in initramfs compression mode"113 depends on INITRAMFS_SOURCE != ""114 help115 This option allows you to decide by which algorithm the builtin116 initramfs will be compressed. Several compression algorithms are117 available, which differ in efficiency, compression and118 decompression speed. Compression speed is only relevant119 when building a kernel. Decompression speed is relevant at120 each boot. Also the memory usage during decompression may become121 relevant on memory constrained systems. This is usually based on the122 dictionary size of the algorithm with algorithms like XZ and LZMA123 featuring large dictionary sizes.124 125 High compression options are mostly useful for users who are126 low on RAM, since it reduces the memory consumption during127 boot.128 129 Keep in mind that your build system needs to provide the appropriate130 compression tool to compress the generated initram cpio file for131 embedding.132 133 If in doubt, select 'None'134 135config INITRAMFS_COMPRESSION_GZIP136 bool "Gzip"137 depends on RD_GZIP138 help139 Use the old and well tested gzip compression algorithm. Gzip provides140 a good balance between compression ratio and decompression speed and141 has a reasonable compression speed. It is also more likely to be142 supported by your build system as the gzip tool is present by default143 on most distros.144 145config INITRAMFS_COMPRESSION_BZIP2146 bool "Bzip2"147 depends on RD_BZIP2148 help149 It's compression ratio and speed is intermediate. Decompression speed150 is slowest among the choices. The initramfs size is about 10% smaller151 with bzip2, in comparison to gzip. Bzip2 uses a large amount of152 memory. For modern kernels you will need at least 8MB RAM or more for153 booting.154 155 If you choose this, keep in mind that you need to have the bzip2 tool156 available to be able to compress the initram.157 158config INITRAMFS_COMPRESSION_LZMA159 bool "LZMA"160 depends on RD_LZMA161 help162 This algorithm's compression ratio is best but has a large dictionary163 size which might cause issues in memory constrained systems.164 Decompression speed is between the other choices. Compression is165 slowest. The initramfs size is about 33% smaller with LZMA in166 comparison to gzip.167 168 If you choose this, keep in mind that you may need to install the xz169 or lzma tools to be able to compress the initram.170 171config INITRAMFS_COMPRESSION_XZ172 bool "XZ"173 depends on RD_XZ174 help175 XZ uses the LZMA2 algorithm and has a large dictionary which may cause176 problems on memory constrained systems. The initramfs size is about177 30% smaller with XZ in comparison to gzip. Decompression speed is178 better than that of bzip2 but worse than gzip and LZO. Compression is179 slow.180 181 If you choose this, keep in mind that you may need to install the xz182 tool to be able to compress the initram.183 184config INITRAMFS_COMPRESSION_LZO185 bool "LZO"186 depends on RD_LZO187 help188 Its compression ratio is the second poorest amongst the choices. The189 kernel size is about 10% bigger than gzip. Despite that, its190 decompression speed is the second fastest and its compression speed191 is quite fast too.192 193 If you choose this, keep in mind that you may need to install the lzop194 tool to be able to compress the initram.195 196config INITRAMFS_COMPRESSION_LZ4197 bool "LZ4"198 depends on RD_LZ4199 help200 It's compression ratio is the poorest amongst the choices. The kernel201 size is about 15% bigger than gzip; however its decompression speed202 is the fastest.203 204 If you choose this, keep in mind that most distros don't provide lz4205 by default which could cause a build failure.206 207config INITRAMFS_COMPRESSION_ZSTD208 bool "ZSTD"209 depends on RD_ZSTD210 help211 ZSTD is a compression algorithm targeting intermediate compression212 with fast decompression speed. It will compress better than GZIP and213 decompress around the same speed as LZO, but slower than LZ4.214 215 If you choose this, keep in mind that you may need to install the zstd216 tool to be able to compress the initram.217 218config INITRAMFS_COMPRESSION_NONE219 bool "None"220 help221 Do not compress the built-in initramfs at all. This may sound wasteful222 in space, but, you should be aware that the built-in initramfs will be223 compressed at a later stage anyways along with the rest of the kernel,224 on those architectures that support this. However, not compressing the225 initramfs may lead to slightly higher memory consumption during a226 short time at boot, while both the cpio image and the unpacked227 filesystem image will be present in memory simultaneously228 229endchoice230