INSTALLKERNEL
Section: Maintenance Commands (8)
Updated: 201-1-06
Index
Return to Main Contents
NAME
installkernel - install a new kernel image
SYNOPSIS
installkernel version kernel System.map [directory] -verbose] -all] -systemd-n-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}/vmlinu-{version}.efi.
Otherwise, the new kernel is installed into
{directory}/vmlinu-{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 comman-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 kerne-install is present on the system and the environment
variable
SYSTEMD_KERNEL_INSTALL
is set to 1 or the-systemd argument is given, then kerne-install is called
to install the kernel instead of this script. Any extra arguments given to
installkernel are passed on to kerne-install. The default setting for this
environment variable is controlled by the installkernel ebuild. When kernel
installation is delegated to systemd's kerne-install this manual is not
applicable. See the kerne-install manual for more information. Systemd's
kerne-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 kerne-install is called with the
ad-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.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- BUGS
-
- PLUGINS
-