Debian Codegraph @

upstream/debian-unstable/man5/loader.conf.5

raw
1 '\" t
2 .TH "LOADER\&.CONF" "5" "" "systemd 261~rc3" "loader.conf"
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 loader.conf \- Configuration file for systemd\-boot
24 .SH "SYNOPSIS"
25 .PP
26 \fIESP\fR/loader/loader\&.conf
27 .SH "DESCRIPTION"
28 .PP
29 \fBsystemd-boot\fR(7)
30 reads
31 \fIESP\fR/loader/loader\&.conf\&. This file configures whether the menu is shown and for how long, the font, audible beep, types of menu entries to show, the default choice, and some aspects of Secure Boot enrollment and firmware handling\&. See the list of available options below\&.
32 .PP
33 The file uses UTF\-8 encoding and consists of series of lines separated by "line feed" (i\&.e\&. ASCII code 10)\&. Lines that are empty or start with the comment sign ("#") are ignored\&. Other lines consist of an option name, followed by whitespace, and the option value\&.
34 .PP
35 Boolean arguments may be written as
36 "yes"/"y"/"true"/"t"/"on"/"1"
37 or
38 "no"/"n"/"false"/"f"/"off"/"0"\&.
39 .PP
40 Note:
41 \fBsystemd\-boot\fR
42 will also read boot loader entry files, type #1 (\fIESP\fR/loader/entries/*\&.conf
43 and
44 \fIXBOOTLDR\fR/loader/entries/*\&.conf) and type #2 (\fIESP\fR/EFI/Linux/*\&.uki
45 and
46 \fIXBOOTLDR\fR/EFI/Linux/*\&.uki)\&. Those files are described by the
47 \m[blue]\fBUAPI\&.1 Boot Loader Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
48 .PP
49 Note: the behaviour of
50 \fBsystemd\-boot\fR
51 is also influenced by EFI variables\&. Some of the settings specified in this file can be overridden by those, for example the default boot menu entry or the menu timeouts\&. See
52 \fBsystemd-boot\fR(7)
53 for details\&.
54 .SH "OPTIONS"
55 .PP
56 The following configuration are supported in
57 loader\&.conf:
58 .PP
59 default
60 .RS 4
61 A glob pattern to select the default entry by id, which is the file name including literal suffix
62 "\&.conf"\&. The default entry may be changed in the boot menu itself, in which case the name of the selected entry will be stored as an EFI variable, overriding this option\&.
63 .sp
64 If set to
65 "@saved"
66 the chosen entry will be saved as an EFI variable on every boot and automatically selected the next time the boot loader starts\&.
67 .sp
68 .it 1 an-trap
69 .nr an-no-space-flag 1
70 .nr an-break-flag 1
71 .br
72 .B Table\ \&1.\ \&Automatically detected entries will use the following names:
73 .TS
74 allbox tab(:);
75 lB lB.
76 T{
77 Name
78 T}:T{
79 Description
80 T}
81 .T&
82 l l
83 l l
84 l l
85 l l
86 l l
87 l l
88 l l.
89 T{
90 auto\-efi\-default
91 T}:T{
92 EFI Default Loader
93 T}
94 T{
95 auto\-efi\-shell
96 T}:T{
97 EFI Shell
98 T}
99 T{
100 auto\-osx
101 T}:T{
102 macOS
103 T}
104 T{
105 auto\-poweroff
106 T}:T{
107 Power Off The System
108 T}
109 T{
110 auto\-reboot
111 T}:T{
112 Reboot The System
113 T}
114 T{
115 auto\-reboot\-to\-firmware\-setup
116 T}:T{
117 Reboot Into Firmware Interface
118 T}
119 T{
120 auto\-windows
121 T}:T{
122 Windows Boot Manager
123 T}
124 .TE
125 .sp 1
126 Supported glob wildcard patterns are
127 "?",
128 "*", and
129 "[\&...]"
130 (including ranges)\&. Note that these patterns use the same syntax as
131 \fBglob\fR(7), but do not support all features\&. In particular, set negation and named character classes are not supported\&. The matching is done case\-insensitively on the entry ID (as shown by
132 \fBbootctl list\fR)\&.
133 .sp
134 Added in version 239\&.
135 .RE
136 .PP
137 timeout
138 .RS 4
139 How long the boot menu should be shown before the default entry is booted, in seconds\&. This may be changed in the boot menu itself and will be stored as an EFI variable in that case, overriding this option\&.
140 .sp
141 If set to
142 "menu\-disabled"
143 or
144 "menu\-hidden"
145 or
146 "0"
147 (the default), no menu is shown and the default entry will be booted immediately\&. Unless
148 "menu\-disabled"
149 is used, the menu can be shown by pressing and holding a key before systemd\-boot is launched\&. Setting this to
150 "menu\-force"
151 disables the timeout while always showing the menu\&.
152 .sp
153 Added in version 239\&.
154 .RE
155 .PP
156 console\-mode
157 .RS 4
158 This option configures the resolution of the console\&. This may be changed in the boot menu itself and will be stored as an EFI variable in that case, overriding this option\&.
159 .sp
160 Takes a number or one of the special values listed below\&. The following values may be used:
161 .PP
162 0
163 .RS 4
164 Standard UEFI 80x25 mode
165 .sp
166 Added in version 239\&.
167 .RE
168 .PP
169 1
170 .RS 4
171 80x50 mode, not supported by all devices
172 .sp
173 Added in version 239\&.
174 .RE
175 .PP
176 2
177 .RS 4
178 the first non\-standard mode provided by the device firmware, if any
179 .sp
180 Added in version 239\&.
181 .RE
182 .PP
183 auto
184 .RS 4
185 Pick a suitable mode automatically using heuristics
186 .sp
187 Added in version 239\&.
188 .RE
189 .PP
190 max
191 .RS 4
192 Pick the highest\-numbered available mode
193 .sp
194 Added in version 239\&.
195 .RE
196 .PP
197 keep
198 .RS 4
199 Keep the mode selected by firmware (the default)
200 .sp
201 Added in version 239\&.
202 .RE
203 .sp
204 Added in version 239\&.
205 .RE
206 .PP
207 editor
208 .RS 4
209 Takes a boolean argument\&. Enable (the default) or disable the editor\&. The editor should be disabled if the machine can be accessed by unauthorized persons\&.
210 .sp
211 Added in version 239\&.
212 .RE
213 .PP
214 auto\-entries
215 .RS 4
216 Takes a boolean argument\&. Enable (the default) or disable entries for other boot entries found on the boot partition\&. In particular, this may be useful when loader entries are created to show replacement descriptions for those entries\&.
217 .sp
218 Added in version 239\&.
219 .RE
220 .PP
221 auto\-firmware
222 .RS 4
223 A boolean controlling the presence of the
224 "Reboot Into Firmware Interface"
225 entry (enabled by default)\&. If this is disabled, the firmware interface may still be reached by using the
226 f
227 key\&.
228 .sp
229 Added in version 239\&.
230 .RE
231 .PP
232 auto\-reboot
233 .RS 4
234 A boolean controlling the presence of the
235 "Reboot The System"
236 entry (disabled by default)\&. Even if this is disabled, the system may still be rebooted by pressing
237 Shift+b\&.
238 .sp
239 Added in version 255\&.
240 .RE
241 .PP
242 auto\-poweroff
243 .RS 4
244 A boolean controlling the presence of the
245 "Power Off The System"
246 entry (disabled by default)\&. Even if this is disabled, the system may still be powered off by pressing
247 Shift+o\&.
248 .sp
249 Added in version 255\&.
250 .RE
251 .PP
252 beep
253 .RS 4
254 Takes a boolean argument\&. If timeout enabled beep every second, otherwise beep n times when n\-th entry in boot menu is selected (default disabled)\&. Currently, only x86 is supported, where it uses the PC speaker\&.
255 .sp
256 Added in version 251\&.
257 .RE
258 .PP
259 secure\-boot\-enroll
260 .RS 4
261 Danger: this feature might soft\-brick your device if used improperly\&.
262 .sp
263 Controls enrollment of secure boot keys found on the ESP if the system is in setup mode:
264 .PP
265 \fBif\-safe\fR
266 .RS 4
267 This is the default\&. Same behavior as
268 \fBmanual\fR, but will try to automatically enroll the key named
269 "auto"
270 if it is considered to be safe\&. Currently, this is only the case if the system is running inside a virtual machine\&.
271 .sp
272 Added in version 253\&.
273 .RE
274 .PP
275 \fBmanual\fR
276 .RS 4
277 Boot entries for found secure boot keys are created that allow manual enrollment\&.
278 .sp
279 Added in version 253\&.
280 .RE
281 .PP
282 \fBoff\fR
283 .RS 4
284 No action is taken\&.
285 .sp
286 Added in version 253\&.
287 .RE
288 .PP
289 \fBforce\fR
290 .RS 4
291 Always enroll the
292 "auto"
293 key if found\&. Note that a warning message with a timeout will still be shown if this operation is unknown to be safe\&.
294 .sp
295 Added in version 253\&.
296 .RE
297 .sp
298 The different sets of variables can be set up under
299 /loader/keys/\fINAME\fR
300 where
301 \fINAME\fR
302 is the name that is going to be used as the name of the entry\&. This allows one to ship multiple sets of Secure Boot variables and choose which one to enroll at runtime\&.
303 .sp
304 Supported Secure Boot variables are one database for authorized images, one for the key exchange key (KEK) and one for the platform key (PK)\&. For more information, refer to the
305 \m[blue]\fBUEFI specification\fR\m[]\&\s-2\u[2]\d\s+2, under Secure Boot and Driver Signing\&. Another resource that describe the interplay of the different variables is the
306 \m[blue]\fBEDK2 documentation\fR\m[]\&\s-2\u[3]\d\s+2\&.
307 .sp
308 A complete set of UEFI variable includes
309 db\&.auth,
310 KEK\&.auth
311 and
312 PK\&.auth\&. Note that these files need to be authenticated UEFI variables\&. See below for an example of how to generate them from regular X\&.509 keys\&.
313 .sp
314 .if n \{\
315 .RS 4
316 .\}
317 .nf
318 uuid=$(systemd\-id128 new \-\-uuid)
319 for key in PK KEK db; do
320 openssl req \-new \-x509 \-subj "/CN=${key}/" \-keyout "${key}\&.key" \-out "${key}\&.pem"
321 openssl x509 \-outform DER \-in "${key}\&.pem" \-out "${key}\&.der"
322 sbsiglist \-\-owner "${uuid}" \-\-type x509 \-\-output "${key}\&.esl" "${key}\&.der"
323 done
324
325 # See also: \m[blue]\fBWindows Secure Boot Key Creation and Management Guidance\fR\m[]\&\s-2\u[4]\d\s+2
326 curl \-\-location \e
327 "https://go\&.microsoft\&.com/fwlink/p/?linkid=321192" \-o ms\-db\-2011\&.der \e
328 "https://go\&.microsoft\&.com/fwlink/p/?linkid=321185" \-o ms\-kek\-2011\&.der \e
329 "https://go\&.microsoft\&.com/fwlink/p/?linkid=321194" \-o ms\-uefi\-db\-2011\&.der \e
330 "https://go\&.microsoft\&.com/fwlink/p/?linkid=2239776" \-o ms\-db\-2023\&.der \e
331 "https://go\&.microsoft\&.com/fwlink/p/?linkid=2239775" \-o ms\-kek\-2023\&.der \e
332 "https://go\&.microsoft\&.com/fwlink/p/?linkid=2239872" \-o ms\-uefi\-db\-2023\&.der
333 sha1sum \-c <<END
334 580a6f4cc4e4b669b9ebdc1b2b3e087b80d0678d ms\-db\-2011\&.der
335 31590bfd89c9d74ed087dfac66334b3931254b30 ms\-kek\-2011\&.der
336 46def63b5ce61cf8ba0de2e6639c1019d0ed14f3 ms\-uefi\-db\-2011\&.der
337 45a0fa32604773c82433c3b7d59e7466b3ac0c67 ms\-db\-2023\&.der
338 459ab6fb5e284d272d5e3e6abc8ed663829d632b ms\-kek\-2023\&.der
339 b5eeb4a6706048073f0ed296e7f580a790b59eaa ms\-uefi\-db\-2023\&.der
340 END
341 for key in ms\-*\&.der; do
342 sbsiglist \-\-owner 77fa9abd\-0359\-4d32\-bd60\-28f4e78f784b \-\-type x509 \-\-output "${key%der}esl" "${key}"
343 done
344
345 # Optionally add Microsoft Windows certificates (needed to boot into Windows)\&.
346 cat ms\-db\-*\&.esl >>db\&.esl
347
348 # Optionally add Microsoft UEFI certificates for firmware drivers / option ROMs and third\-party
349 # boot loaders (including shim)\&. This is highly recommended on real hardware as not including this
350 # may soft\-brick your device (see next paragraph)\&.
351 cat ms\-uefi\-*\&.esl >>db\&.esl
352
353 # Optionally add Microsoft KEK certificates\&. Recommended if either of the Microsoft keys is used as
354 # the official UEFI revocation database is signed with this key\&. The revocation database can be
355 # updated with \fBfwupdmgr\fR(1)\&.
356 cat ms\-kek\-*\&.esl >>KEK\&.esl
357
358 attr=NON_VOLATILE,RUNTIME_ACCESS,BOOTSERVICE_ACCESS,TIME_BASED_AUTHENTICATED_WRITE_ACCESS
359 sbvarsign \-\-attr "${attr}" \-\-key PK\&.key \-\-cert PK\&.pem \-\-output PK\&.auth PK PK\&.esl
360 sbvarsign \-\-attr "${attr}" \-\-key PK\&.key \-\-cert PK\&.pem \-\-output KEK\&.auth KEK KEK\&.esl
361 sbvarsign \-\-attr "${attr}" \-\-key KEK\&.key \-\-cert KEK\&.pem \-\-output db\&.auth db db\&.esl
362 .fi
363 .if n \{\
364 .RE
365 .\}
366 .sp
367 This feature is considered dangerous because even if all the required files are signed with the keys being loaded, some files necessary for the system to function properly still won\*(Aqt be\&. This is especially the case with Option ROMs (e\&.g\&. for storage controllers or graphics cards)\&. See
368 \m[blue]\fBSecure Boot and Option ROMs\fR\m[]\&\s-2\u[5]\d\s+2
369 for more details\&.
370 .sp
371 Added in version 252\&.
372 .RE
373 .PP
374 secure\-boot\-enroll\-action
375 .RS 4
376 Specifies the action to take after the automatic enrollment of secure boot keys is completed\&.
377 .PP
378 reboot
379 .RS 4
380 Reboot the system after enrollment\&. This is the default\&.
381 .RE
382 .PP
383 shutdown
384 .RS 4
385 Shut down the system after enrollment\&.
386 .RE
387 .sp
388 This option is only relevant if
389 "secure\-boot\-enroll"
390 is enabled\&.
391 .sp
392 Added in version 258\&.
393 .RE
394 .PP
395 secure\-boot\-enroll\-timeout\-sec
396 .RS 4
397 How long the warning should be shown in seconds before the key enrollment process starts\&.
398 .sp
399 If set to
400 "hidden"
401 or
402 "0", no warning is shown and the keys will be enrolled immediately\&. The default timeout (if not set explicitly) is 15 seconds\&.
403 .sp
404 This option is only relevant if
405 "secure\-boot\-enroll"
406 is enabled\&.
407 .sp
408 Added in version 259\&.
409 .RE
410 .PP
411 reboot\-for\-bitlocker
412 .RS 4
413 Caveat: This feature is experimental, and is likely to be changed (or removed in its current form) in a future version of systemd\&.
414 .sp
415 Work around BitLocker requiring a recovery key when the boot loader was updated (disabled by default)\&.
416 .sp
417 Try to detect BitLocker encrypted drives along with an active TPM\&. If both are found and Windows Boot Manager is selected in the boot menu, set the
418 "BootNext"
419 EFI variable and restart the system\&. The firmware will then start Windows Boot Manager directly, leaving the TPM PCRs in expected states so that Windows can unseal the encryption key\&. This allows
420 \fBsystemd-boot\fR(7)
421 to be updated without having to provide the recovery key for BitLocker drive unlocking\&.
422 .sp
423 Note that the PCRs that Windows uses can be configured with the
424 "Configure TPM platform validation profile for native UEFI firmware configurations"
425 group policy under
426 "Computer Configuration\eAdministrative Templates\eWindows Components\eBitLocker Drive Encryption"\&. When Secure Boot is enabled, changing this to PCRs
427 "0,2,7,11"
428 should be safe\&. The TPM key protector needs to be removed and then added back for the PCRs on an already encrypted drive to change\&. If PCR 4 is not measured, this setting can be disabled to speed up booting into Windows\&.
429 .sp
430 Added in version 251\&.
431 .RE
432 .PP
433 reboot\-on\-error
434 .RS 4
435 Controls auto reboot in case the selected entry fails to start\&.
436 .PP
437 \fByes\fR
438 .RS 4
439 Reboot the system if the selected boot entry failed to start\&.
440 .RE
441 .PP
442 \fBno\fR
443 .RS 4
444 Don\*(Aqt reboot \- pass control back to EFI firmware\&.
445 .RE
446 .PP
447 \fBauto\fR
448 .RS 4
449 Perform the reboot if and only if boot counting is enabled for this entry and the tries left counter wasn\*(Aqt already at 0\&.
450 .sp
451 This is the default, as it is typically a safe option, that ensures a clean measurement log on each boot attempt, but also does not risk an unbounded reboot loop\&.
452 .RE
453 .sp
454 Added in version 258\&.
455 .RE
456 .PP
457 log\-level
458 .RS 4
459 Controls the log level used by
460 \fBsystemd-boot\fR(7)\&.
461 .sp
462 Valid values are
463 "emerg",
464 "alert",
465 "crit",
466 "err",
467 "warning",
468 "notice",
469 "info", and
470 "debug"\&.
471 .sp
472 If unspecified,
473 "info"
474 will be used, unless one has already been configured via an SMBIOS Type 11 string, see
475 \fBsmbios-type-11\fR(7)\&.
476 .sp
477 Note that the configured level will only be used after
478 loader\&.conf
479 has been parsed, so log messages generated before that point may be unaffected by this setting\&.
480 .sp
481 Added in version 259\&.
482 .RE
483 .SH "EXAMPLE"
484 .sp
485 .if n \{\
486 .RS 4
487 .\}
488 .nf
489 # /boot/efi/loader/loader\&.conf
490 timeout 0
491 default 01234567890abcdef1234567890abdf0\-*
492 editor no
493 .fi
494 .if n \{\
495 .RE
496 .\}
497 .PP
498 The menu will not be shown by default (the menu can still be shown by pressing and holding a key during boot)\&. One of the entries with files with a name starting with
499 "01234567890abcdef1234567890abdf0\-"
500 will be selected by default\&. If more than one entry matches, the one with the highest priority will be selected (generally the one with the highest version number)\&. The editor will be disabled, so it is not possible to alter the kernel command line\&.
501 .SH "SEE ALSO"
502 .PP
503 \fBsystemd-boot\fR(7), \fBbootctl\fR(1)
504 .SH "NOTES"
505 .IP " 1." 4
506 UAPI.1 Boot Loader Specification
507 .RS 4
508 \%https://uapi-group.org/specifications/specs/boot_loader_specification
509 .RE
510 .IP " 2." 4
511 UEFI specification
512 .RS 4
513 \%https://uefi.org/specifications
514 .RE
515 .IP " 3." 4
516 EDK2 documentation
517 .RS 4
518 \%https://edk2-docs.gitbook.io/understanding-the-uefi-secure-boot-chain/secure_boot_chain_in_uefi/uefi_secure_boot
519 .RE
520 .IP " 4." 4
521 Windows Secure Boot Key Creation and Management Guidance
522 .RS 4
523 \%https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-secure-boot-key-creation-and-management-guidance
524 .RE
525 .IP " 5." 4
526 Secure Boot and Option ROMs
527 .RS 4
528 \%https://github.com/Foxboron/sbctl/wiki/FAQ#option-rom
529 .RE