Installkernel

From Gentoo Wiki
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.
Other languages:
Resources

Installkernel is a collection of scripts to automatically install new kernels and update bootloader configuration.

The package sys-kernel/installkernel provides two different paths of managing kernel installation. The first is systemd's kernel-install, the second is the traditional installkernel originating from Debian.

The systemd USE flag changes which one is used by default, this default may be overridden with the SYSTEMD_KERNEL_INSTALL environment variable. In general systemd's kernel-install is the more modern implementation, and it is therefore recommended and enabled by default on systemd profiles. Users who do not wish to use systemd tools may fallback on Debians installkernel implementation instead.

Additional automation plugins, for example:

are installed and/or enabled via the USE flags on sys-kernel/installkernel as shown in the overview below:

USE flags for sys-kernel/installkernel Gentoo fork of installkernel script from debianutils

dracut Generate an initramfs or UKI on each kernel installation
efistub EXPERIMENTAL: Update UEFI configuration on each kernel installation
grub Re-generate grub.cfg on each kernel installation, used grub.cfg is overridable with GRUB_CFG env var
refind Install a Gentoo icon for rEFInd alongside the (unified) kernel image, used icon is overridable with REFIND_ICON env var
systemd Use systemd's kernel-install to install kernels, overridable with SYSTEMD_KERNEL_INSTALL env var
systemd-boot Use systemd-boot's native layout by default
ugrd Generate an initramfs using UGRD on each kernel installation
uki Install UKIs to ESP/EFI/Linux for EFI stub booting and/or bootloaders with support for auto-discovering UKIs
ukify Build an UKI with systemd's ukify on each kernel installation

Systemd's kernel-install

To select this installation method, enable the systemd USE flag or set SYSTEMD_KERNEL_INSTALL=1 in the environment.

FILE /etc/portage/package.use/installkernel
sys-kernel/installkernel systemd
root #emerge --ask sys-kernel/installkernel

Or

FILE /etc/env.d/99systemd-kernel-install
SYSTEMD_KERNEL_INSTALL=1
root #env-update
Tip
Systemd's kernel-install can not only install kernels (kernel-install add), it can also handle kernel removal (kernel-install remove). If kernel-install is installed it will automatically be called by eclean-kernel.

Configuration

Configuration of kernel-install is done in /etc/kernel/install.conf and /usr/lib/kernel/install.conf, where the former takes precedence over the latter. Three configuration options can be set:

FILE /etc/kernel/install.conf
layout=
initrd_generator=
uki_generator=

The default /usr/lib/kernel/install.conf configuration file is provided by sys-kernel/installkernel. Of course the configuration may also be changed manually in /etc/kernel/install.conf.

Warning
/etc/kernel/install.conf overrides /usr/lib/kernel/install.conf as a whole! When /etc/kernel/install.conf exists all settings in /usr/lib/kernel/install.conf are ignored. Therefore, when the intention is to only override one setting, the user must also copy the other settings which should not be overridden from /usr/lib/kernel/install.conf to /etc/kernel/install.conf.

layout

Upstream systemd supports the Boot Loader Specification type 1 (layout=bls) and type 2 (layout=uki) layout. The type 1 layout is used by systemd-boot, the type 2 layout is intended to be used for Unified Kernel Images and is supported by GRUB, systemd-boot and refind.

Gentoo also supports a more traditional layout intended for use with GRUB (layout=grub), which is very similar (but not identical) to the layout used by Debian's installkernel as described above. This layout may also be used in other cases where a more basic and traditional layout is desired. To use GRUB in combination with Unified Kernel Images, use the uki layout instead.

When the grub, systemd-boot, efistub, and uki USE flags are all disabled, the kernels will be installed in a layout that is mostly backwards compatible with Debian's installkernel (layout=compat).

When multiple layout-specifying flags are enabled, the uki layout (enabled by the uki USE flag) takes precedence over the bls layout (enabled by the systemd-boot USE flag), which in turn takes precedence over the grub layout (enabled by the grub USE flag).

An overview of each layout is shown in the sections below:

compat

