Kernel: Difference between revisions

From ArchWiki
(→‎kernel.org kernels: add LTS 4.14)
(add info how to install and boot into kernel, see talk)
Line 19: Line 19:


[[Arch Linux]] is based on the Linux kernel. There are various alternative Linux kernels available for Arch Linux in addition to the stable [[Wikipedia:Linux kernel|Linux kernel]]. This article lists some of the options available in the repositories with a brief description of each. There is also a description of patches that can be applied to the system's kernel. The article ends with an overview of custom kernel compilation with links to various methods.
[[Arch Linux]] is based on the Linux kernel. There are various alternative Linux kernels available for Arch Linux in addition to the stable [[Wikipedia:Linux kernel|Linux kernel]]. This article lists some of the options available in the repositories with a brief description of each. There is also a description of patches that can be applied to the system's kernel. The article ends with an overview of custom kernel compilation with links to various methods.
Kernel packages are [[install]]ed onto file system under {{ic|/boot/}}. To be able to boot into kernels [[boot loader]] has to be configured appropriately.


== Officially supported kernels ==
== Officially supported kernels ==

Revision as of 04:01, 24 January 2019

According to Wikipedia:

The Linux kernel is an open-source monolithic Unix-like computer operating system kernel.

Arch Linux is based on the Linux kernel. There are various alternative Linux kernels available for Arch Linux in addition to the stable Linux kernel. This article lists some of the options available in the repositories with a brief description of each. There is also a description of patches that can be applied to the system's kernel. The article ends with an overview of custom kernel compilation with links to various methods.

Kernel packages are installed onto file system under /boot/. To be able to boot into kernels boot loader has to be configured appropriately.

Officially supported kernels

  • Stable — Vanilla Linux kernel and modules, with a few patches applied.
https://www.kernel.org/ || linux
  • Hardened — A security-focused Linux kernel applying a set of hardening patches to mitigate kernel and userspace exploits. It also enables more upstream kernel hardening features than linux along with AppArmor and SELinux.
https://github.com/anthraxx/linux-hardened || linux-hardened
  • Longterm — Long-term support (LTS) Linux kernel and modules.
https://www.kernel.org/ || linux-lts
  • ZEN Kernel — Result of a collaborative effort of kernel hackers to provide the best Linux kernel possible for everyday systems. Some more details can be found on https://liquorix.net (which provides kernel binaries based on ZEN for Debian).
https://github.com/zen-kernel/zen-kernel || linux-zen

Compilation

Arch Linux provides two methods to compile your own kernel.

/Arch Build System
Takes advantage of the high quality of existing linux PKGBUILD and the benefits of package management.
/Traditional compilation
Involves manually downloading a source tarball, and compiling in your home directory as a normal user.

kernel.org kernels

  • Git — Linux kernel and modules built using sources from Linus Torvalds' Git repository
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git || linux-gitAUR
  • Mainline — Kernels where all new features are introduced, released every 2-3 months.
https://www.kernel.org/ || linux-mainlineAUR
  • Next — Bleeding edge kernels with features pending to be merged into next mainline release.
https://www.kernel.org/doc/man-pages/linux-next.html || linux-next-gitAUR
  • Longterm 3.16 — Long-term support (LTS) Linux 3.16 kernel and modules.
https://www.kernel.org/ || linux-lts316AUR
  • Longterm 4.4 — Long-term support (LTS) Linux 4.4 kernel and modules.
https://www.kernel.org/ || linux-lts44AUR
  • Longterm 4.9 — Long-term support (LTS) Linux 4.9 kernel and modules.
https://www.kernel.org/ || linux-lts49AUR
  • Longterm 4.14 — Long-term support (LTS) Linux 4.14 kernel and modules.
https://www.kernel.org/ || linux-lts414AUR

Patches and patchsets

There are lots of reasons to patch your kernel, the major ones are for performance or support for non-mainline features such as reiser4 file system support. Other reasons might include fun and to see how it is done and what the improvements are.

