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

39700a
From 379cbd6233fe227544ff3073b60b295fe841b654 Mon Sep 17 00:00:00 2001
39700a
From: Vladimir Serbinenko <phcoder@gmail.com>
39700a
Date: Sun, 26 Jan 2014 03:31:10 +0100
39700a
Subject: [PATCH 048/143] 	* grub-core/term/at_keyboard.c: Tolerate
39700a
 missing keyboard.
39700a
39700a
---
39700a
 ChangeLog                    | 4 ++++
39700a
 grub-core/term/at_keyboard.c | 3 +++
39700a
 2 files changed, 7 insertions(+)
39700a
39700a
diff --git a/ChangeLog b/ChangeLog
39700a
index bbec1e7..d37d4a6 100644
39700a
--- a/ChangeLog
39700a
+++ b/ChangeLog
39700a
@@ -1,3 +1,7 @@
39700a
+2014-01-26  Vladimir Serbinenko  <phcoder@gmail.com>
39700a
+
39700a
+	* grub-core/term/at_keyboard.c: Tolerate missing keyboard.
39700a
+
39700a
 2014-01-26  Mike Gilbert <floppym@gentoo.org>
39700a
 
39700a
 	grub-install: support for partitioned partx loop devices.
39700a
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
39700a
index f5071ce..b4257e8 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;
39700a
-- 
39700a
1.9.3
39700a