grub2/grub2-SUSE-Add-the-t-hotkey.patch
Michael Chang cf7b25968b - Fix missng menu entry "Start bootloader from a read-only snapshot" by
ensuring grub2-snapper-plugin is installed when both snapper and grub2-common
  are installed (bsc#1231271) 

- Fix OOM error in loading loopback file (bsc#1230840)
  * 0001-tpm-Skip-loopback-image-measurement.patch

- Fix UEFI PXE boot failure on tagged VLAN network (bsc#1230263)
  * 0001-efinet-Skip-virtual-VLAN-devices-during-card-enumera.patch

- Fix grub screen is filled with artifects from earlier post menu (bsc#1224465)
  * grub2-SUSE-Add-the-t-hotkey.patch
  * 0001-fix-grub-screen-filled-with-post-screen-artifects.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=516
2024-10-04 09:29:44 +00:00

80 lines
2.0 KiB
Diff

From f6be3d41e24e685846dfc90ac1ca447501813687 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 26 Apr 2016 15:59:03 +0200
Subject: [PATCH] SUSE: Add the "t" hotkey
While graphical output is fancy and nice, in some environments (EFI) we can
only have fancy graphical on frame buffer _or_ ugly serial on any output.
To give the user a nicely graphical screen in the default case, but still
allow them to get their boot menu on the serial console, let's add a new
hidden option "t" that switches the output device back to the firmware default.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
v1 -> v2
- use hiddenentry instead of --hidden
v2 -> v3 (by fvogt@suse.de)
- make it a runtime decision (bsc#1164385)
v3 -> v4
- display the message only when necessary
- clear the screen to enhance visual comfort (bsc#1224465)
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -552,6 +552,12 @@
installdir = grubconf;
};
+script = {
+ name = '95_textmode';
+ common = util/grub.d/95_textmode.in;
+ installdir = grubconf;
+};
+
program = {
mansection = 1;
name = grub-mkrescue;
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -246,6 +246,18 @@
fi
fi
+if echo "$GRUB_TERMINAL_OUTPUT" | grep -qwv console &&
+ ([ x"$GRUB_TIMEOUT_STYLE" = xmenu ] ||
+ ([ x"$GRUB_TIMEOUT_STYLE" = x ] &&
+ [ x"$GRUB_HIDDEN_TIMEOUT" = x -o x"$GRUB_HIDDEN_TIMEOUT" = x0 ])); then
+ cat <<EOF
+ if [ "\${grub_platform}" = "efi" ]; then
+ clear
+ echo "Please press 't' to show the boot menu on this console"
+ fi
+EOF
+fi
+
cat << EOF
set gfxmode=${GRUB_GFXMODE}
load_video
--- /dev/null
+++ b/util/grub.d/95_textmode.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cat <<EOF
+if [ "\${grub_platform}" = "efi" ]; then
+ # On EFI systems we can only have graphics *or* serial, so allow the user
+ # to switch between the two
+ hiddenentry 'Text mode' --hotkey 't' {
+ set textmode=true
+ terminal_output console
+ }
+fi
+EOF