1KERNEL-INSTALL(8) kernel-install KERNEL-INSTALL(8)
2
3
4
6 kernel-install - Add and remove kernel and initramfs images to and from
7 /boot
8
10 kernel-install COMMAND [OPTIONS...] KERNEL-VERSION KERNEL-IMAGE
11 [INITRD-FILE...]
12
14 kernel-install is used to install and remove kernel and initramfs
15 images to and from the boot loader partition, referred to as $BOOT
16 here. It will usually be one of /boot/, /efi/, or /boot/efi/, see
17 below.
18
19 kernel-install will execute the files located in the directory
20 /usr/lib/kernel/install.d/ and the local administration directory
21 /etc/kernel/install.d/. All files are collectively sorted and executed
22 in lexical order, regardless of the directory in which they live.
23 However, files with identical filenames replace each other. Files in
24 /etc/kernel/install.d/ take precedence over files with the same name in
25 /usr/lib/kernel/install.d/. This can be used to override a
26 system-supplied executables with a local file if needed; a symbolic
27 link in /etc/kernel/install.d/ with the same name as an executable in
28 /usr/lib/kernel/install.d/, pointing to /dev/null, disables the
29 executable entirely. Executables must have the extension ".install";
30 other extensions are ignored.
31
32 An executable should return 0 on success. It may also return 77 to
33 cause the whole operation to terminate (executables later in lexical
34 order will be skipped).
35
37 The following commands are understood:
38
39 add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE ...]
40 This command expects a kernel version string and a path to a kernel
41 image file as arguments. kernel-install calls the executables from
42 /usr/lib/kernel/install.d/*.install and
43 /etc/kernel/install.d/*.install with the following arguments:
44
45 add KERNEL-VERSION $BOOT/MACHINE-ID/KERNEL-VERSION/ KERNEL-IMAGE [INITRD-FILE ...]
46
47 Three default plugins execute the following operations in this
48 case:
49
50 • 00-entry-directory.install creates the directory
51 $BOOT/MACHINE-ID/KERNEL-VERSION/ if $BOOT/MACHINE-ID/ already
52 exists.
53
54 • 50-depmod.install runs depmod(8) for the KERNEL-VERSION.
55
56 • 90-loaderentry.install copies KERNEL-IMAGE to
57 $BOOT/MACHINE-ID/KERNEL-VERSION/linux. If an INITRD-FILE is
58 provided, it also copies INITRD-FILE to
59 $BOOT/MACHINE-ID/KERNEL_VERSION/INITRD-FILE. It also creates a
60 boot loader entry according to the Boot Loader Specification[1]
61 in $BOOT/loader/entries/MACHINE-ID-KERNEL-VERSION.conf. The
62 title of the entry is the PRETTY_NAME parameter specified in
63 /etc/os-release or /usr/lib/os-release (if the former is
64 missing), or "Linux KERNEL-VERSION", if unset.
65
66 If the entry directory $BOOT/MACHINE-ID/KERNEL-VERSION/ does
67 not exist, this plugin does nothing.
68
69 remove KERNEL-VERSION
70 This command expects a kernel version string as single argument.
71 This calls executables from /usr/lib/kernel/install.d/*.install and
72 /etc/kernel/install.d/*.install with the following arguments:
73
74 remove KERNEL-VERSION $BOOT/MACHINE-ID/KERNEL-VERSION/
75
76 Afterwards, kernel-install removes the directory
77 $BOOT/MACHINE-ID/KERNEL-VERSION/ and its contents.
78
79 Two default plugins execute the following operations in this case:
80
81 • 50-depmod.install removes the files generated by depmod for
82 this kernel again.
83
84 • 90-loaderentry.install removes the file
85 $BOOT/loader/entries/MACHINE-ID-KERNEL-VERSION.conf.
86
88 The partition where the kernels and Boot Loader Specification[1]
89 snippets are located is called $BOOT. kernel-install determines the
90 location of this partition by checking /efi/, /boot/, and /boot/efi/ in
91 turn. The first location where $BOOT/loader/entries/ or
92 $BOOT/$MACHINE_ID/ exists is used.
93
95 The following options are understood:
96
97 -v, --verbose
98 Output additional information about operations being performed.
99
100 -h, --help
101 Print a short help text and exit.
102
104 If --verbose is used, $KERNEL_INSTALL_VERBOSE=1 will be set for the
105 plugins. They may output additional logs in this case.
106
108 If every executable returns 0 or 77, 0 is returned, and a non-zero
109 failure code otherwise.
110
112 /usr/lib/kernel/install.d/*.install /etc/kernel/install.d/*.install
113 Drop-in files which are executed by kernel-install.
114
115 /etc/kernel/cmdline /proc/cmdline
116 Read by 90-loaderentry.install. The content of the file
117 /etc/kernel/cmdline specifies the kernel command line to use. If
118 that file does not exist, /proc/cmdline is used.
119
120 /etc/kernel/tries
121 Read by 90-loaderentry.install. If this file exists a numeric value
122 is read from it and the naming of the generated entry file is
123 slightly altered to include it as
124 $BOOT/loader/entries/MACHINE-ID-KERNEL-VERSION+TRIES.conf. This is
125 useful for boot loaders such as systemd-boot(7) which implement
126 boot attempt counting with a counter embedded in the entry file
127 name.
128
129 /etc/machine-id
130 The content of this file specifies the machine identification
131 MACHINE-ID. If it cannot read /etc/machine-id, kernel-install will
132 use "Linux" as the machine ID instead.
133
134 /etc/os-release /usr/lib/os-release
135 The content of the file specifies the operating system title
136 PRETTY_NAME.
137
139 machine-id(5), os-release(5), depmod(8), systemd-boot(7), Boot Loader
140 Specification[1]
141
143 1. Boot Loader Specification
144 https://systemd.io/BOOT_LOADER_SPECIFICATION
145
146
147
148systemd 249 KERNEL-INSTALL(8)