]>
Commit | Line | Data |
---|---|---|
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> | |
31 | <arg choice="opt"><replaceable>KERNEL-IMAGE</replaceable></arg> | |
81516adc HH |
32 | </cmdsynopsis> |
33 | </refsynopsisdiv> | |
34 | ||
35 | <refsect1> | |
36 | <title>Description</title> | |
37 | <para> | |
38 | <command>kernel-install</command> is used to install and remove kernel and | |
39 | initramfs images to and from <filename>/boot</filename>. | |
40 | </para> | |
41 | ||
845c5324 ZJS |
42 | <para><command>kernel-install</command> will execute the files |
43 | located in the directory <filename>/usr/lib/kernel/install.d/</filename> | |
81516adc | 44 | and the local administration directory <filename>/etc/kernel/install.d/</filename>. |
845c5324 | 45 | All files are collectively sorted and executed in lexical order, regardless of the directory in |
e9dd9f95 | 46 | which they live. However, files with identical filenames replace each other. |
81516adc HH |
47 | Files in <filename>/etc/kernel/install.d/</filename> take precedence over files with the same name |
48 | in <filename>/usr/lib/kernel/install.d/</filename>. This can be used to override a system-supplied | |
49 | executables with a local file if needed; a symbolic link in <filename>/etc/kernel/install.d/</filename> | |
50 | with the same name as an executable in <filename>/usr/lib/kernel/install.d/</filename>, | |
eb933128 | 51 | pointing to <filename>/dev/null</filename>, disables the executable entirely. Executables must have the |
409dee2e | 52 | extension <literal>.install</literal>; other extensions are ignored.</para> |
81516adc | 53 | |
eb933128 ZJS |
54 | <para>An executable should return <constant>0</constant> on success. It may also |
55 | return <constant>77</constant> to cause the whole operation to terminate | |
56 | (executables later in lexical order will be skipped).</para> | |
81516adc HH |
57 | </refsect1> |
58 | ||
59 | <refsect1> | |
60 | <title>Commands</title> | |
61 | <para>The following commands are understood:</para> | |
62 | <variablelist> | |
63 | <varlistentry> | |
845c5324 | 64 | <term><command>add <replaceable>KERNEL-VERSION</replaceable> <replaceable>KERNEL-IMAGE</replaceable></command></term> |
81516adc | 65 | <listitem> |
8f51399e HH |
66 | <para><command>kernel-install</command> creates the directory |
67 | <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> | |
c4c50112 | 68 | and calls executables from |
845c5324 ZJS |
69 | <filename>/usr/lib/kernel/install.d/*.install</filename> and |
70 | <filename>/etc/kernel/install.d/*.install</filename> with | |
71 | the arguments | |
c4c50112 ZJS |
72 | <programlisting>add <replaceable>KERNEL-VERSION</replaceable> \ |
73 | <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> <replaceable>KERNEL-IMAGE</replaceable></programlisting> | |
845c5324 ZJS |
74 | </para> |
75 | ||
8f51399e HH |
76 | <para>The kernel-install plugin <filename>50-depmod.install</filename> runs depmod for the <replaceable>KERNEL-VERSION</replaceable>.</para> |
77 | ||
5ae4d543 LP |
78 | <para>The kernel-install plugin |
79 | <filename>90-loaderentry.install</filename> copies | |
845c5324 ZJS |
80 | <replaceable>KERNEL-IMAGE</replaceable> to |
81 | <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/linux</filename>. | |
5ae4d543 LP |
82 | It also creates a boot loader entry according to the boot |
83 | loader specification in | |
845c5324 | 84 | <filename>/boot/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>. |
5ae4d543 LP |
85 | The title of the entry is the |
86 | <replaceable>PRETTY_NAME</replaceable> parameter specified | |
87 | in <filename>/etc/os-release</filename> or | |
88 | <filename>/usr/lib/os-release</filename> (if the former is | |
89 | missing), or "Linux | |
90 | <replaceable>KERNEL-VERSION</replaceable>", if unset. If | |
91 | the file <filename>initrd</filename> is found next to the | |
845c5324 ZJS |
92 | <filename>linux</filename> file, the initrd will be added to |
93 | the configuration.</para> | |
81516adc HH |
94 | </listitem> |
95 | </varlistentry> | |
96 | <varlistentry> | |
8f51399e | 97 | <term><command>remove <replaceable>KERNEL-VERSION</replaceable></command></term> |
845c5324 | 98 | <listitem> |
c4c50112 | 99 | <para>Calls executables from <filename>/usr/lib/kernel/install.d/*.install</filename> |
845c5324 | 100 | and <filename>/etc/kernel/install.d/*.install</filename> with the arguments |
9fccdb0f | 101 | <programlisting>remove <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename></programlisting> |
845c5324 ZJS |
102 | </para> |
103 | ||
104 | <para><command>kernel-install</command> removes the entire directory | |
8f51399e HH |
105 | <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> afterwards.</para> |
106 | ||
107 | <para>The kernel-install plugin <filename>90-loaderentry.install</filename> removes the file | |
108 | <filename>/boot/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.</para> | |
81516adc HH |
109 | </listitem> |
110 | </varlistentry> | |
111 | ||
112 | </variablelist> | |
113 | ||
114 | </refsect1> | |
115 | ||
116 | <refsect1> | |
117 | <title>Exit status</title> | |
c4c50112 | 118 | <para>If every executable returns 0 or 77, 0 is returned, and a non-zero failure code otherwise.</para> |
81516adc HH |
119 | </refsect1> |
120 | ||
121 | <refsect1> | |
122 | <title>Files</title> | |
123 | <variablelist> | |
124 | <varlistentry> | |
125 | <term> | |
126 | <filename>/usr/lib/kernel/install.d/*.install</filename> | |
127 | <filename>/etc/kernel/install.d/*.install</filename> | |
128 | </term> | |
129 | <listitem> | |
409dee2e | 130 | <para>Drop-in files which are executed by kernel-install.</para> |
81516adc HH |
131 | </listitem> |
132 | </varlistentry> | |
2d0614d3 HH |
133 | <varlistentry> |
134 | <term> | |
135 | <filename>/etc/kernel/cmdline</filename> | |
136 | <filename>/proc/cmdline</filename> | |
137 | </term> | |
138 | <listitem> | |
7d7681f7 | 139 | <para>The content of the file <filename>/etc/kernel/cmdline</filename> specifies the kernel command line to use. |
2d0614d3 HH |
140 | If that file does not exist, <filename>/proc/cmdline</filename> is used.</para> |
141 | </listitem> | |
142 | </varlistentry> | |
143 | <varlistentry> | |
144 | <term> | |
145 | <filename>/etc/machine-id</filename> | |
146 | </term> | |
147 | <listitem> | |
845c5324 | 148 | <para>The content of the file specifies the machine identification <replaceable>MACHINE-ID</replaceable>.</para> |
2d0614d3 HH |
149 | </listitem> |
150 | </varlistentry> | |
151 | <varlistentry> | |
152 | <term> | |
153 | <filename>/etc/os-release</filename> | |
5ae4d543 | 154 | <filename>/usr/lib/os-release</filename> |
2d0614d3 HH |
155 | </term> |
156 | <listitem> | |
8f51399e | 157 | <para>The content of the file specifies the operating system title <replaceable>PRETTY_NAME</replaceable>.</para> |
2d0614d3 HH |
158 | </listitem> |
159 | </varlistentry> | |
81516adc HH |
160 | </variablelist> |
161 | </refsect1> | |
162 | ||
163 | <refsect1> | |
164 | <title>See Also</title> | |
165 | <para> | |
2d0614d3 HH |
166 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
167 | <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
a8a27374 | 168 | <ulink url="https://github.com/systemd/systemd/blob/master/docs/BOOT_LOADER_SPECIFICATION.md">Boot Loader Specification</ulink> |
81516adc HH |
169 | </para> |
170 | </refsect1> | |
171 | ||
172 | </refentry> |