INSTALLKERNEL(8)

NAME
installkernel - install a new kernel image

SYNOPSIS
installkernel version kernel System.map [directory] [--verbose] [--all] [--systemd|--no-systemd]

DESCRIPTION

installkernel installs a new kernel image onto the system from the Linux source tree. It is called by the Linux kernel makefiles when make install is invoked there, and also by portage when distribution kernels are installed.

If an unified kernel image was generated, it is installed as {directory}/vmlinuz-{version}.efi. Otherwise, the new kernel is installed into {directory}/vmlinuz-{version}. If a symbolic link {directory}/vmlinuz already exists, it is refreshed by making a link from {directory}/vmlinuz to the new kernel, and the previously installed kernel is available as {directory}/vmlinuz.old.

In addition to that, System.map passed on the command-line is installed using the same logic. If the directory containing System.map contains .config or config file, it is also installed. If the directory containing the kernel image contains an initrd file, it is also installed.

Kernel installs are logged to /var/log/installkernel.log in a tab separated file containing the columns: DATE, KI_VENDOR, VERSION, CONF_ROOT, LAYOUT, INITRD_GEN, UKI_GEN, BOOT_ROOT, KERNEL_REL_PATH, INITRD_REL_PATH and PLUGIN_OVERRIDE.

When the version, kernel, and/or System.map positional arguments are not given then these values default to the currently running kernel. Meaning that version defaults to the value of uname -r and the kernel image defaults to /lib/modules/$(uname -r)/vmlinuz and the System.map defaults to /lib/modules/$(uname -r)/System.map. The fourth positional argument for the installation directory defaults to /boot.

If systemd's kernel-install is present on the system and the environment variable SYSTEMD_KERNEL_INSTALL is set to 1 or the --systemd argument is given, then kernel-install is called to install the kernel instead of this script. Any extra arguments given to installkernel are passed on to kernel-install. The default setting for this environment variable is controlled by the installkernel ebuild. When kernel installation is delegated to systemd's kernel-install this manual is not applicable. See the kernel-install manual for more information. Systemd's kernel-install supports various different layouts, the default "compat" layout is similar, but not identical, to the layout used by this installkernel. The locations of plugin scripts, as well as recognized environment variables, are also different.

The --all argument may be used to iteratively install all kernel versions found under /lib/modules. When --all is combined with --systemd then systemd's kernel-install is called with the add-all operator instead of the add operator.

BUGS
installkernel resides in /sbin only because the Linux kernel makefiles call it from there. It should really be in /usr/sbin. It isn't needed to boot a system.

PLUGINS
Custom preinst and postinst plugin scripts may be installed into /etc/kernel/preinst.d and /etc/kernel/postinst.d. Plugins provided by packages should be installed into /usr/lib/kernel/preinst.d and /usr/lib/kernel/postinst.d instead. Plugin scripts that generate an initramfs should install the generated initramfs, named "initrd", in the same location as the kernel image. Plugin scripts that generate an unified kernel image should install the generated UKI, named "uki.efi", in the same location as the kernel image. The environment variables INSTALLKERNEL_PREINST_PLUGINS and INSTALLKERNEL_POSTINST_PLUGINS may be used to provide a custom list of plugin scripts to execute

The settings

    •   layout

    •   initrd_generator

    •   uki_generator
are read from one of these locations /etc/kernel/install.conf /run/kernel/install.conf /usr/local/lib/kernel/install.conf /usr/lib/kernel/install.conf , where the first available file is used. And exposed to the plugins as:

    •   INSTALLKERNEL_LAYOUT

    •   INSTALLKERNEL_INITRD_GENERATOR

    •   INSTALLKERNEL_UKI_GENERATOR
respectively. If the environment variable INSTALLKERNEL_CONF_ROOT is set, then the install.conf at this location is used instead.

Drop-in files may also be used to partially override the settings. The syntax for drop-in files is the same as that for install.conf. However, a drop-in file need not define all these settings; it just needs to define settings that override install.conf. Each drop-in file should have filename suffix ".conf".

Drop-in files should be placed in one of these directories /etc/kernel/install.conf.d/ /run/kernel/install.conf.d/ /usr/local/lib/kernel/install.conf.d/ /usr/lib/kernel/install.conf.d/. Drop-in files in directories listed earlier override files with the same name in directories listed later. Multiple drop-in files with different names are applied in lexicographic order, regardless of which directory they reside in. If the environment variable INSTALLKERNEL_CONF_ROOT is set, then the install.conf.d directory at this location is used instead, and no other directory is used.