# phpman > man > kernel-install(8)

[KERNEL-INSTALL(8)](https://www.chedong.com/phpMan.php/man/KERNEL-INSTALL/8/markdown)                          kernel-install                          [KERNEL-INSTALL(8)](https://www.chedong.com/phpMan.php/man/KERNEL-INSTALL/8/markdown)



## NAME
       kernel-install - Add and remove kernel and initramfs images to and from /boot

## SYNOPSIS
       **kernel-install** COMMAND [OPTIONS...] _KERNEL-VERSION_ _KERNEL-IMAGE_ [_INITRD-FILE_...]

## DESCRIPTION
       **kernel-install** is used to install and remove kernel and initramfs images to and from the boot
       loader partition, referred to as _$BOOT_ here. It will usually be one of /boot/, /efi/, or
       /boot/efi/, see below.

       **kernel-install** will execute the files located in the directory /usr/lib/kernel/install.d/ and
       the local administration directory /etc/kernel/install.d/. All files are collectively sorted
       and executed in lexical order, regardless of the directory in which they live. However, files
       with identical filenames replace each other. Files in /etc/kernel/install.d/ take precedence
       over files with the same name in /usr/lib/kernel/install.d/. This can be used to override a
       system-supplied executables with a local file if needed; a symbolic link in
       /etc/kernel/install.d/ with the same name as an executable in /usr/lib/kernel/install.d/,
       pointing to /dev/null, disables the executable entirely. Executables must have the extension
       ".install"; other extensions are ignored.

       An executable should return **0** on success. It may also return **77** to cause the whole operation
       to terminate (executables later in lexical order will be skipped).

## COMMANDS
       The following commands are understood:

       **add** _KERNEL-VERSION_ _KERNEL-IMAGE_ **[**_INITRD-FILE_ **...]**
           This command expects a kernel version string and a path to a kernel image file as
           arguments.  **kernel-install** calls the executables from /usr/lib/kernel/install.d/*.install
           and /etc/kernel/install.d/*.install with the following arguments:

               add _KERNEL-VERSION_ $BOOT/_MACHINE-ID_/_KERNEL-VERSION_/ _KERNEL-IMAGE_ [_INITRD-FILE_ ...]

           Three default plugins execute the following operations in this case:

           •   00-entry-directory.install creates the directory $BOOT/_MACHINE-ID_/_KERNEL-VERSION_/ if
               $BOOT/_MACHINE-ID_/ already exists.

           •   50-depmod.install runs [**depmod**(8)](https://www.chedong.com/phpMan.php/man/depmod/8/markdown) for the _KERNEL-VERSION_.

           •   90-loaderentry.install copies _KERNEL-IMAGE_ to $BOOT/_MACHINE-ID_/_KERNEL-VERSION_/linux.
               If an _INITRD-FILE_ is provided, it also copies _INITRD-FILE_ to
               $BOOT/_MACHINE-ID_/_KERNEL_VERSION_/_INITRD-FILE_. It also creates a boot loader entry
               according to the **Boot** **Loader** **Specification**[1] in
               $BOOT/loader/entries/_MACHINE-ID_-_KERNEL-VERSION_.conf. The title of the entry is the
               _PRETTY_NAME_ parameter specified in /etc/os-release or /usr/lib/os-release (if the
               former is missing), or "Linux _KERNEL-VERSION_", if unset.

               If the entry directory $BOOT/_MACHINE-ID_/_KERNEL-VERSION_/ does not exist, this plugin
               does nothing.

       **remove** _KERNEL-VERSION_
           This command expects a kernel version string as single argument. This calls executables
           from /usr/lib/kernel/install.d/*.install and /etc/kernel/install.d/*.install with the
           following arguments:

               remove _KERNEL-VERSION_ $BOOT/_MACHINE-ID_/_KERNEL-VERSION_/

           Afterwards, **kernel-install** removes the directory $BOOT/_MACHINE-ID_/_KERNEL-VERSION_/ and its
           contents.

           Two default plugins execute the following operations in this case:

           •   50-depmod.install removes the files generated by **depmod** for this kernel again.

           •   90-loaderentry.install removes the file
               $BOOT/loader/entries/_MACHINE-ID_-_KERNEL-VERSION_.conf.

### THE $BOOT PARTITION
       The partition where the kernels and **Boot** **Loader** **Specification**[1] snippets are located is
       called _$BOOT_.  **kernel-install** determines the location of this partition by checking /efi/,
       /boot/, and /boot/efi/ in turn. The first location where $BOOT/loader/entries/ or
       $BOOT/$MACHINE_ID/ exists is used.

## OPTIONS
       The following options are understood:

### -v --verbose
           Output additional information about operations being performed.

### -h --help
           Print a short help text and exit.

## ENVIRONMENT VARIABLES
       If **--verbose** is used, _$KERNEL_INSTALL_VERBOSE=1_ will be set for the plugins. They may output
       additional logs in this case.

## EXIT STATUS
       If every executable returns 0 or 77, 0 is returned, and a non-zero failure code otherwise.

## FILES
       /usr/lib/kernel/install.d/*.install /etc/kernel/install.d/*.install
           Drop-in files which are executed by kernel-install.

       /etc/kernel/cmdline /proc/cmdline
           Read by 90-loaderentry.install. The content of the file /etc/kernel/cmdline specifies the
           kernel command line to use. If that file does not exist, /proc/cmdline is used.

       /etc/kernel/tries
           Read by 90-loaderentry.install. If this file exists a numeric value is read from it and
           the naming of the generated entry file is slightly altered to include it as
           $BOOT/loader/entries/_MACHINE-ID_-_KERNEL-VERSION_+_TRIES_.conf. This is useful for boot
           loaders such as [**systemd-boot**(7)](https://www.chedong.com/phpMan.php/man/systemd-boot/7/markdown) which implement boot attempt counting with a counter
           embedded in the entry file name.

       /etc/machine-id
           The content of this file specifies the machine identification _MACHINE-ID_. If it cannot
           read /etc/machine-id, kernel-install will use "Linux" as the machine ID instead.

       /etc/os-release /usr/lib/os-release
           The content of the file specifies the operating system title _PRETTY_NAME_.

## SEE ALSO
       [**machine-id**(5)](https://www.chedong.com/phpMan.php/man/machine-id/5/markdown), [**os-release**(5)](https://www.chedong.com/phpMan.php/man/os-release/5/markdown), [**depmod**(8)](https://www.chedong.com/phpMan.php/man/depmod/8/markdown), [**systemd-boot**(7)](https://www.chedong.com/phpMan.php/man/systemd-boot/7/markdown), **Boot** **Loader** **Specification**[1]

## NOTES
        1. Boot Loader Specification
           <https://systemd.io/BOOT_LOADER_SPECIFICATION>



systemd 249                                                                        [KERNEL-INSTALL(8)](https://www.chedong.com/phpMan.php/man/KERNEL-INSTALL/8/markdown)
