]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-boot: add way to disable the 100ms delay when timeout=0 29441/head
authorEmil Velikov <emil.velikov@collabora.com>
Wed, 4 Oct 2023 11:55:52 +0000 (12:55 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 17 Oct 2023 14:09:53 +0000 (15:09 +0100)
commit6efdd7fec5106205240332bd3b7fd2f93d4d9d4c
treef2fc24522107b0a5481ee3d70c0756cb674842da
parent5b45fad4fcfa2dd81f25b13fe8d7717f62fa5843
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 <emil.velikov@collabora.com>
docs/BOOT_LOADER_INTERFACE.md
man/bootctl.xml
man/loader.conf.xml
src/boot/bootctl-set-efivar.c
src/boot/bootctl-status.c
src/boot/efi/boot.c
src/fundamental/efivars-fundamental.h