[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GRUB2: Possible to change keyboard layout in stage 1.5?

From: Quard
Subject: Re: GRUB2: Possible to change keyboard layout in stage 1.5?
Date: Fri, 6 Oct 2017 22:05:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1


It would seem that GRUB2 does in fact support custom keyboard layouts by
using the "at_keyboard.mod" and "keylayouts.mod" modules.

Because the /boot is encrypted (stage 2 therefore inaccessible) and the
cryptodisks enabled (GRUB_ENABLE_CRYPTODISK=y), the GRUB2 setup script
has to copy some extra code into the embedded area to unlock the root
partition and access stage 2, kernel and initrd.

I'm assuming this extra code comes from the appropriate GRUB2 modules
located in /boot/grub/i386-pc/ folder i.e. luks.mod, cryptodisk.mod,
gcry_sha512.mod, etc. If so, am I safe to assume that other modules can
also be exported into the embedded area (provided they are needed)? That
includes at_keyboard and keylayouts.

If so, then this setup should be working, but it isn't.

Like suggested on the links below, a custom layout file was created:
# grub-kbdcomp -o /boot/grub/si.gkb si

The following line was added to /etc/default/grub:

Custom commands were added to /etc/grub.d/40_custom:
exec tail -n +3 $0
insmod keylayouts
keymap /boot/grub/si.gkb

And grub was updated with:
# update-grub
# grub-install /dev/sda

The thing is after the settings were updated, the embedded code hasn't
really changed. The following command produced the same output before
and after the above changes were applied:
# dd if=/dev/sda bs=512 count=2048 | sha1sum -




On 24. 09. 2017 21:09, Quard wrote:
> Greetings!
> Does GRUB2 currently support changing of keyboard layout from default US
> to some other country code for the password prompt when decrypting a
> LUKS encrypted container (GRUB_ENABLE_CRYPTODISK=y) at boot using the
> old MBR partition table?
> The /boot folder is actually a part of an encrypted rootfs, so stage 2
> is not accessible at this point. I believe the code has to be embedded
> somewhere in between LBA0 and the first partition on the disk (afaik
> this is called stage 1.5).
> Does GRUB2 currently support code for keyboard layout in that area?
> Regards!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]