]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/kernel-install.xml
78d1a866f606efeb3464fda01125896d4adfd63a
[thirdparty/systemd.git] / man / kernel-install.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7
8 Copyright 2013 Harald Hoyer
9 -->
10
11 <refentry id="kernel-install">
12
13 <refentryinfo>
14 <title>kernel-install</title>
15 <productname>systemd</productname>
16
17 <authorgroup>
18 <author>
19 <contrib>Developer</contrib>
20 <firstname>Harald</firstname>
21 <surname>Hoyer</surname>
22 <email>harald@redhat.com</email>
23 </author>
24 </authorgroup>
25 </refentryinfo>
26
27 <refmeta>
28 <refentrytitle>kernel-install</refentrytitle>
29 <manvolnum>8</manvolnum>
30 </refmeta>
31
32 <refnamediv>
33 <refname>kernel-install</refname>
34 <refpurpose>Add and remove kernel and initramfs images to and from /boot</refpurpose>
35 </refnamediv>
36
37 <refsynopsisdiv>
38 <cmdsynopsis>
39 <command>kernel-install</command>
40 <arg choice="plain">COMMAND</arg>
41 <arg choice="plain"><replaceable>KERNEL-VERSION</replaceable></arg>
42 <arg choice="opt"><replaceable>KERNEL-IMAGE</replaceable></arg>
43 </cmdsynopsis>
44 </refsynopsisdiv>
45
46 <refsect1>
47 <title>Description</title>
48 <para>
49 <command>kernel-install</command> is used to install and remove kernel and
50 initramfs images to and from <filename>/boot</filename>.
51 </para>
52
53 <para><command>kernel-install</command> will execute the files
54 located in the directory <filename>/usr/lib/kernel/install.d/</filename>
55 and the local administration directory <filename>/etc/kernel/install.d/</filename>.
56 All files are collectively sorted and executed in lexical order, regardless of the directory in
57 which they live. However, files with identical filenames replace each other.
58 Files in <filename>/etc/kernel/install.d/</filename> take precedence over files with the same name
59 in <filename>/usr/lib/kernel/install.d/</filename>. This can be used to override a system-supplied
60 executables with a local file if needed; a symbolic link in <filename>/etc/kernel/install.d/</filename>
61 with the same name as an executable in <filename>/usr/lib/kernel/install.d/</filename>,
62 pointing to <filename>/dev/null</filename>, disables the executable entirely. Executables must have the
63 extension <literal>.install</literal>; other extensions are ignored.</para>
64
65 <para>An executable should return <constant>0</constant> on success. It may also
66 return <constant>77</constant> to cause the whole operation to terminate
67 (executables later in lexical order will be skipped).</para>
68 </refsect1>
69
70 <refsect1>
71 <title>Commands</title>
72 <para>The following commands are understood:</para>
73 <variablelist>
74 <varlistentry>
75 <term><command>add <replaceable>KERNEL-VERSION</replaceable> <replaceable>KERNEL-IMAGE</replaceable></command></term>
76 <listitem>
77 <para><command>kernel-install</command> creates the directory
78 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
79 and calls executables from
80 <filename>/usr/lib/kernel/install.d/*.install</filename> and
81 <filename>/etc/kernel/install.d/*.install</filename> with
82 the arguments
83 <programlisting>add <replaceable>KERNEL-VERSION</replaceable> \
84 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> <replaceable>KERNEL-IMAGE</replaceable></programlisting>
85 </para>
86
87 <para>The kernel-install plugin <filename>50-depmod.install</filename> runs depmod for the <replaceable>KERNEL-VERSION</replaceable>.</para>
88
89 <para>The kernel-install plugin
90 <filename>90-loaderentry.install</filename> copies
91 <replaceable>KERNEL-IMAGE</replaceable> to
92 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/linux</filename>.
93 It also creates a boot loader entry according to the boot
94 loader specification in
95 <filename>/boot/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
96 The title of the entry is the
97 <replaceable>PRETTY_NAME</replaceable> parameter specified
98 in <filename>/etc/os-release</filename> or
99 <filename>/usr/lib/os-release</filename> (if the former is
100 missing), or "Linux
101 <replaceable>KERNEL-VERSION</replaceable>", if unset. If
102 the file <filename>initrd</filename> is found next to the
103 <filename>linux</filename> file, the initrd will be added to
104 the configuration.</para>
105 </listitem>
106 </varlistentry>
107 <varlistentry>
108 <term><command>remove <replaceable>KERNEL-VERSION</replaceable></command></term>
109 <listitem>
110 <para>Calls executables from <filename>/usr/lib/kernel/install.d/*.install</filename>
111 and <filename>/etc/kernel/install.d/*.install</filename> with the arguments
112 <programlisting>remove <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename></programlisting>
113 </para>
114
115 <para><command>kernel-install</command> removes the entire directory
116 <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> afterwards.</para>
117
118 <para>The kernel-install plugin <filename>90-loaderentry.install</filename> removes the file
119 <filename>/boot/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.</para>
120 </listitem>
121 </varlistentry>
122
123 </variablelist>
124
125 </refsect1>
126
127 <refsect1>
128 <title>Exit status</title>
129 <para>If every executable returns 0 or 77, 0 is returned, and a non-zero failure code otherwise.</para>
130 </refsect1>
131
132 <refsect1>
133 <title>Files</title>
134 <variablelist>
135 <varlistentry>
136 <term>
137 <filename>/usr/lib/kernel/install.d/*.install</filename>
138 <filename>/etc/kernel/install.d/*.install</filename>
139 </term>
140 <listitem>
141 <para>Drop-in files which are executed by kernel-install.</para>
142 </listitem>
143 </varlistentry>
144 <varlistentry>
145 <term>
146 <filename>/etc/kernel/cmdline</filename>
147 <filename>/proc/cmdline</filename>
148 </term>
149 <listitem>
150 <para>The content of the file <filename>/etc/kernel/cmdline</filename> specifies the kernel command line to use.
151 If that file does not exist, <filename>/proc/cmdline</filename> is used.</para>
152 </listitem>
153 </varlistentry>
154 <varlistentry>
155 <term>
156 <filename>/etc/machine-id</filename>
157 </term>
158 <listitem>
159 <para>The content of the file specifies the machine identification <replaceable>MACHINE-ID</replaceable>.</para>
160 </listitem>
161 </varlistentry>
162 <varlistentry>
163 <term>
164 <filename>/etc/os-release</filename>
165 <filename>/usr/lib/os-release</filename>
166 </term>
167 <listitem>
168 <para>The content of the file specifies the operating system title <replaceable>PRETTY_NAME</replaceable>.</para>
169 </listitem>
170 </varlistentry>
171 </variablelist>
172 </refsect1>
173
174 <refsect1>
175 <title>See Also</title>
176 <para>
177 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
178 <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
179 <ulink url="https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec">Boot loader specification</ulink>
180 </para>
181 </refsect1>
182
183 </refentry>