From 6efdd7fec5106205240332bd3b7fd2f93d4d9d4c Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 4 Oct 2023 12:55:52 +0100 Subject: sd-boot: add way to disable the 100ms delay when timeout=0 Currently we have a 100ms delay which allows for people to enter/show the boot menu even when timeout is set to zero. In a handful of cases, that may not be needed - both in terms of access policy, as well as latency. For example: the option to provide the boot menu may be hidden behind an "expert only" UX in the OS, to avoid end users from accidentally entering it. In addition, the current 100ms input polling may cause unexpected additional delays in the boot. Some example numbers from my SteamDeck: - boot counting/rename/flush doubles 300us -> 600us - seed/hash setup doubles 900us -> 1800us - kernel/image load gets ~40% slower 107ms -> 167ms It's not entirely clear why the UEFI calls gets slower, nevertheless the information in itself proves useful. This commit introduces a new option "menu-disabled", which omits the 100ms delay. The option is documented throughout the manual pages as well as the Boot Loader Specification. v2: - use STR_IN_SET v3: - drop erroneous whitespace v4: - add a new LoaderFeature bit, - don't change ABI keep TIMEOUT_* tokens the same - move new token in the 64bit range, update API and storage for it - change inc/dec behaviour to TIMEOUT_MIN : TIMEOUT_MENU_FORCE - user cannot opt-in from sd-boot itself, add assert_not_reached() v5: - s/Menu disablement control/Menu can be disabled/ - rewrap comments to 109 - use SYNTHETIC_ERRNO(EOPNOTSUPP) Signed-off-by: Emil Velikov --- man/bootctl.xml | 9 +++++---- man/loader.conf.xml | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'man') diff --git a/man/bootctl.xml b/man/bootctl.xml index 02ae5e1231..b2091eedf0 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -177,10 +177,10 @@ systemd.time7 for details about the syntax of time spans. - If this is set to or no menu is shown and - the default entry will be booted immediately, while setting this to - disables the timeout while always showing the menu. When an empty string ("") is specified the - bootloader will revert to its default menu timeout. + If this is set to or or + , no menu is shown and the default entry will be booted immediately, while + setting this to disables the timeout while always showing the menu. + When an empty string ("") is specified the bootloader will revert to its default menu timeout. @@ -555,6 +555,7 @@ Current Boot Loader: ← details about sd-boot or anothe ✓ Support for passing random seed to OS ✓ Load drop-in drivers ✓ Boot loader sets ESP information + ✓ Menu can be disabled ESP: /dev/disk/by-partuuid/01234567-89ab-cdef-dead-beef00000000 File: └─/EFI/systemd/systemd-bootx64.efi diff --git a/man/loader.conf.xml b/man/loader.conf.xml index a94f09c1ad..a7db82da1c 100644 --- a/man/loader.conf.xml +++ b/man/loader.conf.xml @@ -138,8 +138,9 @@ will be stored as an EFI variable in that case, overriding this option. - If set to menu-hidden or 0 (the default) no menu - is shown and the default entry will be booted immediately. The menu can be shown + If set to menu-disabled or menu-hidden or 0 + (the default), no menu is shown and the default entry will be booted immediately. Unless + menu-disabled is used, the menu can be shown by pressing and holding a key before systemd-boot is launched. Setting this to menu-force disables the timeout while always showing the menu. -- cgit v1.2.3