From: Jan Janssen Date: Sat, 14 Aug 2021 12:26:12 +0000 (+0200) Subject: sd-boot: Improve key bindings X-Git-Tag: v250-rc1~818^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a8e5666ceb92173f3c29924b81656337f11dce7;p=thirdparty%2Fsystemd.git sd-boot: Improve key bindings Making keys case insensitive should help if caps lock is on. We are not advertising them at runtime or in the manual to reduce the noise. This also hides the quit and version commands from the help string. They are mostly for devs and otherwise have little to no use to normal users. The latter overlaps with print status which is still advertised. --- diff --git a/man/systemd-boot.xml b/man/systemd-boot.xml index 5169bbbd0f6..d3306593e41 100644 --- a/man/systemd-boot.xml +++ b/man/systemd-boot.xml @@ -108,6 +108,8 @@ Key bindings The following keys may be used in the boot menu: + + ↑ (Up) @@ -150,31 +152,16 @@ - v - Show systemd-boot, UEFI, and firmware versions - - - - P + p Print status - - Q - Quit - - h ? F1 Show a help screen - - - Ctrll - Reprint the screen - The following keys may be pressed during bootup or in the boot menu to directly boot a specific diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 5b2fb6482b7..908a268a4e5 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -673,12 +673,14 @@ static BOOLEAN menu_run( switch (key) { case KEYPRESS(0, SCAN_UP, 0): case KEYPRESS(0, 0, 'k'): + case KEYPRESS(0, 0, 'K'): if (idx_highlight > 0) idx_highlight--; break; case KEYPRESS(0, SCAN_DOWN, 0): case KEYPRESS(0, 0, 'j'): + case KEYPRESS(0, 0, 'J'): if (idx_highlight < config->entry_count-1) idx_highlight++; break; @@ -722,8 +724,10 @@ static BOOLEAN menu_run( case KEYPRESS(0, SCAN_F1, 0): case KEYPRESS(0, 0, 'h'): + case KEYPRESS(0, 0, 'H'): case KEYPRESS(0, 0, '?'): - status = StrDuplicate(L"(d)efault, (t/T)timeout, (e)dit, (v)ersion (Q)uit (P)rint (h)elp"); + /* This must stay below 80 characters! Q/v/Ctrl+l deliberately not advertised. */ + status = StrDuplicate(L"(d)efault (t/T)timeout (e)dit (p)rint (h)elp"); break; case KEYPRESS(0, 0, 'Q'): @@ -732,6 +736,7 @@ static BOOLEAN menu_run( break; case KEYPRESS(0, 0, 'd'): + case KEYPRESS(0, 0, 'D'): if (config->idx_default_efivar != (INTN)idx_highlight) { /* store the selected entry in a persistent EFI variable */ efivar_set( @@ -793,6 +798,7 @@ static BOOLEAN menu_run( break; case KEYPRESS(0, 0, 'e'): + case KEYPRESS(0, 0, 'E'): /* only the options of configured entries can be edited */ if (!config->editor || config->entries[idx_highlight]->type == LOADER_UNDEFINED) break; @@ -808,6 +814,7 @@ static BOOLEAN menu_run( ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); break; + case KEYPRESS(0, 0, 'p'): case KEYPRESS(0, 0, 'P'): print_status(config, loaded_image_path); refresh = TRUE;