Kconfig 7.7 KB

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