Kernel that linux uses

Kernel

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 latest stable 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 the file system under /boot/ . To be able to boot into kernels, the boot loader has to be configured appropriately.

Contents

Officially supported kernels

Community support on forum and bug reporting is available for 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 .

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

Following methods can be used 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.

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

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 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

  • Longterm 4.19 — Long-term support (LTS) Linux 4.19 kernel and modules.

https://www.kernel.org/ || linux-lts419AUR

  • Longterm 5.4 — Long-term support (LTS) Linux 5.4 kernel and modules.

https://www.kernel.org/ || linux-lts54AUR

Unofficial kernels

  • Aufs — The aufs-compatible linux kernel and modules, useful when using docker.

http://aufs.sourceforge.net/ || linux-aufsAUR

  • Ck — Contains patches by Con Kolivas (including the MuQSS scheduler) designed to improve system responsiveness with specific emphasis on the desktop, but they are suitable to any workload.

http://ck.kolivas.org/ || linux-ckAUR

  • Clear — Patches from Intel’s Clear Linux project. Provides performance and security optimizations.
Читайте также:  Lenovo g50 зависает при установке windows

https://github.com/clearlinux-pkgs/linux || linux-clearAUR

  • GalliumOS — The Linux kernel and modules with GalliumOS patches for Chromebooks.

https://github.com/GalliumOS/linux || linux-galliumosAUR

  • Libre — Without propietary or obfuscated device drivers.

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

  • pf-kernel — Provides a handful of awesome features which are not merged into a kernel mainline. Maintained by a kernel engineer. If the port for the included patch for new kernels was not released officially, the patchset provides and supports patch ports to new kernels. The current most prominent patches of linux-pf are PDS CPU scheduler and UKSM.

https://gitlab.com/post-factum/pf-kernel/wikis/README || Packages:

  • Repository by pf-kernel developer post-factum
  • Repository, linux-pfAUR , linux-pf-preset-defaultAUR by pf-kernel fork developer Thaodan
  • linux-pf-gitAUR by yurikoles
  • 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

  • tkg — A highly customizable kernel build system that provides a selection of patches and tweaks aiming for better desktop and gaming performance. It is maintained by Etienne Juvigny. Amongst other patches, it offers various CPU schedulers: CFS, Project C PDS, Project C BMQ, MuQSS and CacULE.

https://github.com/Frogging-Family/linux-tkg || not packaged? search in AUR

  • 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

  • XanMod — Aiming to take full advantage in high-performance workstations, gaming desktops, media centers and others and built to provide a more rock-solid, responsive and smooth desktop experience. This kernel uses the MuQSS or CacULE scheduler, BFQ I/O scheduler, UKSM realtime memory data deduplication, TCP BBR congestion control, x86_64 advanced instruction set support, and other default changes.

https://xanmod.org/ || linux-xanmodAUR , linux-xanmod-caculeAUR

Debugging regressions

Try linux-mainline AUR to check if the issue is already fixed upstream. The stickied comment also mentions a repository which contains already built kernels, so it may not be necessary to build it manually, which can take some time.

It may also be worth considering trying the LTS kernel ( linux-lts ) to debug issues which did not appear recently. Older versions of the LTS kernel can be found in the Arch Linux Archive.

If the issue still persists, bisect linux-git AUR and report the bug on the kernel bugzilla. It is important to try the «vanilla» version without any patches to make sure it is not related to them. If a patch causes the issue, report it to the author of the patch.

Источник

Kernel

Kernel series

Void Linux provides many kernel series in the default repository. These are named linux . : for example, linux4.19 . You can query for all available kernel series by running:

Читайте также:  Как включить one drive для windows 10

The linux meta package, installed by default, depends on one of the kernel packages, usually the package containing the latest mainline kernel that works with all DKMS modules. Newer kernels might be available in the repository, but are not necessarily considered stable enough to be the default; use these at your own risk. If you wish to use a more recent kernel and have DKMS modules that you need to build, install the relevant linux . -headers package, then use xbps-reconfigure(1) to reconfigure the linux . package you installed. This will build the DKMS modules.

Removing old kernels

When updating the kernel, old versions are left behind in case it is necessary to roll back to an older version. Over time, old kernel versions can accumulate, consuming disk space and increasing the time taken by DKMS module updates. Furthermore, if /boot is a separate partition and fills up with old kernels, updating can fail or result in incomplete initramfs filesystems to be generated and result in kernel panics if they are being booted. Thus, it may be advisable to clean old kernels from time to time.

Removing old kernels is done using the vkpurge(8) utility. vkpurge comes pre-installed on every Void Linux system. This utility runs the necessary hooks when removing old kernels. Note that vkpurge does not remove kernel packages, only particular kernels.

