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