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