The compat layout is very similar, but not identical, to the layout used by Debian's traditional installkernel:

CODE compat layout
/boot/initramfs-x.y.z-gentoo-dist.img          # If USE=dracut (or other initramfs generator)
/boot/kernel-x.y.z-gentoo-dist
efistub

The efistub layout is identical to the compat layout, but relocated to the EFI system partition for EFI stub booting. The kernel image gains the .efi suffix as some firmware vendors enforce this:

CODE efistub layout
/${ESP}/EFI/Gentoo/initramfs-x.y.z-gentoo-dist.img      # If USE=dracut (or other initramfs generator)
/${ESP}/EFI/Gentoo/kernel-x.y.z-gentoo-dist.efi
Warning
Whether or not (automated) EFI stub booting works is highly dependent on the UEFI vendor. This is considered an advanced and experimental feature.
grub

The grub layout is identical to the compat layout, with an added grub.cfg, used by GRUB:

CODE grub layout
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img           # If USE=dracut (or other initramfs generator)
/boot/kernel-x.y.z-gentoo-dist
bls

The Bootloader Specification Type 1 or bls layout, used by systemd-boot:

CODE bls layout
/${ESP}/gentoo/x.y.z-gentoo-dist/initrd          # If USE=dracut (or other initramfs generator)
/${ESP}/gentoo/x.y.z-gentoo-dist/linux                       
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf
uki

The Bootloader Specification Type 2 or uki layout:

CODE uki layout
/boot/grub/grub.cfg                               # If USE=grub

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

initrd_generator

This setting controls which plugin should be used to generate the initramfs. Currently the only package that installs such a plugin is Dracut from sys-kernel/dracut. This setting is exposed to the plugins as ${KERNEL_INSTALL_INITRD_GENERATOR}. When the dracut USE flag is enabled, this setting is automatically set to dracut. Otherwise this setting is automatically set to none.

uki_generator

This setting controls which plugin should be used to generate the Unified Kernel Image. Currently two packages provide such a plugin: sys-kernel/dracut and systemd (via the ukify flag on sys-apps/systemd and sys-apps/systemd-utils). This setting is exposed to the plugins as ${KERNEL_INSTALL_UKI_GENERATOR} When the ukify USE flag is enabled, this setting is automatically set to ukify. When the ukify USE flag is disabled, but the dracut and uki USE flags are enabled, this setting is automatically set to dracut. Otherwise this setting is automatically set to none.

kernel-install commands

Below an overview is provided of the available commands in systemd's kernel-install.

kernel-install add

(Re-)installs a kernel version. This command is called by sys-kernel/installkernel if the systemd USE flag is enabled.

root #kernel-install [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE...]

kernel-install remove

Uninstalls a kernel version. This command is called by app-admin/eclean-kernel if it is available.

root #kernel-install [OPTIONS...] remove KERNEL-VERSION

kernel-install inspect

Prints an overview of parameters that will be used when installing a kernel version.

root #kernel-install [OPTIONS...] inspect [KERNEL-VERSION] [KERNEL-IMAGE] [INITRD-FILE...]

kernel-install list

Prints an overview of all installed kernel versions. Meaning all kernel versions for which a directory is present in /lib/modules.

root #kernel-install [OPTIONS...] list

kernel-install add-all

(Re-)installs all kernel versions. Iterates kernel-install add over each kernel for which a vmlinuz file is present in the associated /lib/modules directory.

root #kernel-install [OPTIONS...] add-all

Runtime overrides

When the dracut and ukify plugins are enabled (i.e. the dracut and/or ukify USE flags are enabled) they may be skipped at runtime by overriding the default configuration provided by sys-kernel/installkernel at /usr/lib/kernel/install.conf with a custom configuration at /etc/kernel/install.conf. This may be useful on systems that have both the distribution kernels installed and manually configured kernels where the former enforces the enablement of the dracut USE flag but the latter might not require an initramfs at all.

For example:

FILE /etc/kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none

Note that this override will apply to all installed kernels. It is also possible to specify several different configurations and switch between them at runtime using the KERNEL_INSTALL_CONF_ROOT environment variable.