However, it is important to note that the best way to increase the speed of your system is to first tailor your kernel to your system, especially the architecture and processor type. For this reason using pre-packaged versions of custom kernels with generic architecture settings is not recommended or really worth it. A further benefit is that you can reduce the size of your kernel (and therefore build time) by not including support for things you do not have or use. For example, you might start with the stock kernel config when a new kernel version is released and remove support for things like bluetooth, video4linux, 1000Mbit ethernet, etc.; functionality you know you will not require for your specific machine. Although this page is not about customizing your kernel config, it is recommended as a first step--before moving on to using a patchset once you have grasped the fundamentals involved.

The config files for the Arch kernel packages can be used as a starting point. They are in the Arch package source files, for example [1] linked from linux. The config file of your currently running kernel may also be available in your file system at /proc/config.gz if the CONFIG_IKCONFIG_PROC kernel option is enabled.

If you have not actually patched or customized a kernel before it is not that hard and there are many PKGBUILDs on the forum for individual patchsets. However, you are advised to start from scratch with a bit of research on the benefits of each patchset, rather than just arbitrarily picking one. This way you will learn much more about what you are doing rather than just choosing a kernel at startup and then be left wondering what it actually does.

Warning: Patchsets are developed by a variety of people. Some of these people are actually involved in the production of the linux kernel and others are hobbyists, which may reflect its level of reliability and stability.

Major patchsets

  • Linux-ck — Contains patches by Con Kolivas designed to improve system responsiveness with specific emphasis on the desktop, but suitable to any workload.
http://ck.kolivas.org/ || linux-ckAUR
  • pf-kernel — Provides you with a handful of awesome features not merged into mainline. It is based on neither existing Linux fork nor patchset, although some unofficial ports may be used if required patches have not been released officially. The most prominent patches of linux-pf are PDS CPU scheduler and UKSM.
https://gitlab.com/post-factum/pf-kernel/wikis/README || Packages:
  • Realtime kernel — Maintained by a small group of core developers, led by Ingo Molnar. This patch allows nearly all of the kernel to be preempted, with the exception of a few very small regions of code ("raw_spinlock critical regions"). This is done by replacing most kernel spinlocks with mutexes that support priority inheritance, as well as moving all interrupt and software interrupts to kernel threads.
https://wiki.linuxfoundation.org/realtime/start || linux-rtAUR, linux-rt-ltsAUR

Other patchsets

Some of the listed packages may also be available as binary packages via Unofficial user repositories.

https://gitlab.com/apparmor/apparmor/wikis/About || linux-apparmorAUR
  • Aufs — The aufs-compatible linux kernel and modules, useful when using docker.
http://aufs.sourceforge.net/ ||
  • BLD — Provides alternate CPU load distribution technique for task scheduler.
https://github.com/rmullick/bld-patches/wiki || linux-bldAUR
  • Clear — Patches from Intel's Clear Linux project. Provides performance and security optimizations; WireGuard module.
https://github.com/clearlinux-pkgs/linux || linux-clearAUR
  • Libre — The Linux Kernels without "binary blobs".
https://www.fsfla.org/ikiwiki/selibre/linux-libre/ || linux-libreAUR
  • Liquorix — Kernel replacement built using Debian-targeted configuration and the ZEN kernel sources. Designed for desktop, multimedia, and gaming workloads, it is often used as a Debian Linux performance replacement kernel. Damentz, the maintainer of the Liquorix patchset, is a developer for the ZEN patchset as well.
https://liquorix.net || linux-lqxAUR
  • MultiPath TCP — The Linux Kernel and modules with Multipath TCP support.
https://multipath-tcp.org/ || linux-mptcpAUR
  • Reiser4 — Successor filesystem for ReiserFS, developed from scratch by Namesys and Hans Reiser.
https://sourceforge.net/projects/reiser4/files/ ||
  • VFIO — The Linux kernel and a few patches written by Alex Williamson (acs override and i915) to enable the ability to do PCI Passthrough with KVM on some machines.
https://lwn.net/Articles/499240/ || linux-vfioAUR, linux-vfio-ltsAUR

See also