LinuxCommandLibrary

grub-mklayout

Create keyboard layout files for GRUB

SYNOPSIS

grub-mklayout input.kmap output.gkb

PARAMETERS

input.kmap
    The input keyboard map file, typically in `.kmap` format.

output.gkb
    The output GRUB keyboard layout file, in `.gkb` format.

DESCRIPTION

The `grub-mklayout` command is a utility that generates keyboard layout files for use with GRUB (the GRand Unified Bootloader). These layout files enable users to enter passwords or perform other actions at the GRUB prompt using a keyboard layout other than the default US layout. It takes a keymap file as input and outputs a GRUB-compatible keyboard layout file. The utility is typically used to create keymaps for languages other than English, allowing users to enter passwords and interact with the GRUB menu using their native keyboard layout. It is particularly useful in multi-boot environments where users may need to enter encrypted passwords to unlock specific operating systems or partitions. The generated layout files are then placed in the `/boot/grub/i386-pc/keymaps` directory and can be loaded using the `loadfont` and `keymap` commands within the `grub.cfg` file. `grub-mklayout` simplifies the process of creating functional keyboard layouts for GRUB, enhancing the user experience when interacting with the bootloader.

USAGE

Typical usage involves locating a suitable `.kmap` file (often found in `/usr/share/keymaps/i386/` or a similar location), and then running `grub-mklayout` to convert it to a `.gkb` file. The `.gkb` file is then placed in `/boot/grub/i386-pc/keymaps/` (or the appropriate directory for your architecture) and referenced in `grub.cfg` using the `loadfont` and `keymap` commands.
For example:
loadfont (hd0,1)/boot/grub/fonts/unicode.pf2
keymap (hd0,1)/boot/grub/keymaps/fr.gkb

SEE ALSO

grub-install(1), grub-mkconfig(8), grub-update(8)

Copied to clipboard