For example:

FILE /etc/manual-kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none
root #KERNEL_INSTALL_CONF_ROOT=/etc/manual-kernel make install

Another method of overriding the default kernel installation is to use the KERNEL_INSTALL_PLUGINS environment variable. When this variable is set, only the specified plugins are run.

For example

root #KERNEL_INSTALL_PLUGINS="90-compat.install 90-loaderentry.install 90-uki-copy.install" make install

Customization

Custom plugins, which for example, generate a initramfs or UKI, or update the bootloader configuration, may be installed into /etc/kernel/install.d. An initramfs plugin should install a file named initrd on the ${KERNEL_INSTALL_STAGING_AREA}. A UKI plugin should install a file named uki.efi in the ${KERNEL_INSTALL_STAGING_AREA}. All plugin files must have the .install suffix. Plugins in /etc/kernel/install.d override default plugins in /usr/lib/kernel/install.d with the same name.

Descriptions of plugin scripts

In exection order, the install.d plugins

/usr/lib/kernel/install.d/00-00machineid-directory.install
Create the ENTRY_DIR_ABS directory where kernels will be installed for systemd-boot.
Installed by: sys-kernel/installkernel
Executed if: layout=bls and kernel-install command is add
/usr/lib/kernel/install.d/10-copy-prebuilt.install
Copy prebuilt initramfs and Unified Kernel Image to the staging area if they exist. A prebuilt initramfs and Unified Kernel Image are present when the distribution kernels are installed with the generic-uki USE flag enabled.
Installed by: sys-kernel/installkernel
Executed if: kernel-install command is add
/usr/lib/kernel/install.d/35-amd-microcode-systemd.install
Builds an AMD CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
Installed by: sys-kernel/linux-firmware if the initramfs is enabled.
Executed if: kernel-install command is add and initrd_generator!=dracut.
/usr/lib/kernel/install.d/35-intel-microcode-systemd.install
Builds an Intel CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
Installed by: sys-firmware/intel-microcode if the initramfs is enabled.
Executed if: kernel-install command is add and initrd_generator!=dracut.
/usr/lib/kernel/install.d/40-dkms.install
Automatically rebuild kernel modules registered with DKMS on kernel installation, and clean them up on kernel removal.
Installed by: sys-kernel/dkms
Executed if: Always
/usr/lib/kernel/install.d/50-depmod.install
Update kernel module dependencies on kernel installation, and cleanup depmod files on kernel removal.
Installed by: sys-apps/systemd or sys-apps/systemd-utils
Executed if: Always
/usr/lib/kernel/install.d/50-dracut.install
Builds a initramfs or Unified Kernel Image (UKI) with dracut. A initramfs is built if initrd_generator=dracut. If uki_generator=dracut and not layout=bls then an UKI is built, this will be the case if the uki USE flag is enabled on sys-kernel/installkernel but the ukify USE flag is disabled.
Installed by: sys-kernel/dracut
Executed if: kernel-install command is add and initrd_generator=dracut (USE dracut) or uki_generator=dracut (USE dracut and USE uki but not USE ukify). Also executed if layout is set to an unsupported value.
/usr/lib/kernel/install.d/51-dracut-rescue.install
Build a dracut rescue initramfs image, currently not supported in combination with Unified Kernel Images.
Installed by: sys-kernel/dracut
Executed if: kernel-install command is add and dracut_rescue_image=yes in any dracut configuration file
/usr/lib/kernel/install.d/52-ugrd.install
Builds an initramfs using the ugrd initramfs generator.
Installed by: sys-kernel/ugrd
Executed if: kernel-install command is add and initrd_generator=ugrd.
/usr/lib/kernel/install.d/85-check-diskspace.install
Checks if there is enough disk space on the target partition to install the kernel.
Installed by: sys-kernel/installkernel
Executed if: Always
/usr/lib/kernel/install.d/90-compat.install
Install the staged (unified) kernel image (and initramfs) in a backwards compatibility layout similar to Debian's installkernel. And clean them up when the kernel is removed.
Installed by: sys-kernel/installkernel
Executed if: layout=compat or layout=grub
/usr/lib/kernel/install.d/90-loaderentry.install
Install the staged kernel image (and initramfs) in systemd-boot's native format and register the new kernel with systemd-boot. And clean up these files when the kernel is removed.
Installed by: sys-apps/systemd or sys-apps/systemd-utils
Executed if: layout=bls
/usr/lib/kernel/install.d/90-runlilo.install
Update LILO's configuration.
Installed by: sys-boot/lilo
Executed if: Always
/usr/lib/kernel/install.d/90-uki-copy.install
Copy the staged Unified Kernel Image to the EFI/Linux directory on the EFI System Partition. And clean it up on kernel removal. This plugin script will exit fatally if there is no UKI to install.
Installed by: sys-apps/systemd or sys-apps/systemd-utils
Executed if: layout=uki
/usr/lib/kernel/install.d/90-zz-update-static.install
Update version-less files or symlinks if they exist at the target location.
Installed by: sys-kernel/installkernel
Executed if: kernel-install command is add and layout=uki or layout=efistub or layout=compat or layout=grub
/usr/lib/kernel/install.d/91-grub-mkconfig.install
Update GRUB's configuration by running grub-mkconfig. Automatically finds Unified Kernel Images in the EFI/Linux directory on the EFI System Partition. Which grub.cfg to use is overridable with the GRUB_CFG environment variable.
Installed by: sys-kernel/installkernel with grub
Executed if: layout=uki or layout=grub
/usr/lib/kernel/install.d/91-sbctl.install
Sign the installed (unified) kernel image with sbctl's keys and add it to the sbctl database. Upon kernel removal it is removed from the database. The plugin script will exit fatally if sbctl's keys are not already setup. Note that both dracut and ukify are capable of signing generated unified kernel images by themselves and distribution kernels can already be signed using the secureboot USE flag. This plugin may be useful however for manually compiled kernels.
Installed by: app-crypt/sbctl
Executed if: Always
/usr/lib/kernel/install.d/95-efistub-kernel-bootcfg.install
Adds and removes UEFI boot entries on kernel installation or removal using kernel-bootcfg from app-emulation/virt-firmware.
Installed by: sys-kernel/installkernel with USE efistub
Executed if: layout=efistub or layout=uki
/usr/lib/kernel/install.d/95-refind-copy-icon.install
Install a Gentoo icon for the rEFInd bootloader alongside the (unified) kernel image. Which icon file to use is overridable with the REFIND_ICON environment variable.
Installed by: sys-kernel/installkernel with USE refind
Executed if: layout=uki or layout=compat
/usr/lib/kernel/install.d/99-write-log.install
Appends last installed kernel to /var/log/installkernel.log and updates state file at /var/lib/installkernel.
Installed by: sys-kernel/installkernel
Executed if: Always

