Debian Codegraph @

upstream/debian-trixie/man7/systemd-boot.7

raw
1 '\" t
2 .TH "SYSTEMD\-BOOT" "7" "" "systemd 257.13" "systemd-boot"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-boot, sd-boot \- A simple UEFI boot manager
24 .SH "DESCRIPTION"
25 .PP
26 \fBsystemd\-boot\fR
27 (short:
28 \fBsd\-boot\fR) is a simple UEFI boot manager\&. It provides a textual menu to select the entry to boot and an editor for the kernel command line\&.
29 \fBsystemd\-boot\fR
30 supports systems with UEFI firmware only\&.
31 .PP
32 \fBsystemd\-boot\fR
33 loads boot entry information from the EFI system partition (ESP), usually mounted at
34 /efi/,
35 /boot/, or
36 /boot/efi/
37 during OS runtime, as well as from the Extended Boot Loader partition (XBOOTLDR) if it exists (usually mounted to
38 /boot/)\&. Configuration file fragments, kernels, initrds and other EFI images to boot generally need to reside on the ESP or the Extended Boot Loader partition\&. Linux kernels must be built with
39 \fBCONFIG_EFI_STUB\fR
40 to be able to be directly executed as an EFI image\&. During boot
41 \fBsystemd\-boot\fR
42 automatically assembles a list of boot entries from the following sources:
43 .sp
44 .RS 4
45 .ie n \{\
46 \h'-04'\(bu\h'+03'\c
47 .\}
48 .el \{\
49 .sp -1
50 .IP \(bu 2.3
51 .\}
52 Boot entries defined with
53 \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[1]\d\s+2
54 Type #1 description files located in
55 /loader/entries/
56 on the ESP and the Extended Boot Loader Partition\&. These usually describe Linux kernel images with associated initrd images, but alternatively may also describe other arbitrary EFI executables\&.
57 .RE
58 .sp
59 .RS 4
60 .ie n \{\
61 \h'-04'\(bu\h'+03'\c
62 .\}
63 .el \{\
64 .sp -1
65 .IP \(bu 2.3
66 .\}
67 Unified kernel images,
68 \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[1]\d\s+2
69 Type #2, which are executable EFI binaries in
70 /EFI/Linux/
71 on the ESP and the Extended Boot Loader Partition\&.
72 .RE
73 .sp
74 .RS 4
75 .ie n \{\
76 \h'-04'\(bu\h'+03'\c
77 .\}
78 .el \{\
79 .sp -1
80 .IP \(bu 2.3
81 .\}
82 The Microsoft Windows EFI boot manager, if installed\&.
83 .RE
84 .sp
85 .RS 4
86 .ie n \{\
87 \h'-04'\(bu\h'+03'\c
88 .\}
89 .el \{\
90 .sp -1
91 .IP \(bu 2.3
92 .\}
93 The Apple macOS boot manager, if installed\&.
94 .RE
95 .sp
96 .RS 4
97 .ie n \{\
98 \h'-04'\(bu\h'+03'\c
99 .\}
100 .el \{\
101 .sp -1
102 .IP \(bu 2.3
103 .\}
104 The EFI Shell binary, if installed\&.
105 .RE
106 .sp
107 .RS 4
108 .ie n \{\
109 \h'-04'\(bu\h'+03'\c
110 .\}
111 .el \{\
112 .sp -1
113 .IP \(bu 2.3
114 .\}
115 A
116 "Reboot Into Firmware Interface"
117 option, if supported by the UEFI firmware\&.
118 .RE
119 .sp
120 .RS 4
121 .ie n \{\
122 \h'-04'\(bu\h'+03'\c
123 .\}
124 .el \{\
125 .sp -1
126 .IP \(bu 2.3
127 .\}
128 Secure Boot variables enrollment if the UEFI firmware is in setup\-mode and files are provided on the ESP\&.
129 .RE
130 .PP
131 \fBsystemd\-boot\fR
132 supports the following features:
133 .sp
134 .RS 4
135 .ie n \{\
136 \h'-04'\(bu\h'+03'\c
137 .\}
138 .el \{\
139 .sp -1
140 .IP \(bu 2.3
141 .\}
142 Basic boot manager configuration changes (such as timeout configuration, default boot entry selection, \&...) may be made directly from the boot loader UI at boot\-time, as well as during system runtime with EFI variables\&.
143 .RE
144 .sp
145 .RS 4
146 .ie n \{\
147 \h'-04'\(bu\h'+03'\c
148 .\}
149 .el \{\
150 .sp -1
151 .IP \(bu 2.3
152 .\}
153 The boot manager integrates with the
154 \fBsystemctl\fR
155 command to implement features such as
156 \fBsystemctl reboot \-\-boot\-loader\-entry=\&...\fR
157 (for rebooting into a specific boot menu entry, i\&.e\&. "reboot into Windows") and
158 \fBsystemctl reboot \-\-boot\-loader\-menu=\&...\fR
159 (for rebooting into the boot loader menu), by implementing the
160 \m[blue]\fBBoot Loader Interface\fR\m[]\&\s-2\u[2]\d\s+2\&. See
161 \fBsystemctl\fR(1)
162 for details\&.
163 .RE
164 .sp
165 .RS 4
166 .ie n \{\
167 \h'-04'\(bu\h'+03'\c
168 .\}
169 .el \{\
170 .sp -1
171 .IP \(bu 2.3
172 .\}
173 An EFI variable set by the boot loader informs the OS about the EFI System Partition used during boot\&. This is then used to automatically mount the correct EFI System Partition to
174 /efi/
175 or
176 /boot/
177 during OS runtime\&. See
178 \fBsystemd-gpt-auto-generator\fR(8)
179 for details\&.
180 .RE
181 .sp
182 .RS 4
183 .ie n \{\
184 \h'-04'\(bu\h'+03'\c
185 .\}
186 .el \{\
187 .sp -1
188 .IP \(bu 2.3
189 .\}
190 The boot manager provides information about the boot time spent in UEFI firmware using the
191 \m[blue]\fBBoot Loader Interface\fR\m[]\&\s-2\u[2]\d\s+2\&. This information can be displayed using
192 \fBsystemd-analyze\fR(1)\&.
193 .RE
194 .sp
195 .RS 4
196 .ie n \{\
197 \h'-04'\(bu\h'+03'\c
198 .\}
199 .el \{\
200 .sp -1
201 .IP \(bu 2.3
202 .\}
203 The boot manager implements boot counting and automatic fallback to older, working boot entries on failure\&. See
204 \m[blue]\fBAutomatic Boot Assessment\fR\m[]\&\s-2\u[3]\d\s+2\&.
205 .RE
206 .sp
207 .RS 4
208 .ie n \{\
209 \h'-04'\(bu\h'+03'\c
210 .\}
211 .el \{\
212 .sp -1
213 .IP \(bu 2.3
214 .\}
215 The boot manager optionally reads a random seed from the ESP partition, combines it with a \*(Aqsystem token\*(Aq stored in a persistent EFI variable and derives a random seed to use by the OS as entropy pool initialization, providing a full entropy pool during early boot\&.
216 .RE
217 .sp
218 .RS 4
219 .ie n \{\
220 \h'-04'\(bu\h'+03'\c
221 .\}
222 .el \{\
223 .sp -1
224 .IP \(bu 2.3
225 .\}
226 The boot manager allows for Secure Boot variables to be enrolled if the UEFI firmware is in setup\-mode\&. Additionally, variables can be automatically enrolled if configured\&.
227 .RE
228 .PP
229 \fBbootctl\fR(1)
230 may be used from a running system to locate the ESP and the Extended Boot Loader Partition, list available entries, and install
231 \fBsystemd\-boot\fR
232 itself\&.
233 .PP
234 \fBkernel-install\fR(8)
235 may be used to copy kernel images onto the ESP or the Extended Boot Loader Partition and to generate description files compliant with the Boot Loader Specification\&.
236 .PP
237 \fBsystemd-stub\fR(7)
238 may be used as UEFI boot stub for executed kernels, which is useful to show graphical boot splashes before transitioning into the Linux world\&. It is also capable of automatically picking up auxiliary credential files (for boot parameterization) and system extension images, as companion files to the booted kernel images\&.
239 .SH "KEY BINDINGS"
240 .PP
241 The following keys may be used in the boot menu:
242 .PP
243 ↑ (Up), ↓ (Down), j, k, PageUp, PageDown, Home, End
244 .RS 4
245 Navigate up/down in the entry list
246 .sp
247 Added in version 239\&.
248 .RE
249 .PP
250 ↵ (Enter), → (Right)
251 .RS 4
252 Boot selected entry
253 .sp
254 Added in version 239\&.
255 .RE
256 .PP
257 d
258 .RS 4
259 Make selected entry the default
260 .sp
261 An EFI variable is set to allow this setting to persist\&.
262 .sp
263 Added in version 239\&.
264 .RE
265 .PP
266 e
267 .RS 4
268 Edit the kernel command line for selected entry
269 .sp
270 Added in version 239\&.
271 .RE
272 .PP
273 +, t
274 .RS 4
275 Increase the timeout before default entry is booted
276 .sp
277 An EFI variable is set to allow this setting to persist\&.
278 .sp
279 Added in version 239\&.
280 .RE
281 .PP
282 \-, T
283 .RS 4
284 Decrease the timeout
285 .sp
286 An EFI variable is set to allow this setting to persist\&.
287 .sp
288 Added in version 239\&.
289 .RE
290 .PP
291 r
292 .RS 4
293 Change screen resolution, skipping any unsupported modes\&.
294 .sp
295 An EFI variable is set to allow this setting to persist\&.
296 .sp
297 Added in version 250\&.
298 .RE
299 .PP
300 R
301 .RS 4
302 Reset screen resolution to firmware or configuration file default\&.
303 .sp
304 An EFI variable is set to allow this setting to persist\&.
305 .sp
306 Added in version 250\&.
307 .RE
308 .PP
309 p
310 .RS 4
311 Print status
312 .sp
313 Added in version 250\&.
314 .RE
315 .PP
316 h, ?, F1
317 .RS 4
318 Show a help screen
319 .sp
320 Added in version 239\&.
321 .RE
322 .PP
323 f
324 .RS 4
325 Reboot into firmware interface\&.
326 .sp
327 For compatibility with the keybindings of several firmware implementations this operation may also be reached with
328 F2,
329 F10,
330 Del
331 and
332 Esc\&.
333 .sp
334 Added in version 250\&.
335 .RE
336 .PP
337 Shift+o
338 .RS 4
339 Power off the system\&.
340 .sp
341 Added in version 255\&.
342 .RE
343 .PP
344 Shift+b
345 .RS 4
346 Reboot the system\&.
347 .sp
348 Added in version 255\&.
349 .RE
350 .PP
351 The following keys may be pressed during bootup or in the boot menu to directly boot a specific entry:
352 .PP
353 l
354 .RS 4
355 Linux
356 .sp
357 Added in version 239\&.
358 .RE
359 .PP
360 w
361 .RS 4
362 Windows
363 .sp
364 Added in version 239\&.
365 .RE
366 .PP
367 a
368 .RS 4
369 macOS
370 .sp
371 Added in version 239\&.
372 .RE
373 .PP
374 s
375 .RS 4
376 EFI shell
377 .sp
378 Added in version 239\&.
379 .RE
380 .PP
381 1, 2, 3, 4, 5, 6, 7, 8, 9
382 .RS 4
383 Boot entry number 1 \&... 9
384 .sp
385 Added in version 239\&.
386 .RE
387 .PP
388 The boot menu is shown when a non\-zero menu timeout has been configured\&. If the menu timeout has been set to zero, hold down a key (space
389 is recommended) before the boot loader initializes to bring up the boot menu\&. Note that depending on the firmware implementation the time window where key presses are accepted before the boot loader initializes might be short\&. If the window is missed, reboot and try again, possibly repeatedly pressing a suitable key; on most systems it should be possible to hit the time window after a few attempts\&. Keys other than the space bar may be used, except for the keys listed above\&. If showing the menu on demand doesn\*(Aqt work well, consider setting a non\-zero timeout to show the boot menu unconditionally\&. Some desktop environments might offer an option to boot directly into the boot menu, which also avoids the problem altogether\&. Alternatively, use the command line
390 \fBsystemctl reboot \-\-boot\-loader\-menu=\fR
391 with a non\-zero value from the shell\&.
392 .PP
393 In the editor, most keys simply insert themselves, but the following keys may be used to perform additional actions:
394 .PP
395 ← (Left), → (Right), Home, End
396 .RS 4
397 Navigate left/right
398 .sp
399 Added in version 239\&.
400 .RE
401 .PP
402 Esc, Ctrl+c
403 .RS 4
404 Abort the edit and quit the editor
405 .sp
406 Added in version 239\&.
407 .RE
408 .PP
409 Ctrl+k
410 .RS 4
411 Clear the command line forwards
412 .sp
413 Added in version 239\&.
414 .RE
415 .PP
416 Ctrl+w, Alt+Backspace
417 .RS 4
418 Delete word backwards
419 .sp
420 Added in version 239\&.
421 .RE
422 .PP
423 Ctrl+Del, Alt+d
424 .RS 4
425 Delete word forwards
426 .sp
427 Added in version 239\&.
428 .RE
429 .PP
430 ↵ (Enter)
431 .RS 4
432 Boot entry with the edited command line
433 .sp
434 Added in version 239\&.
435 .RE
436 .PP
437 Note that unless configured otherwise in the UEFI firmware, systemd\-boot will use the US keyboard layout, so key labels might not match for keys like +/\-\&.
438 .SH "FILES"
439 .PP
440 The files
441 \fBsystemd\-boot\fR
442 processes generally reside on the UEFI ESP which is usually mounted to
443 /efi/,
444 /boot/
445 or
446 /boot/efi/
447 during OS runtime\&. It also processes files on the Extended Boot Loader partition which is typically mounted to
448 /boot/, if it exists\&.
449 .PP
450 \fBsystemd\-boot\fR
451 reads runtime configuration such as the boot timeout and default entry from
452 /loader/loader\&.conf
453 on the ESP (in combination with data read from EFI variables)\&. See
454 \fBloader.conf\fR(5)\&.
455 .PP
456 Boot entry description files following the
457 \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[1]\d\s+2
458 are read from
459 /loader/entries/
460 on the ESP and the Extended Boot Loader partition\&.
461 .PP
462 Unified kernel boot entries following the
463 \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[1]\d\s+2
464 are read from
465 /EFI/Linux/
466 on the ESP and the Extended Boot Loader partition\&.
467 .PP
468 Optionally, a random seed for early boot entropy pool provisioning is stored in
469 /loader/random\-seed
470 in the ESP\&.
471 .PP
472 During initialization,
473 \fBsd\-boot\fR
474 automatically loads all driver files placed in the
475 /EFI/systemd/drivers/
476 directory of the ESP\&. The files placed there must have an extension of the EFI architecture ID followed by
477 \&.efi
478 (e\&.g\&. for x86\-64 this means a suffix of
479 x64\&.efi)\&. This may be used to automatically load file system drivers and similar, to extend the native firmware support\&.
480 .PP
481 Enrollment of Secure Boot variables can be performed manually or automatically if files are available under
482 /loader/keys/\fINAME\fR/{db,dbx,KEK,PK}\&.auth,
483 \fINAME\fR
484 being the display name for the set of variables in the menu\&. If one of the sets is named
485 auto
486 then it might be enrolled automatically depending on whether
487 "secure\-boot\-enroll"
488 is set to force or not\&.
489 .SH "EFI VARIABLES"
490 .PP
491 The following EFI variables are defined, and may be set or read by
492 \fBsystemd\-boot\fR
493 for communication between the boot loader and the OS\&. The vendor UUID
494 "4a67b082\-0a4c\-41cf\-b6c7\-440b29bb8c4f"
495 is used in all cases\&.
496 .PP
497 \fILoaderBootCountPath\fR
498 .RS 4
499 If boot counting is enabled, contains the path to the file in whose name the boot counters are encoded\&. Set by the boot loader\&.
500 \fBsystemd-bless-boot.service\fR(8)
501 uses this information to mark a boot as successful as determined by the successful activation of the
502 boot\-complete\&.target
503 target unit\&.
504 .sp
505 Added in version 240\&.
506 .RE
507 .PP
508 \fILoaderConfigTimeout\fR, \fILoaderConfigTimeoutOneShot\fR
509 .RS 4
510 The menu timeout in seconds\&. Read by the boot loader\&.
511 \fILoaderConfigTimeout\fR
512 is maintained persistently, while
513 \fILoaderConfigTimeoutOneShot\fR
514 is a one\-time override which is read once (in which case it takes precedence over
515 \fILoaderConfigTimeout\fR) and then removed\&.
516 \fILoaderConfigTimeout\fR
517 may be manipulated with the
518 t/T
519 keys, see above\&.
520 .sp
521 Added in version 240\&.
522 .RE
523 .PP
524 \fILoaderConfigConsoleMode\fR
525 .RS 4
526 The numerical menu console mode\&. Read by the boot loader\&.
527 \fILoaderConfigConsoleMode\fR
528 is maintained persistently\&.
529 \fILoaderConfigConsoleMode\fR
530 may be manipulated with the
531 r/R
532 keys, see above\&.
533 .sp
534 Added in version 250\&.
535 .RE
536 .PP
537 \fILoaderDevicePartUUID\fR
538 .RS 4
539 Contains the partition UUID of the partition the boot loader has been started from on the current boot (usually an EFI System Partition)\&. Set by the boot loader\&. (Note that
540 \fBsystemd-stub\fR(7)
541 will set this too, if not set yet, to support systems that boot directly into a unified kernel image, bypassing any boot loader\&.)
542 \fBsystemd-gpt-auto-generator\fR(8)
543 uses this information to automatically find the disk booted from, in order to discover various other partitions on the same disk automatically\&.
544 .sp
545 Added in version 220\&.
546 .RE
547 .PP
548 \fILoaderEntries\fR
549 .RS 4
550 A list of the identifiers of all discovered boot loader entries\&. Set by the boot loader\&.
551 .sp
552 Added in version 240\&.
553 .RE
554 .PP
555 \fILoaderEntryDefault\fR, \fILoaderEntryOneShot\fR
556 .RS 4
557 The identifier of the default boot loader entry\&. Can be set in the OS and the boot loader\&.
558 \fILoaderEntryOneShot\fR
559 sets the default entry for the next boot only, while
560 \fILoaderEntryDefault\fR
561 sets it persistently for all future boots\&.
562 \fBbootctl\fR(1)\*(Aqs
563 \fBset\-default\fR
564 and
565 \fBset\-oneshot\fR
566 commands make use of these variables\&. The boot loader modifies
567 \fILoaderEntryDefault\fR
568 on request, when the
569 d
570 key is used, see above\&.
571 .sp
572 Added in version 240\&.
573 .RE
574 .PP
575 \fILoaderEntryLastBooted\fR
576 .RS 4
577 The identifier of the boot loader entry last attempted\&. Set and read by the boot loader, only when
578 /loader/loader\&.conf
579 has default set to
580 "@saved"\&. See
581 \fBloader.conf\fR(5)\&.
582 .sp
583 The boot loader will ensure
584 \fILoaderEntryLastBooted\fR
585 is up\-to date for every boot, updating it as needed and will omit changing it all together when
586 \fILoaderEntryOneShot\fR
587 is set\&.
588 .sp
589 The boot loader reads the variable, which takes higher priority than
590 \fILoaderEntryDefault\fR\&. The variable is ignored when
591 \fILoaderEntryOneShot\fR
592 is set\&.
593 .sp
594 \fILoaderEntryLastBooted\fR
595 cannot be used as indication that the last boot was successful or not\&.
596 .sp
597 Added in version 250\&.
598 .RE
599 .PP
600 \fILoaderEntrySelected\fR
601 .RS 4
602 The identifier of the boot loader entry currently being booted\&. Set by the boot loader\&.
603 .sp
604 Added in version 240\&.
605 .RE
606 .PP
607 \fILoaderFeatures\fR
608 .RS 4
609 A set of flags indicating the features the boot loader supports\&. Set by the boot loader\&. Use
610 \fBbootctl\fR(1)
611 to view this data\&.
612 .sp
613 Added in version 240\&.
614 .RE
615 .PP
616 \fILoaderFirmwareInfo\fR, \fILoaderFirmwareType\fR
617 .RS 4
618 Brief firmware information\&. Set by the boot loader\&. Use
619 \fBbootctl\fR(1)
620 to view this data\&.
621 .sp
622 Added in version 240\&.
623 .RE
624 .PP
625 \fILoaderImageIdentifier\fR
626 .RS 4
627 The file system path to the EFI executable of the boot loader for the current boot, relative to the partition\*(Aqs root directory (i\&.e\&. relative to the partition indicated by
628 \fILoaderDevicePartUUID\fR, see above)\&. Set by the boot loader\&. (Note that
629 \fBsystemd\-stub\fR
630 will set this too, if not set yet, to support systems that directly boot into a unified kernel image, bypassing any boot loader\&.) Use
631 \fBbootctl\fR(1)
632 to view this data\&.
633 .sp
634 Added in version 220\&.
635 .RE
636 .PP
637 \fILoaderInfo\fR
638 .RS 4
639 Brief information about the boot loader\&. Set by the boot loader\&. Use
640 \fBbootctl\fR(1)
641 to view this data\&.
642 .sp
643 Added in version 240\&.
644 .RE
645 .PP
646 \fILoaderTimeExecUSec\fR, \fILoaderTimeInitUSec\fR, \fILoaderTimeMenuUsec\fR
647 .RS 4
648 Information about the time spent in various parts of the boot loader\&. Set by the boot loader\&. Use
649 \fBsystemd-analyze\fR(1)
650 to view this data\&.
651 .sp
652 Added in version 240\&.
653 .RE
654 .PP
655 \fILoaderSystemToken\fR
656 .RS 4
657 A binary random data field, that is used for generating the random seed to pass to the OS (see above)\&. Note that this random data is generally only generated once, during OS installation, and is then never updated again\&.
658 .sp
659 Added in version 243\&.
660 .RE
661 .PP
662 Many of these variables are defined by the
663 \m[blue]\fBBoot Loader Interface\fR\m[]\&\s-2\u[2]\d\s+2\&.
664 .SH "SMBIOS TYPE 11 STRINGS"
665 .PP
666 \fBsystemd\-boot\fR
667 can be configured using SMBIOS Type 11 strings\&. Applicable strings consist of a name, followed by
668 "=", followed by the value\&. Unless
669 \fBsystemd\-boot\fR
670 detects it is running inside a confidential computing environment,
671 \fBsystemd\-boot\fR
672 will search the table for a string with a specific name, and if found, use its value\&. The following strings are read:
673 .PP
674 \fIio\&.systemd\&.boot\&.kernel\-cmdline\-extra\fR
675 .RS 4
676 If set, the value of this string is added to the list of kernel command line arguments for Boot Loader Specification Type 1 entries that are measured in PCR12 and passed to the kernel\&.
677 .sp
678 Added in version 256\&.
679 .RE
680 .SH "BOOT COUNTING"
681 .PP
682 \fBsystemd\-boot\fR
683 implements a simple boot counting mechanism on top of the
684 \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[1]\d\s+2, for automatic and unattended fallback to older kernel versions/boot loader entries when a specific entry continuously fails\&. Any boot loader entry file and unified kernel image file that contains a
685 "+"
686 followed by one or two numbers (if two they need to be separated by a
687 "\-"), before the
688 \&.conf
689 or
690 \&.efi
691 suffix is subject to boot counting: the first of the two numbers (\*(Aqtries left\*(Aq) is decreased by one on every boot attempt, the second of the two numbers (\*(Aqtries done\*(Aq) is increased by one (if \*(Aqtries done\*(Aq is absent it is considered equivalent to 0)\&. Depending on the current value of these two counters the boot entry is considered to be in one of three states:
692 .sp
693 .RS 4
694 .ie n \{\
695 \h'-04' 1.\h'+01'\c
696 .\}
697 .el \{\
698 .sp -1
699 .IP " 1." 4.2
700 .\}
701 If the \*(Aqtries left\*(Aq counter of an entry is greater than zero the entry is considered to be in \*(Aqindeterminate\*(Aq state\&. This means the entry has not completed booting successfully yet, but also has not been determined not to work\&.
702 .RE
703 .sp
704 .RS 4
705 .ie n \{\
706 \h'-04' 2.\h'+01'\c
707 .\}
708 .el \{\
709 .sp -1
710 .IP " 2." 4.2
711 .\}
712 If the \*(Aqtries left\*(Aq counter of an entry is zero it is considered to be in \*(Aqbad\*(Aq state\&. This means no further attempts to boot this item will be made (that is, unless all other boot entries are also in \*(Aqbad\*(Aq state), as all attempts to boot this entry have not completed successfully\&.
713 .RE
714 .sp
715 .RS 4
716 .ie n \{\
717 \h'-04' 3.\h'+01'\c
718 .\}
719 .el \{\
720 .sp -1
721 .IP " 3." 4.2
722 .\}
723 If the \*(Aqtries left\*(Aq and \*(Aqtries done\*(Aq counters of an entry are absent it is considered to be in \*(Aqgood\*(Aq state\&. This means further boot counting for the entry is turned off, as it successfully booted at least once\&. The
724 \fBsystemd-bless-boot.service\fR(8)
725 service moves the currently booted entry from \*(Aqindeterminate\*(Aq into \*(Aqgood\*(Aq state when a boot attempt completed successfully\&.
726 .RE
727 .PP
728 Generally, when new entries are added to the boot loader, they first start out in \*(Aqindeterminate\*(Aq state, i\&.e\&. with a \*(Aqtries left\*(Aq counter greater than zero\&. The boot entry remains in this state until either it managed to complete a full boot successfully at least once (in which case it will be in \*(Aqgood\*(Aq state) \(em or the \*(Aqtries left\*(Aq counter reaches zero (in which case it will be in \*(Aqbad\*(Aq state)\&.
729 .PP
730 Example: let\*(Aqs say a boot loader entry file
731 foo\&.conf
732 is set up for 3 boot tries\&. The installer will hence create it under the name
733 foo+3\&.conf\&. On first boot, the boot loader will rename it to
734 foo+2\-1\&.conf\&. If that boot does not complete successfully, the boot loader will rename it to
735 foo+1\-2\&.conf
736 on the following boot\&. If that fails too, it will finally be renamed
737 foo+0\-3\&.conf
738 by the boot loader on next boot, after which it will be considered \*(Aqbad\*(Aq\&. If the boot succeeds however the entry file will be renamed to
739 foo\&.conf
740 by the OS, so that it is considered \*(Aqgood\*(Aq from then on\&.
741 .PP
742 The boot menu takes the \*(Aqtries left\*(Aq counter into account when sorting the menu entries: entries in \*(Aqbad\*(Aq state are ordered at the beginning of the list, and entries in \*(Aqgood\*(Aq or \*(Aqindeterminate\*(Aq at the end\&. The user can freely choose to boot any entry of the menu, including those already marked \*(Aqbad\*(Aq\&. If the menu entry to boot is automatically determined, this means that \*(Aqgood\*(Aq or \*(Aqindeterminate\*(Aq entries are generally preferred (as the bottom item of the menu is the one booted by default), and \*(Aqbad\*(Aq entries will only be considered if there are no \*(Aqgood\*(Aq or \*(Aqindeterminate\*(Aq entries left\&.
743 .PP
744 The
745 \fBkernel-install\fR(8)
746 kernel install framework optionally sets the initial \*(Aqtries left\*(Aq counter to the value specified in
747 /etc/kernel/tries
748 when a boot loader entry is first created\&.
749 .SH "USING SYSTEMD\-BOOT IN VIRTUAL MACHINES"
750 .PP
751 When using qemu with OVMF (UEFI Firmware for virtual machines) the
752 \fB\-kernel\fR
753 switch works not only for linux kernels, but for any EFI binary, including sd\-boot and unified linux kernels\&. Example command line for loading
754 \fBsystemd\-boot\fR
755 on x64:
756 .PP
757 \fBqemu\-system\-x86_64 \fR\fB\fI[ \&.\&.\&. ]\fR\fR\fB \-kernel /usr/lib/systemd/boot/efi/systemd\-bootx64\&.efi\fR
758 .PP
759 systemd\-boot will detect that it was started directly instead of being loaded from ESP and will search for the ESP in that case, taking into account boot order information from the hypervisor (if available)\&.
760 .SH "SEE ALSO"
761 .PP
762 \fBbootctl\fR(1), \fBloader.conf\fR(5), \fBsystemd-bless-boot.service\fR(8), \fBsystemd-boot-random-seed.service\fR(8), \fBkernel-install\fR(8), \fBsystemd-stub\fR(7), \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[1]\d\s+2, \m[blue]\fBBoot Loader Interface\fR\m[]\&\s-2\u[2]\d\s+2, \m[blue]\fBTPM2 PCR Measurements Made by systemd\fR\m[]\&\s-2\u[4]\d\s+2
763 .SH "NOTES"
764 .IP " 1." 4
765 Boot Loader Specification
766 .RS 4
767 \%https://uapi-group.org/specifications/specs/boot_loader_specification
768 .RE
769 .IP " 2." 4
770 Boot Loader Interface
771 .RS 4
772 \%https://systemd.io/BOOT_LOADER_INTERFACE
773 .RE
774 .IP " 3." 4
775 Automatic Boot Assessment
776 .RS 4
777 \%https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT
778 .RE
779 .IP " 4." 4
780 TPM2 PCR Measurements Made by systemd
781 .RS 4
782 \%https://systemd.io/TPM2_PCR_MEASUREMENTS
783 .RE