[Bug 1477394] Re: During boot with GRUB2, command keymap is accepted but has NO effect

Fabio Ornellas 1477394 at bugs.launchpad.net
Sun Jul 31 10:42:54 UTC 2022


This is still an issue with grub2_2.04-1ubuntu26.15.

I did some digging at Grub's source:

- keylayouts.c has grub_term_map_key() which does the actual mapping.
- This function is only referred by
  - at_keyboard.c (via ps2.c)
  - usb_keyboard.c

In my case, at GRUB command prompt, terminal_input tells:

- Current terminal is console.
- Neither at_keyboard nor usb_keyboard are available.

So no wonder keymap does not work...

I drafted the attached patch to term/efi/console.c and
i386/pc/console.c, which should make use of grub_term_map_key() and fix
the problem.

Unfortunately though, I cant build it because of the same build failure
as reported here
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1914953/comments/7
... I tried building things with:

apt-get source grub-pc-bin
cd grub2-2.04/
dpkg-buildpackage -rfakeroot -b

with Mint 20.3 (Ubuntu Focal), it should work, right?

Well, if we can sort this out this bulid issue, I can test my patch and
see if it works or not :-P


** Patch added: "Draft fix for missing keymap for efi / i386 consoles."
   https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1477394/+attachment/5606121/+files/fix.diff

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1477394

Title:
  During boot with GRUB2, command keymap is accepted but has NO effect

Status in grub2 package in Ubuntu:
  Expired

Bug description:
  I have a French keyboard, and I have generated a GRUB keyboard file with following command :
  #  grub-kbdcomp  -o /boot/grub/layouts/fr_oss.gkb  fr  oss

  Then inside GRUB2 command line interface, following commands are accepted, but GRUB2 still handles my USB keyboard as 'en_us'  :
    insmod  keylayouts
    keymap fr_oss

  
  I order to reproduce this bug :
  -  You need any keyboard which is NOT 'en_us',
  -  You can put following code in '/etc/grub.d/40_custom', issue 'sudo update-grub', then reboot :
  KEYBOARD_GRUB_FOLDER="/boot/grub/layouts"
  KEYBOARD_LAYOUT="$(setxkbmap -query  |  grep -i '^ *layout *:'  |  sed -e 's/^ *layout *: *//i')"
  KEYBOARD_VARIANT="$(setxkbmap -query  |  grep -i '^ *variant *:'  |  sed -e 's/^ *variant *: *//i')"
  KEYBOARD_SPEC="$KEYBOARD_LAYOUT"_"$KEYBOARD_VARIANT"
  KEYBOARD_PATH="$KEYBOARD_GRUB_FOLDER/$KEYBOARD_SPEC.gkb"
  grub-kbdcomp  -o "$KEYBOARD_PATH"  "$KEYBOARD_LAYOUT"  "$KEYBOARD_VARIANT"  2>&1  |  \
    grep -v '^Unknown keyboard scan '  > /dev/stderr
  if [ -f "$KEYBOARD_PATH" ]; then
    echo "# Try to tell GRUB to use the adequate keyboard layout"
    echo "insmod keylayouts"
    echo "keymap $KEYBOARD_SPEC"
  fi

  ProblemType: Bug
  DistroRelease: Ubuntu 15.04
  Package: grub2-common 2.02~beta2-22ubuntu1.1
  ProcVersionSignature: Ubuntu 3.19.0-23.24-generic 3.19.8-ckt2
  Uname: Linux 3.19.0-23-generic x86_64
  NonfreeKernelModules: fglrx
  ApportVersion: 2.17.2-0ubuntu1.1
  Architecture: amd64
  CurrentDesktop: X-Cinnamon
  Date: Thu Jul 23 06:45:21 2015
  InstallationDate: Installed on 2015-07-20 (2 days ago)
  InstallationMedia: Ubuntu-GNOME 15.04 "Vivid Vervet" - Release amd64 (20150422)
  SourcePackage: grub2
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1477394/+subscriptions




More information about the foundations-bugs mailing list