Howto change the grub2 keymap

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
caprona
Posts: 3
Joined: 2012-03-05 16:58

Howto change the grub2 keymap

#1 Post by caprona »

Grub2 is installed with a standard qwerty keymap and if that is not what you use, having to type in the grub terminal is painful. This howto shows a way to change that.
Inspiration came from http://us.generation-nt.com/answer/bug- ... 51752.html and https://wiki.archlinux.org/index.php/Talk:GRUB2

Everything here will be done as root so be sure to read through first then su or sudo as you prefer.

First make a keymap, dvorak will be used for this example, substitute your layout name as needed.

Code: Select all

ckbcomp dvorak | grub-mklayout -o /boot/grub/dvorak.gkb
There will be errors, for dvorak they were harmless, for other layouts I have no way to know.

edit /etc/default/grub and add the line

Code: Select all

GRUB_TERMINAL_INPUT=at_keyboard
Now we need to tell the update-grub scripts to use the new keymap.
Add the following two lines at the end of /etc/grub.d/00_header

Code: Select all

echo 'insmod keylayouts'
echo 'keymap /boot/grub/dvorak.gkb'
If you have a seperate boot partition then change the second line to

Code: Select all

echo 'keymap /grub/dvorak.gkb'
Lastly

Code: Select all

update-grub
Reboot and enjoy.

Note: On my machine I find typing in grub slow and unresponsive but it is way less painfull than having to remember where dreaded qwerty keys are.

User avatar
phenest
Posts: 1704
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Howto change the grub2 keymap

#2 Post by phenest »

Code: Select all

$ ckbcomp dvorak | grub-mklayout -o /boot/grub/dvorak.gkb
grub-mklayout: command not found
It's not in Squeeze, but it's in Wheezy. Must be a new feature.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

Post Reply