INSTALLKERNEL(8)

NAME
installkernel - install a new kernel image

SYNOPSIS
installkernel version zImage System.map [directory]

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 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.

If systemd's kernel-install is present on the system and the environment variable SYSTEMD_KERNEL_INSTALL is set to 1, then it is called to install the kernel. 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.

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 /usr/lib/kernel/install.conf and/or /etc/kernel/install.conf , where the latter takes precedence over the former. 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.