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