dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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