]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/bootctl.xml
systemctl: do not fall back to StartUnit automatically for sleep operations
[thirdparty/systemd.git] / man / bootctl.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
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 -->
5
6 <refentry id="bootctl"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8 <refentryinfo>
9 <title>bootctl</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>bootctl</refentrytitle>
15 <manvolnum>1</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>bootctl</refname>
20 <refpurpose>Control EFI firmware boot settings and manage boot loader</refpurpose>
21 </refnamediv>
22
23 <refsynopsisdiv>
24 <cmdsynopsis>
25 <command>bootctl</command>
26 <arg choice="opt" rep="repeat">OPTIONS</arg>
27 <arg choice="req">COMMAND</arg>
28 </cmdsynopsis>
29 </refsynopsisdiv>
30
31 <refsect1>
32 <title>Description</title>
33
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>
38 </refsect1>
39
40 <refsect1>
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>
44
45 <variablelist>
46 <varlistentry>
47 <term><option>status</option></term>
48
49 <listitem><para>Shows brief information about the system firmware, the boot loader that was used to
50 boot the system, the boot loaders currently available in the ESP, the boot loaders listed in the
51 firmware's list of boot loaders and the current default boot loader entry. If no command is
52 specified, this is the implied default.</para>
53
54 <para>See the example below for details of the output.</para>
55
56 <xi:include href="version-info.xml" xpointer="v239"/>
57 </listitem>
58 </varlistentry>
59
60 <varlistentry>
61 <term><option>reboot-to-firmware</option> <optional><replaceable>BOOL</replaceable></optional></term>
62
63 <listitem><para>Query or set the "Reboot-Into-Firmware-Setup" flag of the EFI firmware. Takes a
64 boolean argument which controls whether to show the firmware setup on next system reboot. If the
65 argument is omitted shows the current status of the flag, or whether the flag is supported. This
66 controls the same flag as <command>systemctl reboot --firmware-setup</command>, but is more low-level
67 and allows setting the flag independently from actually requesting a reboot.</para>
68
69 <para>Hint: use <command>systemctl reboot --firmware-setup</command> to reboot into firmware setup
70 once. See
71 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
72 for details.</para>
73
74 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
75 </varlistentry>
76 </variablelist>
77 </refsect1>
78
79 <refsect1>
80 <title>Boot Loader Specification Commands</title>
81
82 <para>These commands are available for all boot loaders that
83 implement the <ulink
84 url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot
85 Loader Specification</ulink>, such as
86 <command>systemd-boot</command>.</para>
87
88 <variablelist>
89 <varlistentry>
90 <term><option>list</option></term>
91
92 <listitem><para>Shows all available boot loader entries implementing the <ulink
93 url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink>, as well as any
94 other entries discovered or automatically generated by a boot loader implementing the <ulink
95 url="https://systemd.io/BOOT_LOADER_INTERFACE">Boot Loader Interface</ulink>.
96 JSON output may be requested with <option>--json=</option>.</para>
97
98 <para>See the example below for details of the output.</para>
99
100 <xi:include href="version-info.xml" xpointer="v239"/>
101 </listitem>
102 </varlistentry>
103
104 <varlistentry>
105 <term><option>unlink</option> <replaceable>ID</replaceable></term>
106
107 <listitem><para>Removes a boot loader entry including the files it refers to. Takes a single boot
108 loader entry ID string or a glob pattern as argument. Referenced files such as kernel or initrd are
109 only removed if no other entry refers to them.</para>
110
111 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
112 </varlistentry>
113
114 <varlistentry>
115 <term><option>cleanup</option></term>
116
117 <listitem><para>Removes files from the ESP and XBOOTLDR partitions that belong to the entry token but
118 are not referenced in any boot loader entries.</para>
119
120 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
121 </varlistentry>
122 </variablelist>
123 </refsect1>
124
125 <refsect1>
126 <title>Boot Loader Interface Commands</title>
127
128 <para>These commands are available for all boot loaders that implement the <ulink
129 url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink> and the <ulink
130 url="https://systemd.io/BOOT_LOADER_INTERFACE">Boot Loader Interface</ulink>, such as
131 <command>systemd-boot</command>.</para>
132
133 <variablelist>
134 <varlistentry>
135 <term><option>set-default</option> <replaceable>ID</replaceable></term>
136 <term><option>set-oneshot</option> <replaceable>ID</replaceable></term>
137
138 <listitem><para>Sets the default boot loader entry. Takes a single boot loader entry ID string or a glob
139 pattern as argument. The <option>set-oneshot</option> command will set the default entry only for the next boot,
140 the <option>set-default</option> will set it persistently for all future boots.</para>
141
142 <para><command>bootctl list</command> can be used to list available boot loader entries and their
143 IDs.</para>
144
145 <para>In addition, the boot loader entry ID may be specified as one of: <option>@default</option>,
146 <option>@oneshot</option> or <option>@current</option>, which correspond to the current default boot loader
147 entry for all future boots, the current default boot loader entry for the next boot, and the currently booted
148 boot loader entry. These special IDs are resolved to the current values of the EFI variables
149 <varname>LoaderEntryDefault</varname>, <varname>LoaderEntryOneShot</varname> and <varname>LoaderEntrySelected</varname>,
150 see <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink> for details.
151 These special IDs are primarily useful as a quick way to persistently make the currently booted boot loader
152 entry the default choice, or to upgrade the default boot loader entry for the next boot to the default boot
153 loader entry for all future boots, but may be used for other operations too.</para>
154
155 <para>If set to <option>@saved</option> the chosen entry will be saved as an EFI variable
156 on every boot and automatically selected the next time the boot loader starts.</para>
157
158 <para>When an empty string ("") is specified as the ID, then the corresponding EFI variable will be
159 unset.</para>
160
161 <para>Hint: use <command>systemctl reboot --boot-loader-entry=<replaceable>ID</replaceable></command>
162 to reboot into a specific boot entry and
163 <command>systemctl reboot --boot-loader-menu=<replaceable>timeout</replaceable></command>
164 to reboot into the boot loader menu once. See
165 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
166 for details.</para>
167
168 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
169 </varlistentry>
170
171 <varlistentry>
172 <term><option>set-timeout</option> <replaceable>TIMEOUT</replaceable></term>
173 <term><option>set-timeout-oneshot</option> <replaceable>TIMEOUT</replaceable></term>
174
175 <listitem><para>Sets the boot loader menu timeout in seconds. The <option>set-timeout-oneshot</option>
176 command will set the timeout only for the next boot. See
177 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
178 for details about the syntax of time spans.</para>
179
180 <para>If this is set to <option>menu-disabled</option> or <option>menu-hidden</option> or
181 <option>0</option>, no menu is shown and the default entry will be booted immediately, while
182 setting this to <option>menu-force</option> disables the timeout while always showing the menu.
183 When an empty string ("") is specified the bootloader will revert to its default menu timeout.</para>
184
185 <xi:include href="version-info.xml" xpointer="v250"/></listitem>
186 </varlistentry>
187 </variablelist>
188 </refsect1>
189
190 <refsect1>
191 <title><command>systemd-boot</command> Commands</title>
192
193 <para>These commands manage the <command>systemd-boot</command> EFI boot loader, and do not work in
194 conjunction with other boot loaders.</para>
195
196 <variablelist>
197 <varlistentry>
198 <term><option>install</option></term>
199
200 <listitem><para>Installs <command>systemd-boot</command> into the EFI system partition. A copy of
201 <command>systemd-boot</command> will be stored as the EFI default/fallback loader at
202 <filename><replaceable>ESP</replaceable>/EFI/BOOT/BOOT*.EFI</filename>. The boot loader is then added
203 to the top of the firmware's boot loader list.</para>
204
205 <xi:include href="version-info.xml" xpointer="v239"/></listitem>
206 </varlistentry>
207
208 <varlistentry>
209 <term><option>update</option></term>
210
211 <listitem><para>Updates all installed versions of
212 <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>, if the
213 available version is newer than the version installed in the EFI system partition. This also includes the EFI
214 default/fallback loader at <filename><replaceable>ESP</replaceable>/EFI/BOOT/BOOT*.EFI</filename>. The boot
215 loader is then added to end of the firmware's boot loader list if missing.</para>
216
217 <xi:include href="version-info.xml" xpointer="v239"/></listitem>
218 </varlistentry>
219
220 <varlistentry>
221 <term><option>remove</option></term>
222
223 <listitem><para>Removes all installed versions of <command>systemd-boot</command> from the EFI system partition
224 and the firmware's boot loader list.</para>
225
226 <xi:include href="version-info.xml" xpointer="v239"/></listitem>
227 </varlistentry>
228
229 <varlistentry>
230 <term><option>is-installed</option></term>
231
232 <listitem><para>Checks whether <command>systemd-boot</command> is installed in the ESP. Note that a
233 single ESP might host multiple boot loaders; this hence checks whether
234 <command>systemd-boot</command> is one (of possibly many) installed boot loaders — and neither
235 whether it is the default nor whether it is registered in any EFI variables.</para>
236
237 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
238 </varlistentry>
239
240 <varlistentry>
241 <term><option>random-seed</option></term>
242
243 <listitem><para>Generates a random seed and stores it in the EFI System Partition (ESP), for use by
244 the <command>systemd-boot</command> boot loader. If a random seed already exists in the ESP it is
245 refreshed. Also generates a random 'system token' and stores it persistently as an EFI variable, if
246 one has not been set before. If the boot loader finds the random seed in the ESP and the system token
247 in the EFI variable it will derive a random seed to pass to the OS and a new seed to store in the ESP
248 from the combination of both. The random seed passed to the OS is credited to the kernel's entropy
249 pool by the system manager during early boot, and permits userspace to boot up with an entropy pool
250 fully initialized very early on. Also see
251 <citerefentry><refentrytitle>systemd-boot-random-seed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
252
253 <para>See <ulink url="https://systemd.io/RANDOM_SEEDS">Random Seeds</ulink> for further
254 information.</para>
255
256 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
257 </varlistentry>
258
259 </variablelist>
260 </refsect1>
261
262 <refsect1>
263 <title>Kernel Image Commands</title>
264
265 <variablelist>
266 <varlistentry>
267 <term><option>kernel-identify</option> <replaceable>kernel</replaceable></term>
268
269 <listitem><para>Takes a kernel image as argument. Checks what kind of kernel the image is. Returns
270 one of <literal>uki</literal>, <literal>pe</literal>, and <literal>unknown</literal>.
271 </para>
272
273 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
274 </varlistentry>
275
276 <varlistentry>
277 <term><option>kernel-inspect</option> <replaceable>kernel</replaceable></term>
278
279 <listitem><para>Takes a kernel image as argument. Prints details about the image.</para>
280
281 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
282 </varlistentry>
283 </variablelist>
284 </refsect1>
285
286 <refsect1>
287 <title>Options</title>
288 <para>The following options are understood:</para>
289
290 <variablelist>
291 <xi:include href="standard-options.xml" xpointer="esp-path"/>
292 <xi:include href="standard-options.xml" xpointer="boot-path"/>
293
294 <varlistentry>
295 <term><option>--root=<replaceable>root</replaceable></option></term>
296 <listitem><para>Takes a directory path as an argument. All
297 paths will be prefixed with the given alternate
298 <replaceable>root</replaceable> path, including config search
299 paths. </para>
300
301 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
302 </varlistentry>
303
304 <varlistentry>
305 <term><option>--image=<replaceable>image</replaceable></option></term>
306
307 <listitem><para>Takes a path to a disk image file or block device node. If specified, all operations
308 are applied to file system in the indicated disk image. This option is similar to
309 <option>--root=</option>, but operates on file systems stored in disk images or block devices. The
310 disk image should either contain just a file system or a set of file systems within a GPT partition
311 table, following the <ulink url="https://uapi-group.org/specifications/specs/discoverable_partitions_specification">Discoverable Partitions
312 Specification</ulink>. For further information on supported disk images, see
313 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
314 switch of the same name.</para>
315
316 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
317 </varlistentry>
318
319 <xi:include href="standard-options.xml" xpointer="image-policy-open" />
320
321 <varlistentry>
322 <term><option>--install-source=</option></term>
323 <listitem><para>When installing binaries with <option>--root=</option> or
324 <option>--image=</option>, selects where to source them from. Takes one of <literal>auto</literal>
325 (the default), <literal>image</literal> or <literal>host</literal>. With <literal>auto</literal>
326 binaries will be picked from the specified directory or image, and if not found they will be picked
327 from the host. With <literal>image</literal> or <literal>host</literal> no fallback search will be
328 performed if the binaries are not found in the selected source.</para>
329
330 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
331 </varlistentry>
332
333 <varlistentry>
334 <term><option>-p</option></term>
335 <term><option>--print-esp-path</option></term>
336 <listitem><para>This option modifies the behaviour of <command>status</command>. Only prints the path
337 to the EFI System Partition (ESP) to standard output and exits.</para>
338
339 <xi:include href="version-info.xml" xpointer="v236"/></listitem>
340 </varlistentry>
341
342 <varlistentry>
343 <term><option>-x</option></term>
344 <term><option>--print-boot-path</option></term>
345 <listitem><para>This option modifies the behaviour of <command>status</command>. Only prints the path
346 to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to standard
347 output and exit. This command is useful to determine where to place boot loader entries, as they are
348 preferably placed in the Extended Boot Loader partition if it exists and in the ESP otherwise.</para>
349
350 <para>Boot Loader Specification Type #1 entries should generally be placed in the directory
351 <literal>$(bootctl -x)/loader/entries/</literal>. Existence of that directory may also be used as
352 indication that boot loader entry support is available on the system. Similarly, Boot Loader
353 Specification Type #2 entries should be placed in the directory <literal>$(bootctl
354 -x)/EFI/Linux/</literal>.</para>
355
356 <para>Note that this option (similarly to the <option>--print-esp-path</option> option mentioned
357 above), is available independently from the boot loader used, i.e. also without
358 <command>systemd-boot</command> being installed.</para>
359
360 <xi:include href="version-info.xml" xpointer="v242"/></listitem>
361 </varlistentry>
362
363 <varlistentry>
364 <term><option>-R</option></term>
365 <term><option>--print-root-device</option></term>
366
367 <listitem><para>Print the path to the block device node backing the root file system of the local
368 OS. This prints a path such as <filename>/dev/nvme0n1p5</filename>. If the root file system is backed
369 by dm-crypt/LUKS or dm-verity the underlying block device is returned. If the root file system is
370 backed by multiple block devices (as supported by btrfs) the operation will fail. If the switch is
371 specified twice (i.e. <option>-RR</option>) and the discovered block device is a partition device the
372 "whole" block device it belongs to is determined and printed
373 (e.g. <filename>/dev/nvme0n1</filename>). If the root file system is <literal>tmpfs</literal> (or a
374 similar in-memory file system), the block device backing <filename>/usr/</filename> is returned if
375 applicable. If the root file system is a network file system (e.g. NFS, CIFS) the operation will
376 fail.</para>
377
378 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
379 </varlistentry>
380
381 <varlistentry>
382 <term><option>--no-variables</option></term>
383 <listitem><para>Do not touch the firmware's boot loader list stored in EFI variables.</para>
384
385 <xi:include href="version-info.xml" xpointer="v220"/></listitem>
386 </varlistentry>
387
388 <varlistentry>
389 <term><option>--graceful</option></term>
390 <listitem><para>Ignore failure when the EFI System Partition cannot be found, when EFI variables
391 cannot be written, or a different or newer boot loader is already installed. Currently only applies
392 to <command>is-installed</command>, <command>update</command>, and <command>random-seed</command>
393 verbs.</para>
394
395 <xi:include href="version-info.xml" xpointer="v244"/></listitem>
396 </varlistentry>
397
398 <varlistentry>
399 <term><option>-q</option></term>
400 <term><option>--quiet</option></term>
401
402 <listitem><para>Suppress printing of the results of various commands and also the hints about ESP
403 being unavailable.</para>
404
405 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
406 </varlistentry>
407
408 <varlistentry>
409 <term><option>--make-entry-directory=yes|no</option></term>
410 <listitem><para>Controls creation and deletion of the <ulink
411 url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink> Type #1 entry
412 directory on the file system containing resources such as kernel and initrd images during
413 <option>install</option> and <option>remove</option>, respectively. The directory is named after the
414 entry token, as specified with <option>--entry-token=</option> parameter described below, and is
415 placed immediately below the <varname>$BOOT</varname> root directory (i.e. beneath the file system
416 returned by the <option>--print-boot-path</option> option, see above). Defaults to
417 <literal>no</literal>.</para>
418
419 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
420 </varlistentry>
421
422 <varlistentry>
423 <term><option>--entry-token=</option></term>
424
425 <listitem><para>Controls how to name and identify boot loader entries for this OS
426 installation. Accepted during <option>install</option>, and takes one of <literal>auto</literal>,
427 <literal>machine-id</literal>, <literal>os-id</literal>, <literal>os-image-id</literal> or an
428 arbitrary string prefixed by <literal>literal:</literal> as argument.</para>
429
430 <para>If set to <option>machine-id</option> the entries are named after the machine ID of the running
431 system (e.g. <literal>b0e793a9baf14b5fa13ecbe84ff637ac</literal>). See
432 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
433 details about the machine ID concept and file.</para>
434
435 <para>If set to <option>os-id</option> the entries are named after the OS ID of the running system,
436 i.e. the <varname>ID=</varname> field of
437 <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry> (e.g.
438 <literal>fedora</literal>). Similarly, if set to <option>os-image-id</option> the entries are named
439 after the OS image ID of the running system, i.e. the <varname>IMAGE_ID=</varname> field of
440 <filename>os-release</filename> (e.g. <literal>vendorx-cashier-system</literal>).</para>
441
442 <para>If set to <option>auto</option> (the default), the <filename>/etc/kernel/entry-token</filename>
443 file will be read if it exists, and the stored value used. Otherwise if the local machine ID is
444 initialized it is used. Otherwise <varname>IMAGE_ID=</varname> from <filename>os-release</filename>
445 will be used, if set. Otherwise, <varname>ID=</varname> from <filename>os-release</filename> will be
446 used, if set.</para>
447
448 <para>Unless set to <literal>machine-id</literal>, or when
449 <option>--make-entry-directory=yes</option> is used the selected token string is written to a file
450 <filename>/etc/kernel/entry-token</filename>, to ensure it will be used for future entries. This file
451 is also read by
452 <citerefentry><refentrytitle>kernel-install</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
453 in order to identify under which name to generate boot loader entries for newly installed kernels, or
454 to determine the entry names for removing old ones.</para>
455
456 <para>Using the machine ID for naming the entries is generally preferable, however there are cases
457 where using the other identifiers is a good option. Specifically: if the identification data that the
458 machine ID entails shall not be stored on the (unencrypted) <varname>$BOOT</varname> partition, or if
459 the ID shall be generated on first boot and is not known when the entries are prepared. Note that
460 using the machine ID has the benefit that multiple parallel installations of the same OS can coexist
461 on the same medium, and they can update their boot loader entries independently. When using another
462 identifier (such as the OS ID or the OS image ID), parallel installations of the same OS would try to
463 use the same entry name. To support parallel installations, the installer must use a different entry
464 token when adding a second installation.</para>
465
466 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
467 </varlistentry>
468
469 <varlistentry>
470 <term><option>--all-architectures</option></term>
471 <listitem><para>Install binaries for all supported EFI architectures (this implies <option>--no-variables</option>).</para>
472
473 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
474 </varlistentry>
475
476 <varlistentry>
477 <term><option>--efi-boot-option-description=</option></term>
478 <listitem><para>Description of the entry added to the firmware's boot option list. Defaults to <literal>Linux
479 Boot Manager</literal>.</para>
480
481 <para>Using the default entry name <literal>Linux Boot Manager</literal> is generally preferable as only
482 one bootloader installed to a single ESP partition should be used to boot any number of OS installations
483 found on the various disks installed in the system. Specifically distributions should not use this flag
484 to install a branded entry in the boot option list. However in situations with multiple disks, each with
485 their own ESP partition, it can be beneficial to make it easier to identify the bootloader being used in
486 the firmware's boot option menu.</para>
487
488 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
489 </varlistentry>
490
491 <varlistentry>
492 <term><option>--dry-run</option></term>
493 <listitem><para>Dry run for <option>unlink</option> and <option>cleanup</option>.</para>
494
495 <para>In dry run mode, the unlink and cleanup operations only print the files that would get deleted
496 without actually deleting them.</para>
497
498 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
499 </varlistentry>
500
501 <xi:include href="standard-options.xml" xpointer="no-pager"/>
502 <xi:include href="standard-options.xml" xpointer="json" />
503 <xi:include href="standard-options.xml" xpointer="help"/>
504 <xi:include href="standard-options.xml" xpointer="version"/>
505 </variablelist>
506 </refsect1>
507
508 <refsect1>
509 <title>Signed .efi files</title>
510 <para><command>bootctl</command> <option>install</option> and <option>update</option> will look for a
511 <command>systemd-boot</command> file ending with the <literal>.efi.signed</literal> suffix first, and copy
512 that instead of the normal <literal>.efi</literal> file. This allows distributions or end-users to provide
513 signed images for UEFI SecureBoot.</para>
514 </refsect1>
515
516 <refsect1>
517 <title>Exit status</title>
518 <para>On success, 0 is returned, a non-zero failure code otherwise. <command>bootctl
519 --print-root-device</command> returns exit status 80 in case the root file system is not backed by single
520 block device, and other non-zero exit statuses on other errors.</para>
521 </refsect1>
522
523 <refsect1>
524 <title>Environment</title>
525 <para>If <varname>$SYSTEMD_RELAX_ESP_CHECKS=1</varname> is set the validation checks for the ESP are
526 relaxed, and the path specified with <option>--esp-path=</option> may refer to any kind of file system on
527 any kind of partition.</para>
528
529 <para>Similarly, <varname>$SYSTEMD_RELAX_XBOOTLDR_CHECKS=1</varname> turns off some validation checks for
530 the Extended Boot Loader partition.</para>
531 </refsect1>
532
533 <refsect1>
534 <title>Examples</title>
535
536 <example>
537 <title>Output from <command>status</command> and <command>list</command></title>
538
539 <programlisting>$ <command>bootctl status</command>
540 System:
541 Firmware: UEFI 2.40 (<replaceable>firmware-version</replaceable>) ← firmware vendor and version
542 Secure Boot: disabled (setup) ← Secure Boot status
543 TPM2 Support: yes
544 Boot into FW: supported ← does the firmware support booting into itself
545
546 Current Boot Loader: ← details about sd-boot or another boot loader
547 Product: systemd-boot <replaceable>version</replaceable> implementing the <ulink
548 url="https://systemd.io/BOOT_LOADER_INTERFACE">Boot Loader Interface</ulink>
549 Features: ✓ Boot counting
550 ✓ Menu timeout control
551 ✓ One-shot menu timeout control
552 ✓ Default entry control
553 ✓ One-shot entry control
554 ✓ Support for XBOOTLDR partition
555 ✓ Support for passing random seed to OS
556 ✓ Load drop-in drivers
557 ✓ Boot loader sets ESP information
558 ✓ Menu can be disabled
559 ESP: /dev/disk/by-partuuid/01234567-89ab-cdef-dead-beef00000000
560 File: └─/EFI/systemd/systemd-bootx64.efi
561
562 Random Seed: ← random seed used for entropy in early boot
563 Passed to OS: yes
564 System Token: set
565 Exists: yes
566
567 Available Boot Loaders on ESP:
568 ESP: /boot/efi (/dev/disk/by-partuuid/01234567-89ab-cdef-dead-beef00000000)
569 File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot 251
570 File: └─/EFI/BOOT/BOOTX64.EFI (systemd-boot 251
571
572 Boot Loaders Listed in EFI Variables:
573 Title: Linux Boot Manager
574 ID: 0x0001
575 Status: active, boot-order
576 Partition: /dev/disk/by-partuuid/…
577 File: └─/EFI/systemd/systemd-bootx64.efi
578
579 Title: Fedora
580 ID: 0x0000
581 Status: active, boot-order
582 Partition: /dev/disk/by-partuuid/…
583 File: └─/EFI/fedora/shimx64.efi
584
585 Title: Linux-Firmware-Updater
586 ID: 0x0002
587 Status: active, boot-order
588 Partition: /dev/disk/by-partuuid/…
589 File: └─/EFI/fedora/fwupdx64.efi
590
591 Boot Loader Entries:
592 $BOOT: /boot/efi (/dev/disk/by-partuuid/01234567-89ab-cdef-dead-beef00000000)
593
594 Default Boot Loader Entry:
595 type: Boot Loader Specification Type #1 (.conf)
596 title: Fedora Linux 36 (Workstation Edition)
597 id: …
598 source: /boot/efi/loader/entries/<replaceable>entry-token</replaceable>-<replaceable>kernel-version</replaceable>.conf
599 version: <replaceable>kernel-version</replaceable>
600 machine-id: …
601 linux: /<replaceable>entry-token</replaceable>/<replaceable>kernel-version</replaceable>/linux
602 initrd: /<replaceable>entry-token</replaceable>/<replaceable>kernel-version</replaceable>/initrd
603 options: root=…
604 </programlisting>
605
606 <programlisting>$ <command>bootctl list</command>
607 Boot Loader Entries:
608 type: Boot Loader Specification Type #1 (.conf)
609 title: Fedora Linux 36 (Workstation Edition) (default) (selected)
610 id: …
611 source: /boot/efi/loader/entries/<replaceable>entry-token</replaceable>-<replaceable>kernel-version</replaceable>.conf
612 version: <replaceable>kernel-version</replaceable>
613 machine-id: …
614 linux: /<replaceable>entry-token</replaceable>/<replaceable>kernel-version</replaceable>/linux
615 initrd: /<replaceable>entry-token</replaceable>/<replaceable>kernel-version</replaceable>/initrd
616 options: root=…
617
618 type: Boot Loader Specification Type #2 (.efi)
619 title: Fedora Linux 35 (Workstation Edition)
620 id: …
621 source: /boot/efi/EFI/Linux/fedora-<replaceable>kernel-version</replaceable>.efi
622 version: <replaceable>kernel-version</replaceable>
623 machine-id: …
624 linux: /EFI/Linux/fedora-<replaceable>kernel-version</replaceable>.efi
625 options: root=…
626
627 type: Automatic
628 title: Reboot Into Firmware Interface
629 id: auto-reboot-to-firmware-setup
630 source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
631 </programlisting>
632
633 <para>In the listing, <literal>(default)</literal> specifies the entry that will be
634 used by default, and <literal>(selected)</literal> specifies the entry that was
635 selected the last time (i.e. is currently running).</para>
636 </example>
637 </refsect1>
638
639 <refsect1>
640 <title>See Also</title>
641 <para><simplelist type="inline">
642 <member><citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
643 <member><ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink></member>
644 <member><ulink url="https://systemd.io/BOOT_LOADER_INTERFACE">Boot Loader Interface</ulink></member>
645 <member><citerefentry><refentrytitle>systemd-boot-random-seed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
646 </simplelist></para>
647 </refsect1>
648 </refentry>