dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch

28f7f8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
39700a
From: Vladimir Serbinenko <phcoder@gmail.com>
39700a
Date: Sun, 26 Jan 2014 03:31:10 +0100
28f7f8
Subject: [PATCH] * grub-core/term/at_keyboard.c: Tolerate missing keyboard.
39700a
39700a
---
39700a
 grub-core/term/at_keyboard.c | 3 +++
28f7f8
 ChangeLog                    | 4 ++++
39700a
 2 files changed, 7 insertions(+)
39700a
39700a
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
28f7f8
index f5071ce69e8..b4257e84a04 100644
39700a
--- a/grub-core/term/at_keyboard.c
39700a
+++ b/grub-core/term/at_keyboard.c
39700a
@@ -396,6 +396,9 @@ fetch_key (int *is_break)
39700a
   if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
39700a
     return -1;
39700a
   at_key = grub_inb (KEYBOARD_REG_DATA);
39700a
+  /* May happen if no keyboard is connected. Just ignore this.  */
39700a
+  if (at_key == 0xff)
39700a
+    return -1;
39700a
   if (at_key == 0xe0)
39700a
     {
39700a
       e0_received = 1;
28f7f8
diff --git a/ChangeLog b/ChangeLog
28f7f8
index bbec1e70bbd..d37d4a6fc16 100644
28f7f8
--- a/ChangeLog
28f7f8
+++ b/ChangeLog
28f7f8
@@ -1,3 +1,7 @@
28f7f8
+2014-01-26  Vladimir Serbinenko  <phcoder@gmail.com>
28f7f8
+
28f7f8
+	* grub-core/term/at_keyboard.c: Tolerate missing keyboard.
28f7f8
+
28f7f8
 2014-01-26  Mike Gilbert <floppym@gentoo.org>
28f7f8
 
28f7f8
 	grub-install: support for partitioned partx loop devices.