]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-boot: Improve key bindings
authorJan Janssen <medhefgo@web.de>
Sat, 14 Aug 2021 12:26:12 +0000 (14:26 +0200)
committerJan Janssen <medhefgo@web.de>
Tue, 17 Aug 2021 11:57:21 +0000 (13:57 +0200)
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.

man/systemd-boot.xml
src/boot/efi/boot.c

index 5169bbbd0f60d4e3019b1ffc4ed9ca9b02d7d8c7..d3306593e413f86886421f71f9284dafb8cfcdad 100644 (file)
     <title>Key bindings</title>
     <para>The following keys may be used in the boot menu:</para>
 
+    <!-- Developer commands Q/v/Ctrl+l deliberately not advertised. -->
+
     <variablelist>
       <varlistentry>
         <term><keycap>↑</keycap> (Up)</term>
       </varlistentry>
 
       <varlistentry>
-        <term><keycap>v</keycap></term>
-        <listitem><para>Show systemd-boot, UEFI, and firmware versions</para></listitem>
-      </varlistentry>
-
-      <varlistentry>
-        <term><keycap>P</keycap></term>
+        <term><keycap>p</keycap></term>
         <listitem><para>Print status</para></listitem>
       </varlistentry>
 
-      <varlistentry>
-        <term><keycap>Q</keycap></term>
-        <listitem><para>Quit</para></listitem>
-      </varlistentry>
-
       <varlistentry>
         <term><keycap>h</keycap></term>
         <term><keycap>?</keycap></term>
         <term><keycap>F1</keycap></term>
         <listitem><para>Show a help screen</para></listitem>
       </varlistentry>
-
-      <varlistentry>
-        <term><keycombo><keycap>Ctrl</keycap><keycap>l</keycap></keycombo></term>
-        <listitem><para>Reprint the screen</para></listitem>
-      </varlistentry>
     </variablelist>
 
     <para>The following keys may be pressed during bootup or in the boot menu to directly boot a specific
index 5b2fb6482b7f19d21424dbd4bff812bc7e086492..908a268a4e57380ff107f2fd2689ea885be4761a 100644 (file)
@@ -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;