Change keymap on Stage 1 Boot (GRUB LUKS2 unlock)

Hello!

I’m using a German language keyboard, and on the GRUB2 unlock for LUKS2, it defaults to the US keyboard layout. Is there a way to change that? I found this for Ubuntu, not sure what the equivalent Fedora config files will be.

Also, would there be a nice way to add retries to the unlock? Again, I found this thread, is there a way to use it?

Okay, it seems like the AskUbuntu thread was bad advice. Replacing grub-kbdcomp with grub2-kbdcomp; /boot/grub with /boot/grub2 and update-grub with grub2-mkconfig -o /boot/grub2/grub.cfg, not only did the keymap change not work, the Grub menu (where one can choose different kernels) didn’t react to keystrokes anymore. This is even though I have a USB keyboard.

Luckily, I was able to roll-back the changes.

I did a bit of searching and the best clue I found was to the grub-mklayout command. It says that tool makes layouts for grub use.

Thanks, it seems grub2-kbdcomp is just a wrapper for ckbcomp and grub2-mklayout. It does solve the problem of creating a layout, but I still have no idea how to get GRUB to use it safely.

Have you read the docs? I assume that is where you will find out where to configure keyboard. GRUB - GNU Project - Free Software Foundation

Just to check does grub unlock luks?
I have always seen the unlocking being done by the linux kernel.

It does indeed.

Here is the guide I used to install.

I just looked – Sadly all mentions of keymap are missing from those docs. at_keyboard and usb_keyboard are mentioned, but none of the caveats around them.

You might try asking the grub developers on their mailing list or bugtracker how to do this.

1 Like