2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"kernel-install" conditional='ENABLE_KERNEL_INSTALL'
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
10 <title>kernel-install
</title>
11 <productname>systemd
</productname>
15 <refentrytitle>kernel-install
</refentrytitle>
16 <manvolnum>8</manvolnum>
20 <refname>kernel-install
</refname>
21 <refpurpose>Add and remove kernel and initrd images to and from /boot
</refpurpose>
26 <command>kernel-install
</command>
27 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
28 <arg choice=
"plain">add
</arg>
29 <arg choice=
"plain"><replaceable>KERNEL-VERSION
</replaceable></arg>
30 <arg choice=
"plain"><replaceable>KERNEL-IMAGE
</replaceable></arg>
31 <arg choice=
"opt" rep=
"repeat"><replaceable>INITRD-FILE
</replaceable></arg>
34 <command>kernel-install
</command>
35 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
36 <arg choice=
"plain">add-all
</arg>
39 <command>kernel-install
</command>
40 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
41 <arg choice=
"plain">remove
</arg>
42 <arg choice=
"plain"><replaceable>KERNEL-VERSION
</replaceable></arg>
45 <command>kernel-install
</command>
46 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
47 <arg choice=
"plain">inspect
</arg>
48 <arg choice=
"opt"><replaceable>KERNEL-VERSION
</replaceable></arg>
49 <arg choice=
"opt"><replaceable>KERNEL-IMAGE
</replaceable></arg>
50 <arg choice=
"opt" rep=
"repeat"><replaceable>INITRD-FILE
</replaceable></arg>
53 <command>kernel-install
</command>
54 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
55 <arg choice=
"plain">list
</arg>
60 <title>Description
</title>
61 <para><command>kernel-install
</command> is used to install and remove kernel and initrd images
63 <para>Nowadays actually CPIO archives used as an
"initramfs", rather than
"initrd". See
64 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry> for an
67 to and from the boot loader partition, referred to as
<varname>$BOOT
</varname> here. It will usually be
68 one of
<filename>/boot/
</filename>,
<filename>/efi/
</filename>, or
<filename>/boot/efi/
</filename>, see
71 <para><command>kernel-install
</command> will run the executable files (
"plugins") located in the
72 directory
<filename>/usr/lib/kernel/install.d/
</filename> and the local administration directory
73 <filename>/etc/kernel/install.d/
</filename>. All files are collectively sorted and executed in lexical
74 order, regardless of the directory in which they live. However, files with identical filenames replace
75 each other. Files in
<filename>/etc/kernel/install.d/
</filename> take precedence over files with the
76 same name in
<filename>/usr/lib/kernel/install.d/
</filename>. This can be used to override a
77 system-supplied executables with a local file if needed; a symbolic link in
78 <filename>/etc/kernel/install.d/
</filename> with the same name as an executable in
79 <filename>/usr/lib/kernel/install.d/
</filename>, pointing to
<filename>/dev/null
</filename>, disables the
80 executable entirely. Executables must have the extension
<literal>.install
</literal>; other extensions
83 <para>An executable placed in these directories should return
<constant>0</constant> on success. It may
84 also return
<constant>77</constant> to cause the whole operation to terminate (executables later in
85 lexical order will be skipped).
</para>
89 <title>Commands
</title>
90 <para>The following commands are understood:
</para>
94 <command>add [[[
<replaceable>KERNEL-VERSION
</replaceable>]
<replaceable>KERNEL-IMAGE
</replaceable>] [
<replaceable>INITRD-FILE
</replaceable> ...]]
</command>
98 <para>This command takes a kernel version string and a path to a kernel image file as arguments. If
99 the former is omitted, specified as an empty string or as
"-" it defaults to the current kernel
100 version, i.e. the same string
<command>uname -r
</command> returns. If the latter is omitted,
101 specified as an empty string or as
"-" defaults to
102 <filename>/usr/lib/modules/
<replaceable>KERNEL_VERSION
</replaceable>/vmlinuz
</filename>. Optionally,
103 one or more initrd images may be specified as well (note that plugins might generate additional
106 <para>The executable files from
<filename>/usr/lib/kernel/install.d/*.install
</filename> and
107 <filename>/etc/kernel/install.d/*.install
</filename> (i.e. the plugins) are called with the
108 following arguments:
</para>
110 <programlisting>add
<replaceable>KERNEL-VERSION
</replaceable> <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
<replaceable>KERNEL-VERSION
</replaceable>/
</filename> <replaceable>KERNEL-IMAGE
</replaceable> \
111 [
<replaceable>INITRD-FILE
</replaceable> ...]
</programlisting>
113 <para>The third argument directly refers to the path where to place kernel images, initrd
114 images and other resources for
115 <ulink url=
"https://uapi-group.org/specifications/specs/boot_loader_specification">Boot
116 Loader Specification
</ulink> Type #
1 entries (the
"entry directory"). If other boot loader schemes
117 are used the parameter may be ignored.
</para>
119 <para>The
<replaceable>ENTRY-TOKEN
</replaceable> string is typically the machine ID and is supposed
120 to identify the local installation on the system. For details see below.
</para>
122 <para>Two default plugins execute the following operations in this case:
</para>
125 <listitem><para><command>kernel-install
</command> creates
126 <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
<replaceable>KERNEL-VERSION
</replaceable></filename>,
127 if enabled (see
<varname>$KERNEL_INSTALL_LAYOUT
</varname>).
</para></listitem>
129 <listitem><para><filename>50-depmod.install
</filename> runs
130 <citerefentry project='man-pages'
><refentrytitle>depmod
</refentrytitle><manvolnum>8</manvolnum></citerefentry> for the
131 <replaceable>KERNEL-VERSION
</replaceable>.
</para></listitem>
133 <listitem><para><filename>90-loaderentry.install
</filename> copies
134 <replaceable>KERNEL-IMAGE
</replaceable> to
135 <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
<replaceable>KERNEL-VERSION
</replaceable>/linux
</filename>.
136 If
<replaceable>INITRD-FILE
</replaceable>s are provided, it also copies them to
137 <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
<replaceable>KERNEL_VERSION
</replaceable>/
<replaceable>INITRD-FILE
</replaceable></filename>.
138 This can also be used to prepend microcode before the actual initrd. It also creates a boot loader entry according to the
<ulink
139 url=
"https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification
</ulink> (Type #
1) in
140 <filename>$BOOT/loader/entries/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>.conf
</filename>.
141 The title of the entry is the
<replaceable>PRETTY_NAME
</replaceable> parameter specified in
142 <filename>/etc/os-release
</filename> or
<filename>/usr/lib/os-release
</filename> (if the former
143 is missing), or
"Linux <replaceable>KERNEL-VERSION</replaceable>", if unset.
</para>
145 <para>If
<varname>$KERNEL_INSTALL_LAYOUT
</varname> is not
"bls", this plugin does nothing.
</para></listitem>
147 <listitem><para><filename>90-uki-copy.install
</filename> copies a file
148 <filename>uki.efi
</filename> from
<varname>$KERNEL_INSTALL_STAGING_AREA
</varname> or if it does
149 not exist the
<replaceable>KERNEL-IMAGE
</replaceable> argument, only if it has a
150 <literal>.efi
</literal> extension, to
151 <filename>$BOOT/EFI/Linux/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>.efi
</filename>.
</para>
153 <para>If
<varname>$KERNEL_INSTALL_LAYOUT
</varname> is not
"uki", this plugin does nothing.
</para></listitem>
156 <xi:include href=
"version-info.xml" xpointer=
"v198"/>
161 <command>add-all
</command>
165 <para>This is the same as
<command>add
</command> (see above), but invokes the operation iteratively
166 for every installed kernel in
<filename>/usr/lib/modules/
</filename>. This operation is only
167 supported on systems where the kernel image is installed in
168 <filename>/usr/lib/modules/
<replaceable>KERNEL-VERSION
</replaceable>/vmlinuz
</filename>.
</para>
170 <xi:include href=
"version-info.xml" xpointer=
"v255"/>
174 <term><command>remove
<replaceable>KERNEL-VERSION
</replaceable></command></term>
176 <para>This command expects a kernel version string as single argument.
</para>
178 <para>The executable files from
<filename>/usr/lib/kernel/install.d/*.install
</filename> and
179 <filename>/etc/kernel/install.d/*.install
</filename> (i.e. the plugins) are called with the
180 following arguments:
</para>
182 <programlisting>remove
<replaceable>KERNEL-VERSION
</replaceable> <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
<replaceable>KERNEL-VERSION
</replaceable>/
</filename></programlisting>
184 <para>Afterwards,
<command>kernel-install
</command> removes the entry directory
185 <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
<replaceable>KERNEL-VERSION
</replaceable>/
</filename>
186 and its contents, if it exists.
</para>
188 <para>Two default plugins execute the following operations in this case:
</para>
191 <listitem><para><filename>50-depmod.install
</filename> removes the files generated by
192 <command>depmod
</command> for this kernel again.
</para></listitem>
194 <listitem><para><filename>90-loaderentry.install
</filename> removes the file
195 <filename>$BOOT/loader/entries/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>.conf
</filename>.
198 <listitem><para><filename>90-uki-copy.install
</filename> removes the file
199 <filename>$BOOT/EFI/Linux/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>.efi
</filename>.
203 <xi:include href=
"version-info.xml" xpointer=
"v198"/>
208 <command>inspect [[[
<replaceable>KERNEL-VERSION
</replaceable>]
<replaceable>KERNEL-IMAGE
</replaceable>] [
<replaceable>INITRD-FILE
</replaceable> ...]]
</command>
211 <para>Takes the same parameters as
<command>add
</command>.
</para>
213 <para>Shows the various paths and parameters configured or auto-detected. In particular shows the
214 values of the various
<varname>$KERNEL_INSTALL_*
</varname> environment variables listed below, as
215 they would be passed to plugins. The
<option>--json
</option> option can be used to get the output
216 of this verb as a JSON object.
</para>
218 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
222 <term><command>list
</command></term>
224 <para>Shows the various installed kernels. This enumerates the subdirectories of
225 <filename>/usr/lib/modules/
</filename>, and shows whether a kernel image is installed there.
</para>
227 <xi:include href=
"version-info.xml" xpointer=
"v255"/>
234 <title>Compatibility with the kernel build system
</title>
237 <command>installkernel
</command>
238 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
239 <arg choice=
"plain">VERSION
</arg>
240 <arg choice=
"plain">VMLINUZ
</arg>
241 <arg choice=
"opt">MAP
</arg>
242 <arg choice=
"opt">INSTALLATION-DIR
</arg>
245 <para>When invoked as
<command>installkernel
</command>, this program accepts arguments as specified by
246 the kernel build system's
<command>make install
</command> command. The
<parameter>VERSION
</parameter> and
247 <parameter>VMLINUZ
</parameter> parameters specify the kernel version and the kernel binary. The other two
248 parameters (
<parameter>MAP
</parameter> and
<parameter>INSTALLATION-DIR
</parameter>) are currently
254 <title>The
<varname>$BOOT
</varname> partition
</title>
256 <para>The partition where the kernels and
<ulink url=
"https://uapi-group.org/specifications/specs/boot_loader_specification">Boot
257 Loader Specification
</ulink> snippets are located is called
<varname>$BOOT
</varname>.
258 <command>kernel-install
</command> determines the location of this partition by checking
259 <filename>/efi/
</filename>,
<filename>/boot/
</filename>, and
<filename>/boot/efi/
</filename> in turn. The
260 first location where
<filename>$BOOT/loader/entries/
</filename> or
261 <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
</filename> exists is used.
</para>
265 <title>Options
</title>
266 <para>The following options are understood:
</para>
269 <xi:include href=
"standard-options.xml" xpointer=
"esp-path"/>
270 <xi:include href=
"standard-options.xml" xpointer=
"boot-path"/>
273 <term><option>--make-entry-directory=yes|no|auto
</option></term>
275 <para>Controls creation and deletion of the
276 <ulink url=
"https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification
</ulink>
277 Type #
1 entry directory on the file system containing resources such as kernel and initrd images
278 during
<option>add
</option> and
<option>remove
</option>, respectively. The directory is named after
279 the entry token, and is placed immediately below the boot root directory. When
280 <literal>auto
</literal>, the directory is created or removed only when the install layout is
281 <literal>bls
</literal>. Defaults to
<literal>auto
</literal>.
</para>
283 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
288 <term><option>--entry-token=
</option></term>
291 <para>Controls how to name and identify boot loader entries for this kernel installation or
292 deletion. Takes one of
<literal>auto
</literal>,
<literal>machine-id
</literal>,
293 <literal>os-id
</literal>,
<literal>os-image-id
</literal>, or an arbitrary string prefixed by
294 <literal>literal:
</literal> as argument.
</para>
296 <para>If set to
<option>machine-id
</option> the entries are named after the machine ID of the
297 running system (e.g.
<literal>b0e793a9baf14b5fa13ecbe84ff637ac
</literal>). See
298 <citerefentry><refentrytitle>machine-id
</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
299 details about the machine ID concept and file.
</para>
301 <para>If set to
<option>os-id
</option> the entries are named after the OS ID of the running system,
302 i.e. the
<varname>ID=
</varname> field of
303 <citerefentry><refentrytitle>os-release
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
304 (e.g.
<literal>fedora
</literal>). Similarly, if set to
<option>os-image-id
</option> the entries are
305 named after the OS image ID of the running system, i.e. the
<varname>IMAGE_ID=
</varname> field of
306 <filename>os-release
</filename> (e.g.
<literal>vendorx-cashier-system
</literal>).
</para>
308 <para>If set to
<option>auto
</option> (the default), the
309 <filename>/etc/kernel/entry-token
</filename> (or
310 <filename>$KERNEL_INSTALL_CONF_ROOT/entry-token
</filename>) file will be read if it exists, and the
311 stored value used. Otherwise if the local machine ID is initialized it is used. Otherwise
312 <varname>IMAGE_ID=
</varname> from
<filename>os-release
</filename> will be used, if set. Otherwise,
313 <varname>ID=
</varname> from
<filename>os-release
</filename> will be used, if set. Otherwise a
314 randomly generated machine ID is used.
</para>
316 <para>Using the machine ID for naming the entries is generally preferable, however there are cases
317 where using the other identifiers is a good option. Specifically: if the identification data that
318 the machine ID entails shall not be stored on the (unencrypted)
<varname>$BOOT_ROOT
</varname>
319 partition, or if the ID shall be generated on first boot and is not known when the entries are
320 prepared. Note that using the machine ID has the benefit that multiple parallel installations of
321 the same OS can coexist on the same medium, and they can update their boot loader entries
322 independently. When using another identifier (such as the OS ID or the OS image ID), parallel
323 installations of the same OS would try to use the same entry name. To support parallel
324 installations, the installer must use a different entry token when adding a second installation.
327 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
332 <term><option>-v
</option></term>
333 <term><option>--verbose
</option></term>
335 <para>Output additional information about operations being performed.
</para>
337 <xi:include href=
"version-info.xml" xpointer=
"v242"/>
342 <term><option>--root=
<replaceable>root
</replaceable></option></term>
344 <listitem><para>Takes a directory path as an argument. All paths will be prefixed with the given
345 alternate
<replaceable>root
</replaceable> path, including config search paths. This is useful to
346 operate on a system image mounted to the specified directory instead of the host system
349 <xi:include href=
"version-info.xml" xpointer=
"v255"/></listitem>
353 <term><option>--image=
<replaceable>image
</replaceable></option></term>
355 <listitem><para>Takes a path to a disk image file or block device node. If specified, all operations
356 are applied to the file system in the indicated disk image. This option is similar to
357 <option>--root=
</option>, but operates on file systems stored in disk images or block devices. The
358 disk image should either contain just a file system or a set of file systems within a GPT partition
359 table, following the
<ulink url=
"https://uapi-group.org/specifications/specs/discoverable_partitions_specification">Discoverable Partitions
360 Specification
</ulink>. For further information on supported disk images, see
361 <citerefentry><refentrytitle>systemd-nspawn
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
362 switch of the same name.
</para>
364 <xi:include href=
"version-info.xml" xpointer=
"v255"/></listitem>
367 <xi:include href=
"standard-options.xml" xpointer=
"help" />
368 <xi:include href=
"standard-options.xml" xpointer=
"version" />
369 <xi:include href=
"standard-options.xml" xpointer=
"no-pager"/>
370 <xi:include href=
"standard-options.xml" xpointer=
"json" />
371 <xi:include href=
"standard-options.xml" xpointer=
"image-policy-open" />
372 <xi:include href=
"standard-options.xml" xpointer=
"no-legend"/>
377 <title>Environment variables
</title>
380 <title>Environment variables exported for plugins
</title>
382 <para>If
<option>--verbose
</option> is used,
<varname>$KERNEL_INSTALL_VERBOSE=
1</varname> will be
383 exported for plugins. They may output additional logs in this case.
</para>
385 <para><varname>$KERNEL_INSTALL_IMAGE_TYPE=uki|pe|unknown
</varname> is set for the plugins to specify the
386 type of the kernel image.
</para>
392 <para>Unified kernel image.
</para>
394 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
400 <para>PE binary.
</para>
402 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
408 <para>Unknown type.
</para>
410 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
415 <para><varname>$KERNEL_INSTALL_MACHINE_ID
</varname> is set for the plugins to the desired machine-id to
416 use. It's always a
128-bit ID. Normally it's read from
<filename>/etc/machine-id
</filename>, but it can
417 also be overridden via
<varname>$MACHINE_ID
</varname> (see below). If not specified via these methods,
418 a fallback value will generated by
<command>kernel-install
</command> and used only for a single
421 <para><varname>$KERNEL_INSTALL_ENTRY_TOKEN
</varname> is set for the plugins to the desired entry
422 "token" to use. It's an identifier that shall be used to identify the local installation, and is often
423 the machine ID, i.e. same as
<varname>$KERNEL_INSTALL_MACHINE_ID
</varname>, but might also be a
424 different type of identifier, for example a fixed string or the
<varname>ID=
</varname>,
425 <varname>IMAGE_ID=
</varname> values from
<filename>/etc/os-release
</filename>. The string passed here
426 will be used to name Boot Loader Specification entries, or the directories the kernel image and initial
427 RAM disk images are placed into.
</para>
429 <para>Note that while
<varname>$KERNEL_INSTALL_ENTRY_TOKEN
</varname> and
430 <varname>$KERNEL_INSTALL_MACHINE_ID
</varname> are often set to the same value, the latter is guaranteed
431 to be a valid
32 character ID in lowercase hexadecimals while the former can be any short string. The
432 entry token to use is read from
<filename>/etc/kernel/entry-token
</filename>, if it exists. Otherwise a
433 few possible candidates below
<varname>$BOOT
</varname> are checked for Boot Loader Specification Type
1
434 entry directories, and if found the entry token is derived from that. If that is not successful,
435 <varname>$KERNEL_INSTALL_MACHINE_ID
</varname> is used as fallback.
</para>
437 <para><varname>$KERNEL_INSTALL_BOOT_ROOT
</varname> is set for the plugins to the absolute path of the
438 root directory (mount point, usually) of the hierarchy where boot loader entries, kernel images, and
439 associated resources should be placed. This usually is the path where the XBOOTLDR partition or the ESP
440 (EFI System Partition) are mounted, and also conceptually referred to as
<varname>$BOOT
</varname>. Can
441 be overridden by setting
<varname>$BOOT_ROOT
</varname> (see below).
</para>
443 <para><varname>$KERNEL_INSTALL_LAYOUT=auto|bls|uki|other|...
</varname> is set for the plugins to specify the
444 installation layout. Additional layout names may be defined by convention. If a plugin uses a special layout,
445 it's encouraged to declare its own layout name and configure
<varname>layout=
</varname> in
446 <filename>install.conf
</filename> upon initial installation. The following values are currently
453 <para>Standard
<ulink url=
"https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader
454 Specification
</ulink> Type #
1 layout, compatible with
455 <citerefentry><refentrytitle>systemd-boot
</refentrytitle><manvolnum>7</manvolnum></citerefentry>:
457 <filename>$BOOT/loader/entries/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>[+
<replaceable>TRIES
</replaceable>].conf
</filename>,
458 kernel and initrds under
459 <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable>/
<replaceable>KERNEL-VERSION
</replaceable>/
</filename></para>
460 <para>Implemented by
<filename>90-loaderentry.install
</filename>.
</para>
462 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
468 <para>Standard
<ulink
469 url=
"https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader
470 Specification
</ulink> Type #
2 layout, compatible with
471 <citerefentry><refentrytitle>systemd-boot
</refentrytitle><manvolnum>7</manvolnum></citerefentry>:
472 unified kernel images under
<filename>$BOOT/EFI/Linux
</filename> as
473 <filename>$BOOT/EFI/Linux/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>[+
<replaceable>TRIES
</replaceable>].efi
</filename>.
</para>
474 <para>Implemented by
<filename>90-uki-copy.install
</filename>.
</para>
476 <xi:include href=
"version-info.xml" xpointer=
"v253"/>
482 <para>Some other layout not understood natively by
<command>kernel-install
</command>.
</para>
484 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
490 <para>Pick the layout automatically. If the kernel is a UKI set layout to
491 <option>uki
</option>. If not default to
<option>bls
</option> if
492 <filename>$BOOT/loader/entries.srel
</filename> with content
<literal>type1
</literal> or
493 <filename>$BOOT/
<replaceable>ENTRY-TOKEN
</replaceable></filename> exists, or
494 <option>other
</option> otherwise.
</para>
495 <para>Leaving layout blank has the same effect. This is the default.
</para>
497 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
502 <para><varname>$KERNEL_INSTALL_INITRD_GENERATOR
</varname> and
<varname>$KERNEL_INSTALL_UKI_GENERATOR
</varname>
503 are set for plugins to select the initrd and/or UKI generator. This may be configured as
504 <varname>initrd_generator=
</varname> and
<varname>uki_generator=
</varname> in
<filename>install.conf
</filename>, see below.
</para>
506 <para><varname>$KERNEL_INSTALL_STAGING_AREA
</varname> is set for plugins to a path to a directory.
507 Plugins may drop files in that directory, and they will be installed as part of the loader entry, based
508 on the file name and extension: Files named
<filename>initrd*
</filename> will be installed as
<replaceable>INITRD-FILE
</replaceable>s,
509 and files named
<filename>microcode*
</filename> will be prepended before
<replaceable>INITRD-FILE
</replaceable>s.
</para>
514 <title>Environment variables understood by
<command>kernel-install
</command></title>
516 <para><varname>$KERNEL_INSTALL_CONF_ROOT
</varname> can be set to override the location of the
517 configuration files read by
<command>kernel-install
</command>. When set,
518 <filename>install.conf
</filename>,
<filename>entry-token
</filename>, and other files will be read from
519 this directory only. Note that this path is relative to the host, and in particular
<emphasis>symlinks
520 in this directory are resolved relative to the host
</emphasis>, even if
521 <option>--root=
<replaceable>root
</replaceable></option> is used. This means that it is generally
522 <emphasis>not
</emphasis> correct to use this variable to specify a directory underneath
523 <replaceable>root
</replaceable> if symlinks are used there.
</para>
525 <para><varname>$KERNEL_INSTALL_PLUGINS
</varname> can be set to override the list of plugins executed by
526 <command>kernel-install
</command>. The argument is a whitespace-separated list of paths.
527 <literal>KERNEL_INSTALL_PLUGINS=:
</literal> may be used to prevent any plugins from running.
530 <para><varname>$MACHINE_ID
</varname> can be set for
<command>kernel-install
</command> to override
531 <varname>$KERNEL_INSTALL_MACHINE_ID
</varname>, the machine ID.
</para>
533 <para><varname>$BOOT_ROOT
</varname> can be set for
<command>kernel-install
</command> to override
534 <varname>$KERNEL_INSTALL_BOOT_ROOT
</varname>, the installation location for boot entries.
</para>
536 <para>The last two variables may also be set in
<filename>install.conf
</filename>. Variables set in the
537 environment take precedence over the values specified in the config file.
</para>
542 <title>Exit status
</title>
543 <para>If every executable returns
0 or
77,
0 is returned, and a non-zero failure code otherwise.
</para>
550 <term><filename>/etc/kernel/install.d/*.install
</filename></term>
551 <term><filename>/usr/lib/kernel/install.d/*.install
</filename></term>
553 <para>Drop-in files which are executed by
<command>kernel-install
</command>.
</para>
555 <xi:include href=
"version-info.xml" xpointer=
"v198"/>
560 <term><filename>/etc/kernel/cmdline
</filename></term>
561 <term><filename>/usr/lib/kernel/cmdline
</filename></term>
562 <term><filename>/proc/cmdline
</filename></term>
564 <para>Specifies the kernel command line to use. The first of the files that is found will be used.
565 <varname>$KERNEL_INSTALL_CONF_ROOT
</varname> may be used to override the search path; see below for
568 <xi:include href=
"version-info.xml" xpointer=
"v198"/>
573 <term><filename>/etc/kernel/devicetree
</filename></term>
574 <term><filename>/usr/lib/kernel/devicetree
</filename></term>
576 <para>Specifies the partial path to the file containing the device tree blob to install with the
577 kernel and use at boot. The first of the files that is found will be used.
578 <varname>$KERNEL_INSTALL_CONF_ROOT
</varname> may be used to override the search path; see below for
581 <para>The
<filename>devicetree
</filename> file contains a path, and this path specifies a location
582 relative to the kernel install tree. A set of locations is checked, including in particular
583 <filename>/usr/lib/modules/
<replaceable>KERNEL_VERSION
</replaceable>/dtb/
</filename>, which is the
584 recommended location to place the dtb files under. For example, with
585 <literal>broadcom/bcm2711-rpi-
4-b.dtb
</literal> in the
<filename>devicetree
</filename> file, the
586 device tree blob for the Raspberry Pi
4 Model B would be installed, and the actual file would be
587 <filename index='false'
>/usr/lib/modules/
<replaceable>KERNEL_VERSION
</replaceable>/dtb/broadcom/bcm2711-rpi-
4-b.dtb
</filename>.
590 <xi:include href=
"version-info.xml" xpointer=
"v255"/>
595 <term><filename>/etc/kernel/tries
</filename></term>
597 <para>Read by
<filename>90-loaderentry.install
</filename> and
598 <filename>90-uki-copy.install
</filename>. If this file exists, a numeric value is read from it and
599 the naming of the generated entry file or UKI is altered to include it as
600 <filename>$BOOT/loader/entries/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>+
<replaceable>TRIES
</replaceable>.conf
</filename>
602 <filename>$BOOT/EFI/Linux/
<replaceable>ENTRY-TOKEN
</replaceable>-
<replaceable>KERNEL-VERSION
</replaceable>+
<replaceable>TRIES
</replaceable>.efi
</filename>,
603 respectively. This is useful for boot loaders such as
604 <citerefentry><refentrytitle>systemd-boot
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
605 which implement boot attempt counting with a counter embedded in the entry file name.
606 <varname>$KERNEL_INSTALL_CONF_ROOT
</varname> may be used to override the search path; see below for
609 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
614 <term><filename>/etc/kernel/entry-token
</filename></term>
616 <para>If this file exists it is read and used as
"entry token" for this system, i.e. is used for
617 naming Boot Loader Specification entries. See
<varname>$KERNEL_INSTALL_ENTRY_TOKEN
</varname> above
618 for details.
<varname>$KERNEL_INSTALL_CONF_ROOT
</varname> may be used to override the search path; see
619 below for details.
</para>
621 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
627 <filename>/etc/machine-id
</filename>
630 <para>The content of this file specifies the machine identification
631 <replaceable>MACHINE-ID
</replaceable>.
</para>
633 <xi:include href=
"version-info.xml" xpointer=
"v198"/>
638 <term><filename>/etc/os-release
</filename></term>
639 <term><filename>/usr/lib/os-release
</filename></term>
641 <para>Read by
<filename>90-loaderentry.install
</filename>. If available,
642 <varname>PRETTY_NAME=
</varname> is read from these files and used as the title of the boot menu
643 entry. Otherwise,
<literal>Linux
<replaceable>KERNEL-VERSION
</replaceable></literal> will be
646 <xi:include href=
"version-info.xml" xpointer=
"v198"/>
650 <term><filename>/etc/kernel/install.conf
</filename></term>
651 <term><filename>/run/kernel/install.conf
</filename></term>
652 <term><filename>/usr/local/lib/kernel/install.conf
</filename></term>
653 <term><filename>/usr/lib/kernel/install.conf
</filename></term>
654 <term><filename>/etc/kernel/install.conf.d/*.conf
</filename></term>
655 <term><filename>/run/kernel/install.conf.d/*.conf
</filename></term>
656 <term><filename>/usr/local/lib/kernel/install.conf.d/*.conf
</filename></term>
657 <term><filename>/usr/lib/kernel/install.conf.d/*.conf
</filename></term>
659 <para>Configuration file with options for
<command>kernel-install
</command>, as a series of
660 <varname>KEY=
</varname><replaceable>VALUE
</replaceable> assignments, compatible with shell syntax,
661 following the same rules as described in
662 <citerefentry><refentrytitle>os-release
</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
663 first of the files that is found will be used.
<varname>$KERNEL_INSTALL_CONF_ROOT
</varname> may be
664 used to override the search path; see below for details. Drop-in files may also be used
665 to extend the configuration with overrides, see
666 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
669 <para>Currently, the following keys are supported:
670 <varname>MACHINE_ID=
</varname>,
671 <varname>BOOT_ROOT=
</varname>,
672 <varname>layout=
</varname>,
673 <varname>initrd_generator=
</varname>,
674 <varname>uki_generator=
</varname>.
675 See the Environment variables section above for details.
</para>
677 <xi:include href=
"version-info.xml" xpointer=
"v250"/>
681 <term><filename>/etc/kernel/uki.conf
</filename></term>
683 <para>Ini-style configuration file for
684 <citerefentry><refentrytitle>ukify
</refentrytitle><manvolnum>1</manvolnum></citerefentry> which is
685 only effective when
<varname>$KERNEL_INSTALL_LAYOUT
</varname> or
<varname>layout=
</varname> in
686 <filename>install.conf
</filename> is set to
<option>uki
</option> and
687 <varname>$KERNEL_INSTALL_UKI_GENERATOR
</varname> or
<varname>uki_generator=
</varname> in
688 <filename>install.conf
</filename> is set to
<option>ukify
</option>, or is unset.
689 <varname>$KERNEL_INSTALL_CONF_ROOT
</varname> may be used to override the search path; see below for
692 <xi:include href=
"version-info.xml" xpointer=
"v255"/>
697 <term><filename>/usr/lib/modules/
<replaceable>KERNEL-VERSION/
</replaceable></filename></term>
700 <para>Location for installed kernel modules and other kernel related resources. For each locally
701 installed kernel a directory named after the kernel version (
<command>uname -r
</command>) is
704 <xi:include href=
"version-info.xml" xpointer=
"v255"/>
709 <term><filename>/usr/lib/modules/
<replaceable>KERNEL-VERSION/vmlinuz
</replaceable></filename></term>
712 <para>Location for installed kernel images. This is the recommended location for OS package
713 managers to install kernel images into (as applicable), from which
<command>kernel-install
714 add
</command> then copies it into the final boot partition.
</para>
716 <xi:include href=
"version-info.xml" xpointer=
"v255"/>
722 <para>For various cases listed above, if the
<varname>$KERNEL_INSTALL_CONF_ROOT
</varname> environment
723 variable is set, it will override the search path. The files will be loaded
<emphasis>only
</emphasis>
724 from the directory specified by the environment variable. When the variable is not set, the listed paths
725 are tried in turn, and the first file that exists is used.
</para>
729 <title>See Also
</title>
730 <para><simplelist type=
"inline">
731 <member><citerefentry><refentrytitle>machine-id
</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
732 <member><citerefentry><refentrytitle>os-release
</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
733 <member><citerefentry project='man-pages'
><refentrytitle>depmod
</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
734 <member><citerefentry><refentrytitle>systemd-boot
</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
735 <member><citerefentry><refentrytitle>ukify
</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
736 <member><ulink url=
"https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification
</ulink></member>