Debian's installkernel

To select this installation method, disable the systemd USE flag or set SYSTEMD_KERNEL_INSTALL=0 in the environment.

FILE /etc/portage/package.use/installkernel
sys-kernel/installkernel -systemd
root #emerge --ask sys-kernel/installkernel

Or

FILE /etc/env.d/99no-systemd-kernel-install
SYSTEMD_KERNEL_INSTALL=0
root #env-update
Note
Since the traditional installkernel installs the initramfs and/or Unified Kernel Image (UKI) at the same place as the kernel image in the kernel sources tree, these files may be left-over when switching from a configuration with initramfs and/or Unified Kernel Image to one without. In this situation these files may have to be cleaned up manually from the kernel source tree to ensure they are not picked up and installed by installkernel.

Configuration

Configuration of kernel-install is done in /etc/kernel/install.conf and /usr/lib/kernel/install.conf, where the former takes precedence over the latter. Three configuration options can be set:

FILE /etc/kernel/install.conf
layout=
initrd_generator=
uki_generator=

The default /usr/lib/kernel/install.conf configuration file is provided by sys-kernel/installkernel. Of course the configuration may also be changed manually in /etc/kernel/install.conf.

Warning
/etc/kernel/install.conf overrides /usr/lib/kernel/install.conf as a whole! When /etc/kernel/install.conf exists, all settings in /usr/lib/kernel/install.conf are ignored. Therefore, when the intention is to only override one setting, the user must also copy the other settings which should not be overridden from /usr/lib/kernel/install.conf to /etc/kernel/install.conf.

