Kconfig 7.7 KB

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