From Gentoo Wiki
Jump to: navigation, search
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎日本語 • ‎한국어 • ‎polski • ‎русский • ‎Türkçe • ‎中文(中国大陆)‎

Athough Gentoo is a free operating system based on either Linux or FreeBSD and FreeBSD has its own kernel, for practical reasons, this article refers to the Linux kernel.

The Linux kernel is the core of the operating system and offers an interface for programs to access the hardware. The kernel contains most of the device drivers.


USE flags

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.

Optional USE flags for sys-kernel/gentoo-sources:
USE flag (what is that?) Default Recommended Description
build No No  !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping [make stage1]
deblob No Remove binary blobs from kernel sources to provide libre license compliance.
symlink No Force kernel ebuilds to automatically update the /usr/src/linux symlink


Now install sys-kernel/gentoo-sources:

root #emerge --ask sys-kernel/gentoo-sources

Alternative kernels

There are various alternative kernel sources in the main Gentoo repository:

  • sys-kernel/vanilla-sources - The official, non-patched Linux kernel sources. These sources are left as is, they do not contain any additional patches and are therefore not supported by Gentoo support or developers.
  • sys-kernel/hardened-sources - Gentoo sources with security enhancements.

Sources overview

Kernel sources overview
Most, if not all, of the kernel sources packages available in Gentoo are detailed in the kernel sources overview article. Navigate there for further knowledge on specific kernel sources available in the main Gentoo repository.

Searching all alternatives

A full list of kernel sources with short descriptions can be found by searching with emerge:

root #emerge --search sources

Configuration help

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.
Steps to upgrade to a new kernel using an existing configuration.
Steps to completely remove old kernels.
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.
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.

See also

External resources

  • - Blogs related to the Linux kernel.
  • - A site dedicated to kernel statistics.
  • - "A site for aspiring Linux kernel developers who work to improve their Kernels and more experienced developers willing to share their [kernel] knowledge."