layout

Debian's traditional installkernel installs the kernel and initramfs or Unified Kernel Image in a layout that looks like this:

CODE traditional layout
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg                               # If USE=grub
/boot/initramfs-x.y.z-gentoo-dist.img             # If USE=dracut (or another initramfs generator)
/boot/vmlinuz-x.y.z-gentoo-dist                   
/boot/vmlinuz-x.y.z-gentoo-dist.png               # If USE=refind
efistub

If the efistub USE flag is enabled, then the install tree is relocated to the EFI System Partition (ESP) and the kernel image gains the .efi suffix.

CODE efistub layout
/${ESP}/EFI/Gentoo/System.map-x.y.z-gentoo-dist
/${ESP}/EFI/Gentoo/config-x.y.z-gentoo-dist
/${ESP}/EFI/Gentoo/initramfs-x.y.z-gentoo-dist.img            # If USE=dracut (or another initramfs generator)
/${ESP}/EFI/Gentoo/vmlinuz-x.y.z-gentoo-dist.efi
uki

If the uki USE flag is enabled, then generated Unified Kernel Image is installed to the EFI/Linux directory on the EFI System Partition (ESP).

CODE uki layout
/boot/grub/grub.cfg                                          # If USE=grub

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png               # If USE=refind

initrd_generator

This setting controls which plugin should be used to generate the initramfs. Currently the only package that installs such a plugin is Dracut from sys-kernel/dracut. This setting is exposed to the plugins as ${INSTALLKERNEL_INITRD_GENERATOR}. When the dracut USE flag is enabled, this setting is automatically set to dracut. This setting is otherwise automatically set to none.

uki_generator

This setting controls which plugin should be used to generate the Unified Kernel Image. Currently two packages provide such a plugin: sys-kernel/dracut and systemd (via the ukify flag on sys-apps/systemd and sys-apps/systemd-utils). This setting is exposed to the plugins as ${INSTALLKERNEL_UKI_GENERATOR} When the ukify USE flag is enabled, this setting is automatically set to ukify. When the ukify USE flag is disabled, but the dracut and uki USE flags are enabled, this setting is automatically set to dracut. Otherwise this setting is automatically set to none.


Runtime overrides

When the dracut and ukify plugins are installed (i.e. the dracut and/or ukify USE flags are enabled) they may be skipped at runtime using the INSTALLKERNEL_INITRD_GENERATOR and INSTALLKERNEL_UKI_GENERATOR environment variables. This may be useful on systems that have both the distribution kernels installed and manually configured kernels where the former enforces the enabling of the dracut USE flag but the latter might not require an initramfs at all.

root #INSTALLKERNEL_INITRD_GENERATOR=none INSTALLKERNEL_UKI_GENERATOR=none make install

Alternatively, these settings may be set permanently using /etc/kernel/install.conf:

FILE /etc/kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none

Note that this override will apply to all installed kernels. It is also possible to specify several different configurations and switch between them at runtime using the INSTALLKERNEL_CONF_ROOT environment variable.

For example:

FILE /etc/manual-kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none
root #INSTALLKERNEL_CONF_ROOT=/etc/manual-kernel make install

Another method of overriding the default kernel installation is to use the INSTALLKERNEL_PREINST_PLUGINS and INSTALLKERNEL_POSTINST_PLUGINS environment variables. When these variables are set, only the specified plugins are run.

For example

root #INSTALLKERNEL_POSTINST_PLUGINS="91-grub-mkconfig.install" make install

Customization

