File: at_keyboard-module-init.patch

package info (click to toggle)
grub2 2.12-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-proposed-updates, trixie-updates
  • size: 70,780 kB
  • sloc: ansic: 424,740; asm: 16,228; sh: 9,525; cpp: 2,095; makefile: 1,590; python: 1,468; sed: 431; lex: 393; yacc: 268; awk: 85; lisp: 54; perl: 31
file content (43 lines) | stat: -rw-r--r-- 1,396 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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 f8a129e..3dbf89c 100644
--- a/grub-core/term/at_keyboard.c
+++ b/grub-core/term/at_keyboard.c
@@ -254,6 +254,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)
 {
@@ -324,6 +332,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
   };