changes.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. .. _changes:
  2. Minimal requirements to compile the Kernel
  3. ++++++++++++++++++++++++++++++++++++++++++
  4. Intro
  5. =====
  6. This document is designed to provide a list of the minimum levels of
  7. software necessary to run the current kernel version.
  8. This document is originally based on my "Changes" file for 2.0.x kernels
  9. and therefore owes credit to the same people as that file (Jared Mauch,
  10. Axel Boldt, Alessandro Sigala, and countless other users all over the
  11. 'net).
  12. Current Minimal Requirements
  13. ****************************
  14. Upgrade to at **least** these software revisions before thinking you've
  15. encountered a bug! If you're unsure what version you're currently
  16. running, the suggested command should tell you.
  17. Again, keep in mind that this list assumes you are already functionally
  18. running a Linux kernel. Also, not all tools are necessary on all
  19. systems; obviously, if you don't have any PC Card hardware, for example,
  20. you probably needn't concern yourself with pcmciautils.
  21. ====================== =============== ========================================
  22. Program Minimal version Command to check the version
  23. ====================== =============== ========================================
  24. GNU C 8.1 gcc --version
  25. Clang/LLVM (optional) 15.0.0 clang --version
  26. Rust (optional) 1.78.0 rustc --version
  27. bindgen (optional) 0.65.1 bindgen --version
  28. GNU make 4.0 make --version
  29. bash 4.2 bash --version
  30. binutils 2.30 ld -v
  31. flex 2.5.35 flex --version
  32. bison 2.0 bison --version
  33. pahole 1.22 pahole --version
  34. util-linux 2.10o mount --version
  35. kmod 13 depmod -V
  36. e2fsprogs 1.41.4 e2fsck -V
  37. jfsutils 1.1.3 fsck.jfs -V
  38. xfsprogs 2.6.0 xfs_db -V
  39. squashfs-tools 4.0 mksquashfs -version
  40. btrfs-progs 0.18 btrfs --version
  41. pcmciautils 004 pccardctl -V
  42. quota-tools 3.09 quota -V
  43. PPP 2.4.0 pppd --version
  44. nfs-utils 1.0.5 showmount --version
  45. procps 3.2.0 ps --version
  46. udev 081 udevd --version
  47. grub 0.93 grub --version || grub-install --version
  48. mcelog 0.6 mcelog --version
  49. iptables 1.4.2 iptables -V
  50. openssl & libcrypto 1.0.0 openssl version
  51. bc 1.06.95 bc --version
  52. Sphinx\ [#f1]_ 3.4.3 sphinx-build --version
  53. GNU tar 1.28 tar --version
  54. gtags (optional) 6.6.5 gtags --version
  55. mkimage (optional) 2017.01 mkimage --version
  56. Python 3.9.x python3 --version
  57. GNU AWK (optional) 5.1.0 gawk --version
  58. ====================== =============== ========================================
  59. .. [#f1] Sphinx is needed only to build the Kernel documentation
  60. Kernel compilation
  61. ******************
  62. GCC
  63. ---
  64. The gcc version requirements may vary depending on the type of CPU in your
  65. computer.
  66. Clang/LLVM (optional)
  67. ---------------------
  68. The latest formal release of clang and LLVM utils (according to
  69. `releases.llvm.org <https://releases.llvm.org>`_) are supported for building
  70. kernels. Older releases aren't guaranteed to work, and we may drop workarounds
  71. from the kernel that were used to support older versions. Please see additional
  72. docs on :ref:`Building Linux with Clang/LLVM <kbuild_llvm>`.
  73. Rust (optional)
  74. ---------------
  75. A recent version of the Rust compiler is required.
  76. Please see Documentation/rust/quick-start.rst for instructions on how to
  77. satisfy the build requirements of Rust support. In particular, the ``Makefile``
  78. target ``rustavailable`` is useful to check why the Rust toolchain may not
  79. be detected.
  80. bindgen (optional)
  81. ------------------
  82. ``bindgen`` is used to generate the Rust bindings to the C side of the kernel.
  83. It depends on ``libclang``.
  84. Make
  85. ----
  86. You will need GNU make 4.0 or later to build the kernel.
  87. Bash
  88. ----
  89. Some bash scripts are used for the kernel build.
  90. Bash 4.2 or newer is needed.
  91. Binutils
  92. --------
  93. Binutils 2.30 or newer is needed to build the kernel.
  94. pkg-config
  95. ----------
  96. The build system, as of 4.18, requires pkg-config to check for installed
  97. kconfig tools and to determine flags settings for use in
  98. 'make {g,x}config'. Previously pkg-config was being used but not
  99. verified or documented.
  100. Flex
  101. ----
  102. Since Linux 4.16, the build system generates lexical analyzers
  103. during build. This requires flex 2.5.35 or later.
  104. Bison
  105. -----
  106. Since Linux 4.16, the build system generates parsers
  107. during build. This requires bison 2.0 or later.
  108. pahole
  109. ------
  110. Since Linux 5.2, if CONFIG_DEBUG_INFO_BTF is selected, the build system
  111. generates BTF (BPF Type Format) from DWARF in vmlinux, a bit later from kernel
  112. modules as well. This requires pahole v1.22 or later.
  113. It is found in the 'dwarves' or 'pahole' distro packages or from
  114. https://fedorapeople.org/~acme/dwarves/.
  115. Perl
  116. ----
  117. You will need perl 5 and the following modules: ``Getopt::Long``,
  118. ``Getopt::Std``, ``File::Basename``, and ``File::Find`` to build the kernel.
  119. Python
  120. ------
  121. Several config options require it: it is required for arm/arm64
  122. default configs, CONFIG_LTO_CLANG, some DRM optional configs,
  123. the kernel-doc tool, and docs build (Sphinx), among others.
  124. BC
  125. --
  126. You will need bc to build kernels 3.10 and higher
  127. OpenSSL
  128. -------
  129. Module signing and external certificate handling use the OpenSSL program and
  130. crypto library to do key creation and signature generation.
  131. You will need openssl to build kernels 3.7 and higher if module signing is
  132. enabled. You will also need openssl development packages to build kernels 4.3
  133. and higher.
  134. Tar
  135. ---
  136. GNU tar is needed if you want to enable access to the kernel headers via sysfs
  137. (CONFIG_IKHEADERS).
  138. gtags / GNU GLOBAL (optional)
  139. -----------------------------
  140. The kernel build requires GNU GLOBAL version 6.6.5 or later to generate
  141. tag files through ``make gtags``. This is due to its use of the gtags
  142. ``-C (--directory)`` flag.
  143. mkimage
  144. -------
  145. This tool is used when building a Flat Image Tree (FIT), commonly used on ARM
  146. platforms. The tool is available via the ``u-boot-tools`` package or can be
  147. built from the U-Boot source code. See the instructions at
  148. https://docs.u-boot.org/en/latest/build/tools.html#building-tools-for-linux
  149. GNU AWK
  150. -------
  151. GNU AWK is needed if you want kernel builds to generate address range data for
  152. builtin modules (CONFIG_BUILTIN_MODULE_RANGES).
  153. System utilities
  154. ****************
  155. Architectural changes
  156. ---------------------
  157. DevFS has been obsoleted in favour of udev
  158. (https://www.kernel.org/pub/linux/utils/kernel/hotplug/)
  159. 32-bit UID support is now in place. Have fun!
  160. Linux documentation for functions is transitioning to inline
  161. documentation via specially-formatted comments near their
  162. definitions in the source. These comments can be combined with ReST
  163. files in the Documentation/ directory to make enriched documentation, which can
  164. then be converted to PostScript, HTML, LaTex, ePUB and PDF files.
  165. In order to convert from ReST format to a format of your choice, you'll need
  166. Sphinx.
  167. Util-linux
  168. ----------
  169. New versions of util-linux provide ``fdisk`` support for larger disks,
  170. support new options to mount, recognize more supported partition
  171. types, and similar goodies.
  172. You'll probably want to upgrade.
  173. Ksymoops
  174. --------
  175. If the unthinkable happens and your kernel oopses, you may need the
  176. ksymoops tool to decode it, but in most cases you don't.
  177. It is generally preferred to build the kernel with ``CONFIG_KALLSYMS`` so
  178. that it produces readable dumps that can be used as-is (this also
  179. produces better output than ksymoops). If for some reason your kernel
  180. is not build with ``CONFIG_KALLSYMS`` and you have no way to rebuild and
  181. reproduce the Oops with that option, then you can still decode that Oops
  182. with ksymoops.
  183. Mkinitrd
  184. --------
  185. These changes to the ``/lib/modules`` file tree layout also require that
  186. mkinitrd be upgraded.
  187. E2fsprogs
  188. ---------
  189. The latest version of ``e2fsprogs`` fixes several bugs in fsck and
  190. debugfs. Obviously, it's a good idea to upgrade.
  191. JFSutils
  192. --------
  193. The ``jfsutils`` package contains the utilities for the file system.
  194. The following utilities are available:
  195. - ``fsck.jfs`` - initiate replay of the transaction log, and check
  196. and repair a JFS formatted partition.
  197. - ``mkfs.jfs`` - create a JFS formatted partition.
  198. - other file system utilities are also available in this package.
  199. Xfsprogs
  200. --------
  201. The latest version of ``xfsprogs`` contains ``mkfs.xfs``, ``xfs_db``, and the
  202. ``xfs_repair`` utilities, among others, for the XFS filesystem. It is
  203. architecture independent and any version from 2.0.0 onward should
  204. work correctly with this version of the XFS kernel code (2.6.0 or
  205. later is recommended, due to some significant improvements).
  206. PCMCIAutils
  207. -----------
  208. PCMCIAutils replaces ``pcmcia-cs``. It properly sets up
  209. PCMCIA sockets at system startup and loads the appropriate modules
  210. for 16-bit PCMCIA devices if the kernel is modularized and the hotplug
  211. subsystem is used.
  212. Quota-tools
  213. -----------
  214. Support for 32 bit uid's and gid's is required if you want to use
  215. the newer version 2 quota format. Quota-tools version 3.07 and
  216. newer has this support. Use the recommended version or newer
  217. from the table above.
  218. Intel IA32 microcode
  219. --------------------
  220. A driver has been added to allow updating of Intel IA32 microcode,
  221. accessible as a normal (misc) character device. If you are not using
  222. udev you may need to::
  223. mkdir /dev/cpu
  224. mknod /dev/cpu/microcode c 10 184
  225. chmod 0644 /dev/cpu/microcode
  226. as root before you can use this. You'll probably also want to
  227. get the user-space microcode_ctl utility to use with this.
  228. udev
  229. ----
  230. ``udev`` is a userspace application for populating ``/dev`` dynamically with
  231. only entries for devices actually present. ``udev`` replaces the basic
  232. functionality of devfs, while allowing persistent device naming for
  233. devices.
  234. FUSE
  235. ----
  236. Needs libfuse 2.4.0 or later. Absolute minimum is 2.3.0 but mount
  237. options ``direct_io`` and ``kernel_cache`` won't work.
  238. Networking
  239. **********
  240. General changes
  241. ---------------
  242. If you have advanced network configuration needs, you should probably
  243. consider using the network tools from ip-route2.
  244. Packet Filter / NAT
  245. -------------------
  246. The packet filtering and NAT code uses the same tools like the previous 2.4.x
  247. kernel series (iptables). It still includes backwards-compatibility modules
  248. for 2.2.x-style ipchains and 2.0.x-style ipfwadm.
  249. PPP
  250. ---
  251. The PPP driver has been restructured to support multilink and to
  252. enable it to operate over diverse media layers. If you use PPP,
  253. upgrade pppd to at least 2.4.0.
  254. If you are not using udev, you must have the device file /dev/ppp
  255. which can be made by::
  256. mknod /dev/ppp c 108 0
  257. as root.
  258. NFS-utils
  259. ---------
  260. In ancient (2.4 and earlier) kernels, the nfs server needed to know
  261. about any client that expected to be able to access files via NFS. This
  262. information would be given to the kernel by ``mountd`` when the client
  263. mounted the filesystem, or by ``exportfs`` at system startup. exportfs
  264. would take information about active clients from ``/var/lib/nfs/rmtab``.
  265. This approach is quite fragile as it depends on rmtab being correct
  266. which is not always easy, particularly when trying to implement
  267. fail-over. Even when the system is working well, ``rmtab`` suffers from
  268. getting lots of old entries that never get removed.
  269. With modern kernels we have the option of having the kernel tell mountd
  270. when it gets a request from an unknown host, and mountd can give
  271. appropriate export information to the kernel. This removes the
  272. dependency on ``rmtab`` and means that the kernel only needs to know about
  273. currently active clients.
  274. To enable this new functionality, you need to::
  275. mount -t nfsd nfsd /proc/fs/nfsd
  276. before running exportfs or mountd. It is recommended that all NFS
  277. services be protected from the internet-at-large by a firewall where
  278. that is possible.
  279. mcelog
  280. ------
  281. On x86 kernels the mcelog utility is needed to process and log machine check
  282. events when ``CONFIG_X86_MCE`` is enabled. Machine check events are errors
  283. reported by the CPU. Processing them is strongly encouraged.
  284. Kernel documentation
  285. ********************
  286. Sphinx
  287. ------
  288. Please see :ref:`sphinx_install` in :ref:`Documentation/doc-guide/sphinx.rst <sphinxdoc>`
  289. for details about Sphinx requirements.
  290. rustdoc
  291. -------
  292. ``rustdoc`` is used to generate the documentation for Rust code. Please see
  293. Documentation/rust/general-information.rst for more information.
  294. Getting updated software
  295. ========================
  296. Kernel compilation
  297. ******************
  298. gcc
  299. ---
  300. - <ftp://ftp.gnu.org/gnu/gcc/>
  301. Clang/LLVM
  302. ----------
  303. - :ref:`Getting LLVM <getting_llvm>`.
  304. Rust
  305. ----
  306. - Documentation/rust/quick-start.rst.
  307. bindgen
  308. -------
  309. - Documentation/rust/quick-start.rst.
  310. Make
  311. ----
  312. - <ftp://ftp.gnu.org/gnu/make/>
  313. Bash
  314. ----
  315. - <ftp://ftp.gnu.org/gnu/bash/>
  316. Binutils
  317. --------
  318. - <https://www.kernel.org/pub/linux/devel/binutils/>
  319. Flex
  320. ----
  321. - <https://github.com/westes/flex/releases>
  322. Bison
  323. -----
  324. - <ftp://ftp.gnu.org/gnu/bison/>
  325. OpenSSL
  326. -------
  327. - <https://www.openssl.org/>
  328. System utilities
  329. ****************
  330. Util-linux
  331. ----------
  332. - <https://www.kernel.org/pub/linux/utils/util-linux/>
  333. Kmod
  334. ----
  335. - <https://www.kernel.org/pub/linux/utils/kernel/kmod/>
  336. - <https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git>
  337. Ksymoops
  338. --------
  339. - <https://www.kernel.org/pub/linux/utils/kernel/ksymoops/v2.4/>
  340. Mkinitrd
  341. --------
  342. - <https://code.launchpad.net/initrd-tools/main>
  343. E2fsprogs
  344. ---------
  345. - <https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/>
  346. - <https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/>
  347. JFSutils
  348. --------
  349. - <https://jfs.sourceforge.net/>
  350. Xfsprogs
  351. --------
  352. - <https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git>
  353. - <https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/>
  354. Pcmciautils
  355. -----------
  356. - <https://www.kernel.org/pub/linux/utils/kernel/pcmcia/>
  357. Quota-tools
  358. -----------
  359. - <https://sourceforge.net/projects/linuxquota/>
  360. Intel P6 microcode
  361. ------------------
  362. - <https://downloadcenter.intel.com/>
  363. udev
  364. ----
  365. - <https://www.freedesktop.org/software/systemd/man/udev.html>
  366. FUSE
  367. ----
  368. - <https://github.com/libfuse/libfuse/releases>
  369. mcelog
  370. ------
  371. - <https://www.mcelog.org/>
  372. Networking
  373. **********
  374. PPP
  375. ---
  376. - <https://download.samba.org/pub/ppp/>
  377. - <https://git.ozlabs.org/?p=ppp.git>
  378. - <https://github.com/paulusmack/ppp/>
  379. NFS-utils
  380. ---------
  381. - <https://sourceforge.net/project/showfiles.php?group_id=14>
  382. - <https://nfs.sourceforge.net/>
  383. Iptables
  384. --------
  385. - <https://netfilter.org/projects/iptables/index.html>
  386. Ip-route2
  387. ---------
  388. - <https://www.kernel.org/pub/linux/utils/net/iproute2/>
  389. OProfile
  390. --------
  391. - <https://oprofile.sf.net/download/>
  392. Kernel documentation
  393. ********************
  394. Sphinx
  395. ------
  396. - <https://www.sphinx-doc.org/>