Custom plugins, which for example, generate initramfs or Unified Kernel Image (UKI) may be installed into /etc/kernel/preinst.d. An initramfs plugin should install a file named initrd at the same location as the kernel image, and it should respect the INSTALLKERNEL_INITRD_GENERATOR environment variable. A UKI plugin should install a file named uki.efi at the same location as the kernel image and it should respect the INSTALLKERNEL_UKI_GENERATOR environment variable.

Additionally custom plugins, which for example, update the bootloader configuration may be installed in /etc/kernel/postinst.d.

Plugins in /etc/kernel/preinst.d or /etc/kernel/postinst.d override default plugins in /usr/lib/kernel/preinst.d and /usr/lib/kernel/postinst.d with the same name.

Descriptions of plugin scripts

In exection order, the preinst.d plugins

/usr/lib/kernel/preinst.d/35-amd-microcode.install
Builds an AMD CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
Installed by: sys-kernel/linux-firmware if the initramfs is enabled.
Executed if: initrd_generator!=dracut.
/usr/lib/kernel/preinst.d/35-intel-microcode.install
Builds an Intel CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
Installed by: sys-firmware/intel-microcode if the initramfs is enabled.
Executed if: initrd_generator!=dracut.
/usr/lib/kernel/preinst.d/50-dracut.install
Builds a initramfs or Unified Kernel Image (UKI) with dracut. To build a UKI instead of a initramfs, set uefi=yes in /etc/dracut.conf.
Installed by: sys-kernel/installkernel with USE dracut
Executed if: initrd_generator=dracut.
/usr/lib/kernel/preinst.d/52-ugrd.install
Builds an initramfs using the ugrd initramfs generator.
Installed by: sys-kernel/ugrd
Executed if: initrd_generator=ugrd.
/usr/lib/kernel/preinst.d/60-ukify.install
Builds a Unified Kernel Image with systemd's ukify, will include a initramfs if one was built by an earlier plugin.
Installed by: sys-kernel/installkernel with USE ukify
Executed if: uki_generator=ukify and layout=uki.
/usr/lib/kernel/preinst.d/99-check-diskspace.install
Checks if there is enough disk space on the target partition to install the kernel.
Installed by: sys-kernel/installkernel
Executed if: Always

In exection order, the postinst.d plugins

/usr/lib/kernel/postinst.d/40-dkms.install
Automatically rebuild kernel modules registered with DKMS on kernel installation.
Installed by: sys-kernel/dkms
Executed if: Always
/usr/lib/kernel/postinst.d/91-grub-mkconfig.install
Update GRUB's configuration by running grub-mkconfig. Automatically finds Unified Kernel Images in the EFI/Linux direcotry on the EFI System Partition. Which grub.cfg to use is overridable with the GRUB_CFG environment variable.
Installed by: sys-kernel/installkernel with USE grub
Executed if: Always
/usr/lib/kernel/postinst.d/95-efistub-uefi-mkconfig.install
Adds UEFI boot entries for newly installed kernels and removes entries for removed kernels using sys-boot/uefi-mkconfig.
Installed by: sys-kernel/installkernel with USE efistub
Executed if: Always
/usr/lib/kernel/postinst.d/95-refind-copy-icon.install
Install a Gentoo icon for the rEFInd bootloader alongside the (unified) kernel image. Which icon file to use is overridable with the REFIND_ICON environment variable.
Installed by: sys-kernel/installkernel with USE refind
Executed if: Always
/usr/lib/kernel/postinst.d/99-write-log.install
Appends last installed kernel to /var/log/installkernel.log and updates state file at /var/lib/installkernel.
Installed by: sys-kernel/installkernel
Executed if: Always
/usr/lib/kernel/postinst.d/90-runlilo.install
Update LILO's configuration.
Installed by: sys-boot/lilo
Executed if: Always

USE configuration to boot layout mapping

