]>
Commit | Line | Data |
---|---|---|
1bc64d77 | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
3a54a157 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
0307f791 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1+ --> |
1bc64d77 | 5 | |
dfdebb1b | 6 | <refentry id="bootctl" conditional='ENABLE_EFI' |
798d3a52 | 7 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
798d3a52 ZJS |
8 | <refentryinfo> |
9 | <title>bootctl</title> | |
10 | <productname>systemd</productname> | |
798d3a52 ZJS |
11 | </refentryinfo> |
12 | ||
13 | <refmeta> | |
14 | <refentrytitle>bootctl</refentrytitle> | |
15 | <manvolnum>1</manvolnum> | |
16 | </refmeta> | |
17 | ||
18 | <refnamediv> | |
19 | <refname>bootctl</refname> | |
64a7fcc5 | 20 | <refpurpose>Control EFI firmware boot settings and manage boot loader</refpurpose> |
798d3a52 ZJS |
21 | </refnamediv> |
22 | ||
23 | <refsynopsisdiv> | |
24 | <cmdsynopsis> | |
c779b82a YW |
25 | <command>bootctl</command> |
26 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
27 | <arg choice="req">COMMAND</arg> | |
798d3a52 ZJS |
28 | </cmdsynopsis> |
29 | </refsynopsisdiv> | |
30 | ||
31 | <refsect1> | |
32 | <title>Description</title> | |
33 | ||
64a7fcc5 LP |
34 | <para><command>bootctl</command> can check the EFI firmware and boot loader status, list and manage |
35 | available boot loaders and boot loader entries, and install, update, or remove the | |
36 | <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry> boot | |
37 | loader on the current system.</para> | |
798d3a52 ZJS |
38 | </refsect1> |
39 | ||
c779b82a | 40 | <refsect1> |
64a7fcc5 LP |
41 | <title>Generic EFI Firmware/Boot Loader Commands</title> |
42 | ||
43 | <para>These commands are available on any EFI system, regardless of the boot loader used.</para> | |
c779b82a | 44 | |
64a7fcc5 | 45 | <variablelist> |
c779b82a YW |
46 | <varlistentry> |
47 | <term><option>status</option></term> | |
48 | ||
4eb5636b LP |
49 | <listitem><para>Shows brief information about the system firmware, the boot loader that was used to boot the |
50 | system, the boot loaders currently available in the ESP, the boot loaders listed in the firmware's list of boot | |
51 | loaders and the current default boot loader entry. If no command is specified, this is the implied | |
52 | default.</para></listitem> | |
c779b82a | 53 | </varlistentry> |
64a7fcc5 LP |
54 | </variablelist> |
55 | ||
56 | <varlistentry> | |
57 | <term><option>reboot-to-firmware</option> <optional><replaceable>BOOL</replaceable></optional></term> | |
58 | ||
59 | <listitem><para>Query or set the "Reboot-Into-Firmware-Setup" flag of the EFI firmware. Takes a | |
60 | boolean argument which controls whether to show the firmware setup on next system reboot. If the | |
61 | argument is omitted shows the current status of the flag, or whether the flag is supported. This | |
62 | controls the same flag as <command>systemctl reboot --firmware-setup</command>, but is more | |
63 | low-level and allows setting the flag independently from actually requesting a | |
64 | reboot.</para></listitem> | |
65 | </varlistentry> | |
66 | ||
67 | <varlistentry> | |
68 | <term><option>systemd-efi-options</option> <optional><replaceable>STRING</replaceable></optional></term> | |
69 | ||
70 | <listitem><para>When called without the optional argument, prints the current value of the | |
71 | <literal>SystemdOptions</literal> EFI variable. When called with an argument, sets the | |
72 | variable to that value. See | |
73 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
74 | for the meaning of that variable.</para></listitem> | |
75 | </varlistentry> | |
76 | </refsect1> | |
77 | ||
78 | <refsect1> | |
79 | <title>Boot Loader Specification Commands</title> | |
80 | ||
81 | <para>These commands are available for all boot loaders that implement the <ulink | |
82 | url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink> and/or the <ulink | |
83 | url="https://systemd.io/BOOT_LOADER_INTERFACE">Boot Loader Interface</ulink>, such as | |
84 | <command>systemd-boot</command>.</para> | |
85 | ||
86 | <variablelist> | |
c779b82a | 87 | |
64a7fcc5 LP |
88 | <varlistentry> |
89 | <term><option>list</option></term> | |
90 | ||
91 | <listitem><para>Shows all available boot loader entries implementing the <ulink | |
92 | url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink>, as well as any | |
93 | other entries discovered or automatically generated by a boot loader implementing the <ulink | |
94 | url="https://systemd.io/BOOT_LOADER_INTERFACE">Boot Loader | |
95 | Interface</ulink>.</para></listitem> | |
96 | </varlistentry> | |
97 | ||
98 | <varlistentry> | |
99 | <term><option>set-default</option> <replaceable>ID</replaceable></term> | |
100 | <term><option>set-oneshot</option> <replaceable>ID</replaceable></term> | |
101 | ||
102 | <listitem><para>Sets the default boot loader entry. Takes a single boot loader entry ID string as | |
103 | argument. The <option>set-oneshot</option> command will set the default entry only for the next boot, | |
104 | the <option>set-default</option> will set it persistently for all future boots.</para></listitem> | |
c4b84347 ДГ |
105 | |
106 | <listitem><para>Optionally, the boot loader entry ID may be specified as one of: <option>@default</option>, | |
107 | <option>@oneshot</option> or <option>@current</option>, which correspond to the current default boot loader | |
108 | entry for all future boots, the current default boot loader entry for the next boot, and the currently booted | |
109 | boot loader entry. These special IDs are resolved to the current values of the EFI variables | |
110 | <varname>LoaderEntryDefault</varname>, <varname>LoaderEntryOneShot</varname> and <varname>LoaderEntrySelected</varname>, | |
111 | see <ulink url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink> for details. | |
112 | These special IDs are primarily useful as a quick way to persistently make the currently booted boot loader | |
113 | entry the default choice, or to upgrade the default boot loader entry for the next boot to the default boot | |
114 | loader entry for all future boots, but may be used for other operations too. | |
115 | </para></listitem> | |
64a7fcc5 LP |
116 | </varlistentry> |
117 | ||
118 | </variablelist> | |
119 | </refsect1> | |
120 | ||
121 | <refsect1> | |
122 | <title><command>systemd-boot</command> Commands</title> | |
123 | ||
124 | <para>These commands manage the <command>systemd-boot</command> EFI boot loader, and do not work in | |
125 | conjunction with other boot loaders.</para> | |
126 | ||
127 | <variablelist> | |
c779b82a | 128 | <varlistentry> |
4eb5636b | 129 | <term><option>install</option></term> |
c779b82a | 130 | |
3da2b703 LP |
131 | <listitem><para>Installs <command>systemd-boot</command> into the EFI system partition. A copy of |
132 | <command>systemd-boot</command> will be stored as the EFI default/fallback loader at | |
133 | <filename><replaceable>ESP</replaceable>/EFI/BOOT/BOOT*.EFI</filename>. The boot loader is then added | |
134 | to the top of the firmware's boot loader list.</para></listitem> | |
c779b82a YW |
135 | </varlistentry> |
136 | ||
137 | <varlistentry> | |
4eb5636b | 138 | <term><option>update</option></term> |
c779b82a | 139 | |
4eb5636b LP |
140 | <listitem><para>Updates all installed versions of |
141 | <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>, if the | |
142 | available version is newer than the version installed in the EFI system partition. This also includes the EFI | |
143 | default/fallback loader at <filename><replaceable>ESP</replaceable>/EFI/BOOT/BOOT*.EFI</filename>. The boot | |
144 | loader is then added to end of the firmware's boot loader list if missing.</para></listitem> | |
c779b82a YW |
145 | </varlistentry> |
146 | ||
147 | <varlistentry> | |
148 | <term><option>remove</option></term> | |
149 | ||
4eb5636b LP |
150 | <listitem><para>Removes all installed versions of <command>systemd-boot</command> from the EFI system partition |
151 | and the firmware's boot loader list.</para></listitem> | |
c779b82a YW |
152 | </varlistentry> |
153 | ||
4e5aa791 ZJS |
154 | <varlistentry> |
155 | <term><option>is-installed</option></term> | |
156 | ||
157 | <listitem><para>Checks whether <command>systemd-boot</command> is installed in the ESP. Note that a | |
158 | single ESP might host multiple boot loaders; this hence checks whether | |
159 | <command>systemd-boot</command> is one (of possibly many) installed boot loaders — and neither | |
160 | whether it is the default nor whether it is registered in any EFI variables.</para></listitem> | |
161 | </varlistentry> | |
162 | ||
39867bb9 LP |
163 | <varlistentry> |
164 | <term><option>random-seed</option></term> | |
165 | ||
166 | <listitem><para>Generates a random seed and stores it in the EFI System Partition, for use by the | |
167 | <command>systemd-boot</command> boot loader. Also, generates a random 'system token' and stores it | |
168 | persistently as an EFI variable, if one has not been set before. If the boot loader finds the random | |
169 | seed in the ESP and the system token in the EFI variable it will derive a random seed to pass to the | |
170 | OS and a new seed to store in the ESP from the combination of both. The random seed passed to the OS | |
171 | is credited to the kernel's entropy pool by the system manager during early boot, and permits | |
172 | userspace to boot up with an entropy pool fully initialized very early on. Also see | |
93f59100 LP |
173 | <citerefentry><refentrytitle>systemd-boot-system-token.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para> |
174 | ||
175 | <para>See <ulink url="https://systemd.io/RANDOM_SEEDS">Random Seeds</ulink> for further | |
176 | information.</para></listitem> | |
39867bb9 LP |
177 | </varlistentry> |
178 | ||
c779b82a YW |
179 | </variablelist> |
180 | </refsect1> | |
181 | ||
e1fac8a6 ZJS |
182 | <refsect1> |
183 | <title>Options</title> | |
184 | <para>The following options are understood:</para> | |
185 | ||
186 | <variablelist> | |
187 | <varlistentry> | |
188 | <term><option>--esp-path=</option></term> | |
189 | <listitem><para>Path to the EFI System Partition (ESP). If not specified, <filename>/efi/</filename>, | |
190 | <filename>/boot/</filename>, and <filename>/boot/efi/</filename> are checked in turn. It is | |
191 | recommended to mount the ESP to <filename>/efi/</filename>, if possible.</para></listitem> | |
192 | </varlistentry> | |
193 | ||
194 | <varlistentry> | |
195 | <term><option>--boot-path=</option></term> | |
196 | <listitem><para>Path to the Extended Boot Loader partition, as defined in the <ulink | |
197 | url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink>. If not | |
198 | specified, <filename>/boot/</filename> is checked. It is recommended to mount the Extended Boot | |
199 | Loader partition to <filename>/boot/</filename>, if possible.</para></listitem> | |
200 | </varlistentry> | |
201 | ||
202 | <varlistentry> | |
203 | <term><option>-p</option></term> | |
204 | <term><option>--print-esp-path</option></term> | |
205 | <listitem><para>This option modifies the behaviour of <command>status</command>. Only prints the path | |
206 | to the EFI System Partition (ESP) to standard output and exits.</para></listitem> | |
207 | </varlistentry> | |
208 | ||
209 | <varlistentry> | |
210 | <term><option>-x</option></term> | |
211 | <term><option>--print-boot-path</option></term> | |
212 | <listitem><para>This option modifies the behaviour of <command>status</command>. Only prints the path | |
213 | to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to standard | |
214 | output and exit. This command is useful to determine where to place boot loader entries, as they are | |
215 | preferably placed in the Extended Boot Loader partition if it exists and in the ESP otherwise.</para> | |
216 | ||
217 | <para>Boot Loader Specification Type #1 entries should generally be placed in the directory | |
218 | <literal>$(bootctl -x)/loader/entries/</literal>. Existence of that directory may also be used as | |
219 | indication that boot loader entry support is available on the system. Similarly, Boot Loader | |
220 | Specification Type #2 entries should be placed in the directory <literal>$(bootctl | |
221 | -x)/EFI/Linux/</literal>.</para> | |
222 | ||
223 | <para>Note that this option (similar to the <option>--print-booth-path</option> option mentioned | |
224 | above), is available independently from the boot loader used, i.e. also without | |
225 | <command>systemd-boot</command> being installed.</para></listitem> | |
226 | </varlistentry> | |
227 | ||
228 | <varlistentry> | |
229 | <term><option>--no-variables</option></term> | |
230 | <listitem><para>Do not touch the firmware's boot loader list stored in EFI variables.</para></listitem> | |
231 | </varlistentry> | |
232 | ||
351de38e LP |
233 | <varlistentry> |
234 | <term><option>--graceful</option></term> | |
235 | <listitem><para>Ignore failure when the EFI System Partition cannot be found, or when EFI variables | |
236 | cannot be written. Currently only applies to random seed operations.</para></listitem> | |
237 | </varlistentry> | |
238 | ||
e1fac8a6 ZJS |
239 | <xi:include href="standard-options.xml" xpointer="no-pager"/> |
240 | <xi:include href="standard-options.xml" xpointer="help"/> | |
241 | <xi:include href="standard-options.xml" xpointer="version"/> | |
242 | </variablelist> | |
243 | </refsect1> | |
244 | ||
798d3a52 ZJS |
245 | <refsect1> |
246 | <title>Exit status</title> | |
c779b82a | 247 | <para>On success, 0 is returned, a non-zero failure code otherwise.</para> |
798d3a52 ZJS |
248 | </refsect1> |
249 | ||
8cbb7d87 LP |
250 | <refsect1> |
251 | <title>Environment</title> | |
3da2b703 LP |
252 | <para>If <varname>$SYSTEMD_RELAX_ESP_CHECKS=1</varname> is set the validation checks for the ESP are |
253 | relaxed, and the path specified with <option>--esp-path=</option> may refer to any kind of file system on | |
254 | any kind of partition.</para> | |
255 | ||
256 | <para>Similarly, <varname>$SYSTEMD_RELAX_XBOOTLDR_CHECKS=1</varname> turns off some validation checks for | |
257 | the Extended Boot Loader partition.</para> | |
8cbb7d87 LP |
258 | </refsect1> |
259 | ||
798d3a52 ZJS |
260 | <refsect1> |
261 | <title>See Also</title> | |
262 | <para> | |
70c8db75 | 263 | <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
a0848495 | 264 | <ulink url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink>, |
39867bb9 LP |
265 | <ulink url="https://systemd.io/BOOT_LOADER_INTERFACE">Boot Loader Interface</ulink>, |
266 | <citerefentry><refentrytitle>systemd-boot-system-token.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
798d3a52 ZJS |
267 | </para> |
268 | </refsect1> | |
1bc64d77 | 269 | </refentry> |