mirror of
https://git.proxmox.com/git/grub2
synced 2025-10-20 08:13:52 +00:00

If we don't have writable grubenv, recordfail doesn't work, which means our quickboot behavior - with a timeout of 0 - leaves the user without a reliable way to access the boot menu if they're on UEFI, because unlike BIOS, UEFI does not support checking the state of modifier keys (i.e. holding down shift at boot is not detectable). Handle this corner case by always using a non-zero timeout on EFI when save_env doesn't work. Reuse GRUB_RECORDFAIL_TIMEOUT to avoid introducing another variable.
45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
From 3163e0876f32704dd565bfb755deb5eb5b6f18be Mon Sep 17 00:00:00 2001
|
|
From: Jeroen Dekkers <jeroen@dekkers.ch>
|
|
Date: Sat, 12 Jan 2019 21:02:18 +0100
|
|
Subject: at_keyboard: initialize keyboard in module init if keyboard is ready
|
|
|
|
The change in 0c62a5b2 caused at_keyboard to fail on some
|
|
machines. Immediately initializing the keyboard in the module init if
|
|
the keyboard is ready makes the problem go away.
|
|
|
|
Bug-Debian: https://bugs.debian.org/741464
|
|
Last-Update: 2019-02-09
|
|
|
|
Patch-Name: at_keyboard-module-init.patch
|
|
---
|
|
grub-core/term/at_keyboard.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
|
|
index f0a986eb1..d4395c201 100644
|
|
--- a/grub-core/term/at_keyboard.c
|
|
+++ b/grub-core/term/at_keyboard.c
|
|
@@ -244,6 +244,14 @@ grub_at_keyboard_getkey (struct grub_term_input *term __attribute__ ((unused)))
|
|
return ret;
|
|
}
|
|
|
|
+static grub_err_t
|
|
+grub_keyboard_controller_mod_init (struct grub_term_input *term __attribute__ ((unused))) {
|
|
+ if (KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
|
|
+ grub_keyboard_controller_init ();
|
|
+
|
|
+ return GRUB_ERR_NONE;
|
|
+}
|
|
+
|
|
static void
|
|
grub_keyboard_controller_init (void)
|
|
{
|
|
@@ -314,6 +322,7 @@ grub_at_restore_hw (void)
|
|
static struct grub_term_input grub_at_keyboard_term =
|
|
{
|
|
.name = "at_keyboard",
|
|
+ .init = grub_keyboard_controller_mod_init,
|
|
.fini = grub_keyboard_controller_fini,
|
|
.getkey = grub_at_keyboard_getkey
|
|
};
|