Kconfig 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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/early-userspace/README> 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. depends on BLK_DEV_INITRD
  48. default y
  49. select DECOMPRESS_GZIP
  50. help
  51. Support loading of a gzip encoded initial ramdisk or cpio buffer.
  52. If unsure, say Y.
  53. config RD_BZIP2
  54. bool "Support initial ramdisk/ramfs compressed using bzip2"
  55. default y
  56. depends on BLK_DEV_INITRD
  57. select DECOMPRESS_BZIP2
  58. help
  59. Support loading of a bzip2 encoded initial ramdisk or cpio buffer
  60. If unsure, say N.
  61. config RD_LZMA
  62. bool "Support initial ramdisk/ramfs compressed using LZMA"
  63. default y
  64. depends on BLK_DEV_INITRD
  65. select DECOMPRESS_LZMA
  66. help
  67. Support loading of a LZMA encoded initial ramdisk or cpio buffer
  68. If unsure, say N.
  69. config RD_XZ
  70. bool "Support initial ramdisk/ramfs compressed using XZ"
  71. depends on BLK_DEV_INITRD
  72. default y
  73. select DECOMPRESS_XZ
  74. help
  75. Support loading of a XZ encoded initial ramdisk or cpio buffer.
  76. If unsure, say N.
  77. config RD_LZO
  78. bool "Support initial ramdisk/ramfs compressed using LZO"
  79. default y
  80. depends on BLK_DEV_INITRD
  81. select DECOMPRESS_LZO
  82. help
  83. Support loading of a LZO encoded initial ramdisk or cpio buffer
  84. If unsure, say N.
  85. config RD_LZ4
  86. bool "Support initial ramdisk/ramfs compressed using LZ4"
  87. default y
  88. depends on BLK_DEV_INITRD
  89. select DECOMPRESS_LZ4
  90. help
  91. Support loading of a LZ4 encoded initial ramdisk or cpio buffer
  92. If unsure, say N.
  93. choice
  94. prompt "Built-in initramfs compression mode"
  95. depends on INITRAMFS_SOURCE!=""
  96. optional
  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_NONE
  115. bool "None"
  116. help
  117. Do not compress the built-in initramfs at all. This may sound wasteful
  118. in space, but, you should be aware that the built-in initramfs will be
  119. compressed at a later stage anyways along with the rest of the kernel,
  120. on those architectures that support this. However, not compressing the
  121. initramfs may lead to slightly higher memory consumption during a
  122. short time at boot, while both the cpio image and the unpacked
  123. filesystem image will be present in memory simultaneously
  124. config INITRAMFS_COMPRESSION_GZIP
  125. bool "Gzip"
  126. depends on RD_GZIP
  127. help
  128. Use the old and well tested gzip compression algorithm. Gzip provides
  129. a good balance between compression ratio and decompression speed and
  130. has a reasonable compression speed. It is also more likely to be
  131. supported by your build system as the gzip tool is present by default
  132. on most distros.
  133. config INITRAMFS_COMPRESSION_BZIP2
  134. bool "Bzip2"
  135. depends on RD_BZIP2
  136. help
  137. It's compression ratio and speed is intermediate. Decompression speed
  138. is slowest among the choices. The initramfs size is about 10% smaller
  139. with bzip2, in comparison to gzip. Bzip2 uses a large amount of
  140. memory. For modern kernels you will need at least 8MB RAM or more for
  141. booting.
  142. If you choose this, keep in mind that you need to have the bzip2 tool
  143. available to be able to compress the initram.
  144. config INITRAMFS_COMPRESSION_LZMA
  145. bool "LZMA"
  146. depends on RD_LZMA
  147. help
  148. This algorithm's compression ratio is best but has a large dictionary
  149. size which might cause issues in memory constrained systems.
  150. Decompression speed is between the other choices. Compression is
  151. slowest. The initramfs size is about 33% smaller with LZMA in
  152. comparison to gzip.
  153. If you choose this, keep in mind that you may need to install the xz
  154. or lzma tools to be able to compress the initram.
  155. config INITRAMFS_COMPRESSION_XZ
  156. bool "XZ"
  157. depends on RD_XZ
  158. help
  159. XZ uses the LZMA2 algorithm and has a large dictionary which may cause
  160. problems on memory constrained systems. The initramfs size is about
  161. 30% smaller with XZ in comparison to gzip. Decompression speed is
  162. better than that of bzip2 but worse than gzip and LZO. Compression is
  163. slow.
  164. If you choose this, keep in mind that you may need to install the xz
  165. tool to be able to compress the initram.
  166. config INITRAMFS_COMPRESSION_LZO
  167. bool "LZO"
  168. depends on RD_LZO
  169. help
  170. It's compression ratio is the second poorest amongst the choices. The
  171. kernel size is about 10% bigger than gzip. Despite that, it's
  172. decompression speed is the second fastest and it's compression speed
  173. is quite fast too.
  174. If you choose this, keep in mind that you may need to install the lzop
  175. tool to be able to compress the initram.
  176. config INITRAMFS_COMPRESSION_LZ4
  177. bool "LZ4"
  178. depends on RD_LZ4
  179. help
  180. It's compression ratio is the poorest amongst the choices. The kernel
  181. size is about 15% bigger than gzip; however its decompression speed
  182. is the fastest.
  183. If you choose this, keep in mind that most distros don't provide lz4
  184. by default which could cause a build failure.
  185. endchoice
  186. config INITRAMFS_COMPRESSION
  187. depends on INITRAMFS_SOURCE!=""
  188. string
  189. default "" if INITRAMFS_COMPRESSION_NONE
  190. default ".gz" if INITRAMFS_COMPRESSION_GZIP
  191. default ".bz2" if INITRAMFS_COMPRESSION_BZIP2
  192. default ".lzma" if INITRAMFS_COMPRESSION_LZMA
  193. default ".xz" if INITRAMFS_COMPRESSION_XZ
  194. default ".lzo" if INITRAMFS_COMPRESSION_LZO
  195. default ".lz4" if INITRAMFS_COMPRESSION_LZ4
  196. default ".gz" if RD_GZIP
  197. default ".lz4" if RD_LZ4
  198. default ".lzo" if RD_LZO
  199. default ".xz" if RD_XZ
  200. default ".lzma" if RD_LZMA
  201. default ".bz2" if RD_BZIP2
  202. default ""