LinuxCommandLibrary

eselect-kernel

Select active bootable Linux kernel

TLDR

List available kernel symlink targets with their numbers

$ eselect kernel list
copy

Set the /usr/src/linux symlink by name or number from the list command
$ eselect kernel set [name|number]
copy

Show what the current kernel symlink points to
$ eselect kernel show
copy

Set the kernel symlink to the currently running kernel
$ eselect kernel update
copy

SYNOPSIS

eselect kernel list | set | update

PARAMETERS

list
    Lists the available kernels in the /boot directory that are detected by eselect-kernel. The output shows the available kernel names and indicates the currently selected kernel.

set
    Sets the specified as the default kernel to boot from. The kernel name must match one of the kernels listed by the 'list' command.

update
    Updates the bootloader configuration based on the selected kernel. This regenerates the bootloader configuration file (e.g., grub.conf or lilo.conf) and makes the changes effective for the next boot.

DESCRIPTION

The eselect-kernel command is a utility in Gentoo Linux that simplifies the process of managing and selecting different kernel versions. It allows users to easily list available kernels, set a specific kernel as the default for booting, and update the bootloader configuration accordingly. This tool abstracts away the complexities of manually editing bootloader configuration files (like GRUB or LILO) and ensures that the system boots with the intended kernel after a reboot.

eselect-kernel automatically detects installed kernels by examining the /boot directory. It then presents these kernels to the user in a user-friendly manner. Upon selection, it updates the bootloader configuration to use the chosen kernel and generates the necessary bootloader files. This helps to avoid common errors that can arise from manually modifying bootloader configurations, especially for inexperienced users. This is important because an incorrect bootloader configuration could render the system unable to boot.

The tool is part of the eselect framework, which aims to provide a consistent interface for managing various system configurations within Gentoo. eselect-kernel significantly streamlines kernel management, making it an essential tool for Gentoo users who frequently compile and install custom kernels.

CAVEATS

eselect-kernel relies on the kernels being properly installed in the /boot directory. It does not handle kernel compilation or installation itself. You'll need to have the kernel image (vmlinuz) and initrd image (if necessary) correctly placed in /boot. Also, make sure the bootloader you use (GRUB, LILO, etc.) is properly configured before using eselect-kernel.

BOOTLOADER CONFIGURATION

After using eselect-kernel, it is recommended to review the generated bootloader configuration file (e.g., /boot/grub/grub.cfg or /etc/lilo.conf) to ensure that the settings are as expected. This is particularly important if you have custom boot parameters or other advanced configurations. You can use GRUB or LILO config files to review settings.

INITRAMFS/INITRD

If your kernel requires an initramfs or initrd image for booting, ensure that the correct image is present in the /boot directory and that the bootloader configuration points to it. eselect-kernel typically handles this automatically, but it's good to double-check.

HISTORY

eselect-kernel was developed as part of the eselect framework in Gentoo Linux to provide a more user-friendly and consistent way to manage various system configurations. Traditionally, managing kernel selection involved manually editing bootloader configuration files, which was error-prone. eselect-kernel simplified this process by automating the detection of available kernels and the updating of the bootloader configuration.

SEE ALSO

grub-mkconfig(8), lilo(8)

Copied to clipboard