The code boxes below maps possible sys-kernel/installkernel USE configurations to how the kernel and related files will be installed. It may be useful for users who are unsure which USE configuration suits their setup. ESP refers to the mount point of the EFI System Partition which may be /efi, /boot, /boot/efi or {{Path|/boot/EFI}. generic-uki refers to the generic-uki USE flag on the Distribution kernels.

Tip
For all layouts (except for the bls type 1 layout for systemd-boot) sys-kernel/installkernel supports updating an unversioned symlink or file at the same location as the installed kernel images. For example, if the kernel images are installed as /efi/EFI/Gentoo/kernel-x.y.z-gentoo-dist.efi then /efi/EFI/Gentoo/kernel.efi will be updated every time a kernel is installed if this file or symlink exists.

Systemd kernel-install (USE=+systemd)

Layouts with GRUB

Plain kernel image installation.

CODE -generic-uki -dracut systemd -systemd-boot -uki -ukify grub -refind
/boot/grub/grub.cfg
/boot/kernel-x.y.z-gentoo-dist

Plain kernel image installation, with initramfs generated by dracut.

CODE -generic-uki dracut systemd -systemd-boot -uki -ukify grub -refind
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist

Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd -systemd-boot -uki -ukify grub -refind
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
Layouts with Unified Kernel Images

Unified kernel image installation, uki is generated with ukify and is then installed to the ESP.

CODE -generic-uki -dracut systemd -systemd-boot uki ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd -systemd-boot uki -ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd -systemd-boot uki ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd -systemd-boot uki -ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Layouts with systemd-boot

Plain kernel image installation.

CODE -generic-uki -dracut systemd systemd-boot -uki -ukify -grub -refind
/${ESP}/gentoo/x.y.z-gentoo-dist/linux
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf

Plain kernel image installation, with initramfs generated by dracut.

CODE -generic-uki dracut systemd systemd-boot -uki -ukify -grub -refind
/${ESP}/gentoo/x.y.z-gentoo-dist/initrd
/${ESP}/gentoo/x.y.z-gentoo-dist/linux
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf

Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd systemd-boot -uki -ukify -grub -refind
/${ESP}/gentoo/x.y.z-gentoo-dist/initrd
/${ESP}/gentoo/x.y.z-gentoo-dist/linux
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf
Layouts with Unified Kernel Images

Unified kernel image installation, uki is generated with ukify and is then installed to the ESP.

CODE -generic-uki -dracut systemd systemd-boot uki ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd systemd-boot uki -ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd systemd-boot uki ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd systemd-boot uki -ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Layouts with rEFInd

Plain kernel image installation with icon for rEFInd.

CODE -generic-uki -dracut systemd -systemd-boot -uki -ukify -grub refind
/boot/kernel-x.y.z-gentoo-dist
/boot/kernel-x.y.z-gentoo-dist.png

Plain kernel image installation, with a initramfs generated by dracut and icon for rEFInd.

CODE -generic-uki dracut systemd -systemd-boot -uki -ukify -grub refind
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
/boot/kernel-x.y.z-gentoo-dist.png

Plain kernel image installation with icon for rEFInd, initramfs is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd -systemd-boot -uki -ukify -grub refind
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
/boot/kernel-x.y.z-gentoo-dist.png
Layouts with Unified Kernel Images

Unified kernel image installation with icon for rEFInd, uki is generated with ukify and is then installed to the ESP.

CODE -generic-uki -dracut systemd -systemd-boot uki ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Unified kernel image installation with icon for rEFInd, uki is generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd -systemd-boot uki -ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Unified kernel image installation with icon for rEFInd, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd -systemd-boot uki ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Unified kernel image installation with icon for rEFInd, uki is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd -systemd-boot uki -ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Layouts without GRUB/systemd-boot/rEFInd (other bootloaders)

Plain kernel image installation.

CODE -generic-uki -dracut systemd -systemd-boot -uki -ukify -grub -refind
/boot/kernel-x.y.z-gentoo-dist

Plain kernel image installation, with a initramfs generated by dracut.

CODE -generic-uki dracut systemd -systemd-boot -uki -ukify -grub -refind
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist

Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd -systemd-boot -uki -ukify -grub -refind
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
Layouts with Unified Kernel Images

Unified kernel image installation, uki is generated with ukify and is then installed to the ESP.

CODE -generic-uki -dracut systemd -systemd-boot uki ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd -systemd-boot uki -ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.

CODE -generic-uki dracut systemd -systemd-boot uki ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is pregenerated by the distribution kernel package.

CODE generic-uki -dracut systemd -systemd-boot uki -ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Traditional installkernel (USE=-systemd)

Layouts with GRUB

Plain kernel image installation.

CODE -generic-uki -dracut -systemd -systemd-boot -uki -ukify grub -refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg
/boot/vmlinuz-x.y.z-gentoo-dist

Plain kernel image installation, with initramfs generated by dracut.

CODE -generic-uki dracut -systemd -systemd-boot -uki -ukify grub -refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist

Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.

CODE generic-uki -dracut -systemd -systemd-boot -uki -ukify grub -refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
Layouts with Unified Kernel Images

Unified kernel image installation, with an uki generated by dracut (uki has no effect since there is no unified kernel image).

CODE -generic-uki dracut -systemd -systemd-boot uki -ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with ukify and is then copied to the ESP.

CODE -generic-uki -dracut -systemd -systemd-boot uki ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then copied to the ESP.

CODE -generic-uki dracut -systemd -systemd-boot uki ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is pregenerated by the distribution kernel package and is then copied to the ESP.

CODE generic-uki -dracut -systemd -systemd-boot uki -ukify grub -refind
/boot/grub/grub.cfg

/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Layouts with rEFInd

Plain kernel image installation with icon for rEFInd.

CODE -generic-uki -dracut -systemd -systemd-boot -uki -ukify -grub refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist.png

Plain kernel image installation, with a initramfs generated by dracut and icon for rEFInd.

CODE -generic-uki dracut -systemd -systemd-boot -uki -ukify -grub refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist.png

Plain kernel image installation with icon for rEFInd, initramfs is pregenerated by the distribution kernel package.

CODE generic-uki -dracut -systemd -systemd-boot -uki -ukify -grub refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist.png
Layouts with Unified Kernel Images

Unified kernel image installation, with a initramfs generated by dracut.

CODE -generic-uki dracut -systemd -systemd-boot uki -ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Unified kernel image installation with icon for rEFInd, uki is generated with ukify and is then copied to the ESP.

CODE -generic-uki -dracut -systemd -systemd-boot uki ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Unified kernel image installation with icon for rEFInd, uki is generated with ukify and includes a initramfs generated with dracut and is then copied to the ESP.

CODE -generic-uki dracut -systemd -systemd-boot uki ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Unified kernel image installation with icon for rEFInd, uki is pregenerated by the distribution kernel package and is then copied to the ESP.

CODE generic-uki -dracut -systemd -systemd-boot uki -ukify -grub refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png

Layouts without GRUB/systemd-boot/rEFInd (other bootloaders)

Plain kernel image installation.

CODE -generic-uki -dracut -systemd -systemd-boot -uki -ukify -grub -refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist

Plain kernel image installation, with a initramfs generated by dracut.

CODE -generic-uki dracut -systemd -systemd-boot -uki -ukify -grub -refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist

Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.

CODE generic-uki -dracut -systemd -systemd-boot -uki -ukify -grub -refind
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
Layouts with Unified Kernel Images

Unified kernel image installation, with uki generated by dracut.

CODE -generic-uki dracut -systemd -systemd-boot uki -ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with ukify and is then copied to the ESP.

CODE -generic-uki -dracut -systemd -systemd-boot uki ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then copied to the ESP.

CODE -generic-uki dracut -systemd -systemd-boot uki ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

Unified kernel image installation, uki is pregenerated by the distribution kernel package and is then copied to the ESP.

CODE generic-uki -dracut -systemd -systemd-boot uki -ukify -grub -refind
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi

See also

  • GRUB — a multiboot secondary bootloader capable of loading kernels from a variety of filesystems on most system architectures.
  • systemd-boot — a minimal UEFI boot manager.
  • EFI stub — describes EFI stub kernels, i.e. kernels directly executable from UEFI.
  • initramfs — is used to prepare Linux systems during boot before the init process starts.
  • Project:Distribution_Kernel — aims to maintain sys-kernel/*-kernel packages.