]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/kernel-install.xml
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / man / kernel-install.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
81516adc 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
81516adc
HH
4
5<!--
572eb058 6 SPDX-License-Identifier: LGPL-2.1+
81516adc
HH
7-->
8
9<refentry id="kernel-install">
10
11 <refentryinfo>
12 <title>kernel-install</title>
13 <productname>systemd</productname>
81516adc
HH
14 </refentryinfo>
15
16 <refmeta>
17 <refentrytitle>kernel-install</refentrytitle>
18 <manvolnum>8</manvolnum>
19 </refmeta>
20
21 <refnamediv>
22 <refname>kernel-install</refname>
23 <refpurpose>Add and remove kernel and initramfs images to and from /boot</refpurpose>
24 </refnamediv>
25
26 <refsynopsisdiv>
27 <cmdsynopsis>
845c5324
ZJS
28 <command>kernel-install</command>
29 <arg choice="plain">COMMAND</arg>
30 <arg choice="plain"><replaceable>KERNEL-VERSION</replaceable></arg>
04ca4d19 31 <arg choice="plain"><replaceable>KERNEL-IMAGE</replaceable></arg>
0912c0b8 32 <arg choice="opt" rep="repeat"><replaceable>INITRD-FILE</replaceable></arg>
81516adc
HH
33 </cmdsynopsis>
34 </refsynopsisdiv>
35
36 <refsect1>
37 <title>Description</title>
38 <para>
39 <command>kernel-install</command> is used to install and remove kernel and
40 initramfs images to and from <filename>/boot</filename>.
41 </para>
42
845c5324
ZJS
43 <para><command>kernel-install</command> will execute the files
44 located in the directory <filename>/usr/lib/kernel/install.d/</filename>
81516adc 45 and the local administration directory <filename>/etc/kernel/install.d/</filename>.
845c5324 46 All files are collectively sorted and executed in lexical order, regardless of the directory in
e9dd9f95 47 which they live. However, files with identical filenames replace each other.
81516adc
HH
48 Files in <filename>/etc/kernel/install.d/</filename> take precedence over files with the same name
49 in <filename>/usr/lib/kernel/install.d/</filename>. This can be used to override a system-supplied
50 executables with a local file if needed; a symbolic link in <filename>/etc/kernel/install.d/</filename>
51 with the same name as an executable in <filename>/usr/lib/kernel/install.d/</filename>,
eb933128 52 pointing to <filename>/dev/null</filename>, disables the executable entirely. Executables must have the
409dee2e 53 extension <literal>.install</literal>; other extensions are ignored.</para>
81516adc 54
eb933128
ZJS
55 <para>An executable should return <constant>0</constant> on success. It may also
56 return <constant>77</constant> to cause the whole operation to terminate
57 (executables later in lexical order will be skipped).</para>
81516adc
HH
58 </refsect1>
59
60 <refsect1>
61 <title>Commands</title>
62 <para>The following commands are understood:</para>
63 <variablelist>
64 <varlistentry>
0912c0b8 65 <term><command>add <replaceable>KERNEL-VERSION</replaceable> <replaceable>KERNEL-IMAGE</replaceable> [<replaceable>INITRD-FILE</replaceable> ...]</command></term>
81516adc 66 <listitem>
4b2d80bb
LP
67 <para>This command expects a kernel version string and a path to a kernel image file as
68 arguments. <command>kernel-install</command> creates the directory
8f51399e 69 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
4b2d80bb
LP
70 and calls the executables from <filename>/usr/lib/kernel/install.d/*.install</filename> and
71 <filename>/etc/kernel/install.d/*.install</filename> with the following arguments:
72
0912c0b8 73 <programlisting>add <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> <replaceable>KERNEL-IMAGE</replaceable> [<replaceable>INITRD-FILE</replaceable> ...]</programlisting>
845c5324
ZJS
74 </para>
75
4b2d80bb
LP
76 <para>Two default plugins execute the following operations in this case:</para>
77
78 <itemizedlist>
79
80 <listitem><para><filename>50-depmod.install</filename> runs
81 <citerefentry><refentrytitle>depmod</refentrytitle><manvolnum>8</manvolnum></citerefentry> for the
82 <replaceable>KERNEL-VERSION</replaceable>.</para></listitem>
83
84 <listitem><para><filename>90-loaderentry.install</filename> copies <replaceable>KERNEL-IMAGE</replaceable>
85 to
86 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/linux</filename>.
0912c0b8 87 If an <replaceable>INITRD-FILE</replaceable> is provided, it also copies <replaceable>INITRD-FILE</replaceable>
04ca4d19 88 to
0912c0b8 89 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL_VERSION</replaceable>/<replaceable>INITRD-FILE</replaceable></filename>.
4b2d80bb
LP
90 It also creates a boot loader entry according to the <ulink
91 url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink> in
92 <filename>/boot/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
93 The title of the entry is the <replaceable>PRETTY_NAME</replaceable> parameter specified in
94 <filename>/etc/os-release</filename> or <filename>/usr/lib/os-release</filename> (if the former is
04ca4d19 95 missing), or "Linux <replaceable>KERNEL-VERSION</replaceable>", if unset.</para></listitem>
4b2d80bb 96 </itemizedlist>
81516adc
HH
97 </listitem>
98 </varlistentry>
99 <varlistentry>
8f51399e 100 <term><command>remove <replaceable>KERNEL-VERSION</replaceable></command></term>
845c5324 101 <listitem>
4b2d80bb
LP
102 <para>This command expects a kernel version string as single argument. This calls executables from
103 <filename>/usr/lib/kernel/install.d/*.install</filename> and
104 <filename>/etc/kernel/install.d/*.install</filename> with the following arguments:
105
9fccdb0f 106 <programlisting>remove <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename></programlisting>
845c5324
ZJS
107 </para>
108
4b2d80bb
LP
109 <para>Afterwards, <command>kernel-install</command> removes the directory
110 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
111 and its contents.</para>
112
113 <para>Two default plugins execute the following operations in this case:</para>
114
115 <itemizedlist>
116
117 <listitem><para><filename>50-depmod.install</filename> removes the files generated by <command>depmod</command> for this kernel again.</para></listitem>
118
119 <listitem><para><filename>90-loaderentry.install</filename> removes the file
120 <filename>/boot/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.</para></listitem>
121 </itemizedlist>
8f51399e 122
81516adc
HH
123 </listitem>
124 </varlistentry>
125
126 </variablelist>
127
128 </refsect1>
129
130 <refsect1>
131 <title>Exit status</title>
c4c50112 132 <para>If every executable returns 0 or 77, 0 is returned, and a non-zero failure code otherwise.</para>
81516adc
HH
133 </refsect1>
134
135 <refsect1>
136 <title>Files</title>
137 <variablelist>
138 <varlistentry>
139 <term>
140 <filename>/usr/lib/kernel/install.d/*.install</filename>
141 <filename>/etc/kernel/install.d/*.install</filename>
142 </term>
143 <listitem>
409dee2e 144 <para>Drop-in files which are executed by kernel-install.</para>
81516adc
HH
145 </listitem>
146 </varlistentry>
2d0614d3
HH
147 <varlistentry>
148 <term>
149 <filename>/etc/kernel/cmdline</filename>
150 <filename>/proc/cmdline</filename>
151 </term>
152 <listitem>
4b2d80bb
LP
153 <para>Read by <filename>90-loaderentry.install</filename>. The content of the file
154 <filename>/etc/kernel/cmdline</filename> specifies the kernel command line to use. If that file does not
155 exist, <filename>/proc/cmdline</filename> is used.</para>
156 </listitem>
157 </varlistentry>
158 <varlistentry>
159 <term>
160 <filename>/etc/kernel/tries</filename>
161 </term>
162 <listitem>
163 <para>Read by <filename>90-loaderentry.install</filename>. If this file exists a numeric value is read from
164 it and the naming of the generated entry file is slightly altered to include it as
165 <filename>/boot/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>+<replaceable>TRIES</replaceable>.conf</filename>. This
166 is useful for boot loaders such as
167 <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry> which
168 implement boot attempt counting with a counter embedded in the entry file name.</para>
2d0614d3
HH
169 </listitem>
170 </varlistentry>
171 <varlistentry>
172 <term>
173 <filename>/etc/machine-id</filename>
174 </term>
175 <listitem>
845c5324 176 <para>The content of the file specifies the machine identification <replaceable>MACHINE-ID</replaceable>.</para>
2d0614d3
HH
177 </listitem>
178 </varlistentry>
179 <varlistentry>
180 <term>
181 <filename>/etc/os-release</filename>
5ae4d543 182 <filename>/usr/lib/os-release</filename>
2d0614d3
HH
183 </term>
184 <listitem>
8f51399e 185 <para>The content of the file specifies the operating system title <replaceable>PRETTY_NAME</replaceable>.</para>
2d0614d3
HH
186 </listitem>
187 </varlistentry>
81516adc
HH
188 </variablelist>
189 </refsect1>
190
191 <refsect1>
192 <title>See Also</title>
193 <para>
2d0614d3
HH
194 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
195 <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
4b2d80bb
LP
196 <citerefentry><refentrytitle>depmod</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
197 <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
a0848495 198 <ulink url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink>
81516adc
HH
199 </para>
200 </refsect1>
201
202</refentry>