Removing the default kernel series

If you’ve installed a kernel package for a series other than the default, and want to remove the default kernel packages, you should install the linux-base package or mark it as a manual package in case it is already installed. After this procedure, you can remove the default kernel packages with xbps-remove(1). It might be necessary to add linux and linux-headers to an ignorepkg entry in xbps.d(5), since base packages can depend on them.

cmdline

The kernel, the initial RAM disk (initrd) and some system programs can be configured at boot by kernel command line arguments. The parameters understood by the kernel are explained in the kernel-parameters documentation and by bootparam(7). Parameters understood by dracut can be found in dracut.cmdline(7).

Once the system is booted, the current kernel command line parameters can be found in the /proc/cmdline file. Some system programs can change their behavior based on the parameters passed in the command line, which is what happens when booting a different runsvdir, for example.

There are different ways of setting these parameters, some of which are explained below.

Kernel command line arguments can be added through the GRUB bootloader by editing /etc/default/grub , changing the GRUB_CMDLINE_LINUX_DEFAULT variable and then running update-grub .

dracut

Dracut offers a kernel_cmdline configuration option and —kernel-cmdline command-line option that will encode command-line arguments directly in the initramfs image. When dracut is used to create a UEFI executable, arguments set with these options will be passed to the kernel. However, when an ordinary initramfs is produced, these options will not be passed to the kernel at boot. Instead, they will be written to a configuration file in /etc/cmdline.d within the image. While dracut parses this configuration to control its own boot-time behavior, the kernel itself will not be aware of anything set via this mechanism.

After modifying a dracut configuration, regenerate the initramfs to ensure that it includes the changes.

Читайте также:  Какого назначение рабочего стола windows

Kernel hardening

Void Linux ships with some kernel security options enabled by default. This was originally provided by kernel command line arguments slub_debug=P page_poison=1 , but since kernel series 5.3, these have been replaced with init_on_alloc and init_on_free (see this commit).

Void’s kernels come with the init_on_alloc option enabled by default where available (i.e. linux5.4 and greater). In most cases you should usually not disable it, as it has a fairly minimal impact on performance (within 1%). The init_on_free option is more expensive (around 5% on average) and needs to be enabled manually by passing init_on_free=1 on the kernel command line. If you need to disable init_on_alloc , you can do that similarly by passing init_on_alloc=0 .

There is a chance that your existing system still has the old options enabled. They still work in newer kernels, but have a performance impact more in line with init_on_free=1 . On older hardware this can be quite noticeable. If you are running a kernel series older than 5.4, you can keep them (or add them) for extra security at the cost of speed; otherwise you should remove them.

Kernel modules

Kernel modules are typically drivers for devices or filesystems.

Loading kernel modules during boot

Normally the kernel automatically loads required modules, but sometimes it may be necessary to explicitly specify modules to be loaded during boot.

To load kernel modules during boot, a .conf file like /etc/modules-load.d/virtio.conf needs to be created with the contents:

Blacklisting kernel modules

Blacklisting kernel modules is a method for preventing modules from being loaded by the kernel. There are two different methods for blacklisting kernel modules, one for modules loaded by the initramfs and one for modules loaded after the initramfs process is done. Modules loaded by the initramfs have to be blacklisted in the initramfs configuration.

To blacklist modules loaded after the initramfs process, create a .conf file, like /etc/modprobe.d/radeon.conf , with the contents:

Blacklisting modules in the initramfs

After making the necessary changes to the configuration files, the initramfs needs to be regenerated for the changes to take effect on the next boot.

dracut

Dracut can be configured to not include kernel modules through a configuration file. To blacklist modules from being included in a dracut initramfs, create a .conf file, like /etc/dracut.conf.d/radeon.conf , with the contents:

mkinitcpio

To blacklist modules from being included in a mkinitcpio initramfs a .conf file needs to be created like /etc/modprobe.d/radeon.conf with the contents:

Kernel hooks

Void Linux provides directories for kernel hooks in /etc/kernel.d/ .

These hooks are used to update the boot menus for bootloaders like grub , gummiboot and lilo .

Install hooks

The -install hooks are executed by xbps-reconfigure(1) when configuring a Linux kernel, such as building its initramfs. This happens when a kernel series is installed for the first time or updated, but can also be run manually:

If run manually, they serve to apply initramfs configuration changes to the next boot.

Remove hooks

The -remove hooks are executed by vkpurge(8) when removing old kernels.

Dynamic Kernel Module Support (DKMS)

There are kernel modules that are not part of the Linux source tree that are built at install time using DKMS and kernel hooks. The available modules can be listed by searching for dkms in the package repositories.

DKMS build logs are available in /var/lib/dkms/ .

Источник

Оцените статью