Kernel
The kernel is the core of the operating system. Containing most of the device drives, the kernel offers interfaces for programs to access system hardware such as memory, graphic cards, and block devices.
This article refers exclusively to the Linux kernel.
Installation[edit | edit source]
Which kernel to install?[edit | edit source]
Gentoo recommends sys-kernel/gentoo-sources for most users. Its stable versions follow the long term stable (LTS) kernels from upstream kernel.org.
USE flags[edit | edit source]
To create a kernel, it is necessary to install the kernel source code first. The Gentoo recommended kernel sources for a desktop system are, of course, sys-kernel/gentoo-sources. These are maintained by the Gentoo developers, and patched to fix security vulnerabilities, functional problems, as well as to improve compatibility with rare system architectures.
USE flags for sys-kernel/gentoo-sources Full sources including the Gentoo patchset for the 5.11 kernel tree
build
|
!!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping [make stage1] |
experimental
|
Apply experimental patches; for more information, see "https://wiki.gentoo.org/wiki/Project:Kernel/Experimental". |
symlink
|
Force kernel ebuilds to automatically update the /usr/src/linux symlink |
Emerge[edit | edit source]
Now install sys-kernel/gentoo-sources:
root #
emerge --ask sys-kernel/gentoo-sources
Alternative kernels[edit | edit source]
Although all stable kernel Gentoo provides is sys-kernel/gentoo-sources, there are many other kernel packages in the Portage tree. See the Kernel sources overview article, which gives details on most of them.
For which to pick, see also the blog article What Stable Kernel Should I Use? by Greg Kroah-Hartman, a major kernel developer.
Searching all kernel packages[edit | edit source]
A full list of kernel sources with short descriptions can be found by searching with emerge:
root #
emerge --search "%@^sys-kernel/.*sources"
Available articles[edit | edit source]
Configuration[edit | edit source]
- Automatic configuration
- genkernel is a tool used to automate the build process of the kernel and initramfs. The goal of genkernel is to help users through the kernel building process.
- Manual configuration
- Manual configuration enables the user, with some effort, to create a custom-fit kernel configuration.
- Gentoo kernel configuration guide
- Gentoo's kernel configuration guide.
- Kernel security
- Instructions for securing the kernel.
- Kernel Seeds
- Like the option above, Kernels Seeds help the user, with some effort, create a custom-fit kernel configuration using an existing .config as a base.
Upgrade[edit | edit source]
- Upgrade
- Steps to upgrade to a new kernel using an existing configuration.
- 2.4 to 2.6 Migration
- Migration guide from Linux 2.4 to Linux 2.6. Since the Linux kernel codebase has significantly moved past 2.6, these migration steps are no longer relevant, but may be useful for helping administrators understand.
Removal[edit | edit source]
- Removal
- Steps to completely remove old kernels.
Troubleshooting[edit | edit source]
In-kernel configuration support[edit | edit source]
See the IKCONFIG support sub-article.
Kernel command-line parameters[edit | edit source]
When booting from a bootloader, the Linux kernel can accept command-line parameters to change its behavior. This can aid in troubleshooting the kernel at boot time, to blacklist a certain module that should not loading, etc.
Kernel.org has a nicely formatted list of available kernel command-line parameters to review.
Specifically, the following command-line parameters may be helpful when booting Gentoo:
earlyprintk=
module_blacklist=
nomodule
loglevel=
rootdelay=
See also[edit | edit source]
- Linux firmware โ is a package distributed alongside the Linux kernel that contains firmware binary blobs necessary for partial or full functionality of certain hardware devices.
- LVFS โ a daemon that provides a safe, reliable way of applying firmware updates on Linux.
- Kernel/IKCONFIG support โ Enabling In-kernel Config (IKCONFIG) support for the Linux kernel enables the inspection of kernel configuration for running kernels.
- The kernel category - All the kernel related articles on the wiki.
- The hardware category - Lists of hardware stacks with associated kernel configurations.
External resources[edit | edit source]
- planet.kernel.org - Blogs related to the Linux kernel.
- kernelnewbies.org - A "community of aspiring Linux kernel developers who work to improve their Kernels and more experienced developers willing to share their knowledge".
- kernel.org/doc/ - Official comprehensible documentation for the Linux kernel.
- What Stable Kernel Should I Use?, written by Greg Kroah-Hartman.
- Building the kernel as root can be harmful