summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--man/systemd-boot.xml10
-rw-r--r--src/boot/efi/boot.c11
3 files changed, 20 insertions, 3 deletions
diff --git a/TODO b/TODO
index 2ba0666d4a..eda525dc44 100644
--- a/TODO
+++ b/TODO
@@ -949,8 +949,6 @@ Features:
appropriate qemu cmdline. That way qemu payloads could talk sd_notify()
directly to host service manager.
-* sd-boot: add menu item for shutdown? or hotkey?
-
* sd-device has an API to create an sd_device object from a device id, but has
no api to query the device id
diff --git a/man/systemd-boot.xml b/man/systemd-boot.xml
index 30908e398a..56044281d4 100644
--- a/man/systemd-boot.xml
+++ b/man/systemd-boot.xml
@@ -192,6 +192,16 @@
may also be reached with <keycap>F2</keycap>, <keycap>F10</keycap>, <keycap>Del</keycap> and
<keycap>Esc</keycap>.</para></listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><keycombo><keycap>Shift</keycap><keycap>o</keycap></keycombo></term>
+ <listitem><para>Power off the system.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><keycombo><keycap>Shift</keycap><keycap>b</keycap></keycombo></term>
+ <listitem><para>Reboot the system.</para></listitem>
+ </varlistentry>
</variablelist>
<para>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 b1c8814286..3704ee6846 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -881,7 +881,7 @@ static bool menu_run(
case KEYPRESS(0, 0, 'H'):
case KEYPRESS(0, 0, '?'):
/* This must stay below 80 characters! Q/v/Ctrl+l/f deliberately not advertised. */
- status = xstrdup16(u"(d)efault (t/T)timeout (e)dit (r/R)resolution (p)rint (h)elp");
+ status = xstrdup16(u"(d)efault (t/T)imeout (e)dit (r/R)esolution (p)rint (O)ff re(B)oot (h)elp");
break;
case KEYPRESS(0, 0, 'Q'):
@@ -963,6 +963,7 @@ static bool menu_run(
case KEYPRESS(EFI_CONTROL_PRESSED, 0, 'l'):
case KEYPRESS(EFI_CONTROL_PRESSED, 0, CHAR_CTRL('l')):
+ case 'L': /* only uppercase, do not conflict with lower-case 'l' which picks first Linux entry */
clear = true;
break;
@@ -1008,6 +1009,14 @@ static bool menu_run(
status = xstrdup16(u"Reboot into firmware interface not supported.");
break;
+ case KEYPRESS(0, 0, 'O'): /* Only uppercase, so that it can't be hit so easily fat-fingered, but still works safely over serial */
+ RT->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
+ break;
+
+ case KEYPRESS(0, 0, 'B'): /* ditto */
+ RT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
+ break;
+
default:
/* jump with a hotkey directly to a matching entry */
idx = entry_lookup_key(config, idx_highlight+1, KEYCHAR(key));