genkernel

From RaySoft

Genkernel is a tool for building a general-purpose modular Linux kernel for Gentoo Linux. Genkernel compiles the kernel with all available device drivers built as modules, then copies potentially boot-critical ones to an initramfs that is passed to the kernel at boot time, automatically loading the modules before they are needed. It is designed to allow users with little or no experience configuring a Linux kernel to easily set up a working kernel. Also, non-trivial hard disk setups like LVM and/or dm-crypt for full disk encryption make usage of an initramfs unavoidable; here genkernel can save the user from manually creating one.[1]

The main reason for genkernel is the fact that you have to configure and build your own kernel during the installation of Gentoo, this can be a problem for new Linux users. Experienced Linux users generally prefer to configure and build their kernel manually, because genkernel tries to configure the kernel as safely as possible which causes the kernel to grow very large. However, one can choose to use a custom kernel configuration and use genkernel to compile it, and still benefit from other features such as the initramfs builder.[1]

Documentation

Configuration

Files

Syntax

genkernel [PARAMETER ...] ACTION

Actions & Parameters

all
Builds all stages - the initrd, kernel image and modules.
--clean | --no-clean
Activates (or deactivates) the make clean command before compiling the kernel. The make clean command removes all object files and dependencies from the kernel's source tree.
--kernel-config=PATH
Specifies what alternative kernel configuration will be used, rather than the default /path/to/sources/.config file.
--mrproper | --no-mrproper
Activates (or deactivates) the make mrproper command before kernel compilation. Like the make clean command listed above, make mrproper removes all object files and dependencies from the kernel's source tree. However, any previous configuration files (in /path/to/sources/.config or /path/to/sources/.config.old) will also be purged from the kernel's source tree. If it is undesirable that the kernel's .config file keeps disappearing, be sure to disable this option!
--oldconfig
Issues the make oldconfig command, which attempts to collect configuration information for the system's architecture from a generic script in /usr/share/genkernel. This is a non-interactive process; no user input is entertained. Also, if --oldconfig is used in conjunction with --clean, the latter option is negated, resulting in the activation of the --no-clean option.

Examples

Update the kernel with a existing config
genkernel --kernel-config='/root/conf/kernel/4.7.10-hardened-2016-01-26' \
  --oldconfig 'all'

References