[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/20] GRUB: Don't spew "Unknown key 0xFF"
From: |
Leah Rowe |
Subject: |
[PATCH 04/20] GRUB: Don't spew "Unknown key 0xFF" |
Date: |
Sun, 14 Jan 2024 15:55:21 +0000 |
From: Leah Rowe <leah@libreboot.org>
If the user has a stuck key, this can cause invalid scancodes
to be sent out repeatedly to GRUB, which is currently programmed
to spew an error message when that happens, by detecting bad
scancode input.
However, when the keyboard is electrically faulty in such a way
as to repeatedly send such scancodes, GRUB repeatedly prints
the error message. When this happens, GRUB is no longer
responsive. The user loses all control, and the system is
effectively bricked. Without this patch, the user's keyboard
is a ticking timebomb. On desktops, this is not a problem, but
many laptop users will not want to (or know how to) replace
their keyboards easily, but the system may still boot and they
may still be able to use the keyboard.
With this patch, the same errno value is set in GRUB, but the
error message is no longer printed. This will permit the user
to boot the system normally. No more error spew. No more brick.
Signed-off-by: Leah Rowe <leah@libreboot.org>
---
...outs-don-t-print-Unknown-key-message.patch | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644
resources/grub/patches/0011-keylayouts-don-t-print-Unknown-key-message.patch
diff --git
a/resources/grub/patches/0011-keylayouts-don-t-print-Unknown-key-message.patch
b/resources/grub/patches/0011-keylayouts-don-t-print-Unknown-key-message.patch
new file mode 100644
index 0000000..fbef86a
--- /dev/null
+++
b/resources/grub/patches/0011-keylayouts-don-t-print-Unknown-key-message.patch
@@ -0,0 +1,38 @@
+From 0a6abeb40ac4284fbff6ef5958989d561b6290a7 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <leah@libreboot.org>
+Date: Tue, 31 Oct 2023 10:33:28 +0000
+Subject: [PATCH 1/1] keylayouts: don't print "Unknown key" message
+
+on keyboards with stuck keys, this results in GRUB just
+spewing it repeatedly, preventing use of GRUB.
+
+in such cases, it's still possible to use the keyboard,
+and we should let the user at least boot.
+
+it often appears when people plug in faulty usb keyboards,
+but can appear for laptop keyboards too; one of my e6400
+has stuck keys.
+
+with this patch, grub should be a bit more reliable in
+terms of user experience, when the keyboard is faulty.
+
+Signed-off-by: Leah Rowe <leah@libreboot.org>
+---
+ grub-core/commands/keylayouts.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/grub-core/commands/keylayouts.c b/grub-core/commands/keylayouts.c
+index aa3ba34f2..445fa0601 100644
+--- a/grub-core/commands/keylayouts.c
++++ b/grub-core/commands/keylayouts.c
+@@ -174,7 +174,6 @@ grub_term_map_key (grub_keyboard_key_t code, int status)
+ key = map_key_core (code, status, &alt_gr_consumed);
+
+ if (key == 0 || key == GRUB_TERM_SHIFT) {
+- grub_printf ("Unknown key 0x%x detected\n", code);
+ return GRUB_TERM_NO_KEY;
+ }
+
+--
+2.39.2
+
--
2.39.2
- [PATCH 01/20] Use GRUB 2.12, Leah Rowe, 2024/01/14
- [PATCH 03/20] GRUB: Force scancode set 2 with translation, Leah Rowe, 2024/01/14
- [PATCH 05/20] GRUB: Avoid printing frivilous error messages, Leah Rowe, 2024/01/14
- [PATCH 04/20] GRUB: Don't spew "Unknown key 0xFF",
Leah Rowe <=
- [PATCH 02/20] Argon2 KDF support in GRUB 2.12, Leah Rowe, 2024/01/14
- [PATCH 06/20] GRUB: Use reduced set of modules, Leah Rowe, 2024/01/14
- [PATCH 07/20] grub.cfg: support ESP, btrfs subvols and extlinux, Leah Rowe, 2024/01/14
- [PATCH 09/20] build/boot/roms: skip building gnat on fam15h, Leah Rowe, 2024/01/14
- [PATCH 11/20] import util/dell-flash-unlock from lbmk 09bed9a4, Leah Rowe, 2024/01/14
- [PATCH 10/20] NEW MAINBOARD: Dell Latitude E6400, Leah Rowe, 2024/01/14
- [PATCH 14/20] build/boot/roms: support "normal" seabios configs, Leah Rowe, 2024/01/14
- [PATCH 13/20] use seabios revision from canoeboot 20231103, Leah Rowe, 2024/01/14
- [PATCH 12/20] import util/nvmutil from lbmk 09bed9a4, Leah Rowe, 2024/01/14
- [PATCH 15/20] coreboot/e6400_4mb: enable the grub payload, Leah Rowe, 2024/01/14