dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

23d2ea
From c10ca57b760978f32d1d34d78cda9fd57e1e0bfa Mon Sep 17 00:00:00 2001
39700a
From: Vladimir Serbinenko <phcoder@gmail.com>
39700a
Date: Sun, 26 Jan 2014 03:31:10 +0100
27a4da
Subject: [PATCH 048/260] * grub-core/term/at_keyboard.c: Tolerate missing
23d2ea
 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
27a4da
index bbec1e70b..d37d4a6fc 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
27a4da
index f5071ce69..b4257e84a 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
-- 
27a4da
2.13.0
39700a