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

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