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