Subject: bug#35585: GRUB does not work with USB keyboards when using keyboard-layout

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Sun, 5 May 2019 19:35:44 +0200

In the bootloader menu, input from a USB external keyboard or a
Macbook’s built-in USB keyboard is ignored by GRUB.  This makes it
impossible to choose which generation to boot.  The passphrase of an
encrypted boot partition can be entered though (with US English
keyboard layout instead of the chosen layout).

The attached patch makes the USB keyboard work in the bootloader menu,
but it uses US English layout instead of the chosen layout too.  Also
the patch is just imitating what is already in gnu/bootloader/grub.scm
but I do not actually know what I’m doing.

Regards,
Florian

>From c0c8167cf4f7ddd68567618effc665dd950c2f93 Mon Sep 17 00:00:00 2001
From: Florian Pelz <[email-masked]>
Date: Sun, 5 May 2019 17:38:47 +0200
Subject: [PATCH] bootloader: grub: Support USB keyboards when using a
 keyboard-layout.

With this USB keyboards are recognized again, the layout does not currently
get used by GRUB though.

* gnu/booloader/grub.scm (keyboard-layout-config): Add usb_keyboard terminal
to terminal_input command.
---
 gnu/bootloader/grub.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index e97a17b3e2..a99e5286ca 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -360,7 +360,7 @@ entries corresponding to old generations of the system."
                              (keyboard-layout-file layout #:grub grub))))
           (when keymap
             (format port "\
-terminal_input at_keyboard
+terminal_input at_keyboard usb_keyboard
 insmod keylayouts
 keymap ~a~%" keymap)))))
 
-- 
2.21.0