2021-05-18 14:21:48 +02:00
|
|
|
---
|
|
|
|
title: GRUB payload
|
|
|
|
...
|
|
|
|
|
|
|
|
TODO: this guide should be reviewed and updated. Some info might be out of
|
|
|
|
date.
|
|
|
|
|
|
|
|
[GNU GRUB](https://www.gnu.org/software/grub/) already has excellent
|
2024-11-11 22:07:49 +01:00
|
|
|
documentation, but there are aspects of GNU Boot that deserve special
|
|
|
|
treatment. GNU Boot provides the option to boot GNU GRUB directly, running on
|
2021-05-18 14:21:48 +02:00
|
|
|
bare metal (instead of using BIOS or UEFI services).
|
|
|
|
|
2024-11-11 22:07:49 +01:00
|
|
|
[The GNU+Linux section](../gnulinux/) also has GNU Boot specific guides for
|
2021-05-18 14:21:48 +02:00
|
|
|
dealing with GNU+Linux distributions when using GNU GRUB directly, in this
|
|
|
|
setup. [A similar section exists for BSD operating systems](../bsd/)
|
|
|
|
|
|
|
|
GRUB keyboard layouts
|
|
|
|
=====================
|
|
|
|
|
|
|
|
It is possible to use *any* keymap in GNU GRUB.
|
|
|
|
|
|
|
|
Custom keyboard layout
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
Keymaps are stored in `resources/grub/keymap/`
|
|
|
|
|
|
|
|
You can use the `ckbcomp` program to generate a keymap, based on Xorg keymap
|
|
|
|
files:
|
|
|
|
|
|
|
|
ckbcomp fr > frazerty
|
|
|
|
|
|
|
|
When you build GRUB from source, you can use the `grub-mklayout` program to
|
|
|
|
create a special keymap file for GRUB. [Learn how to build GRUB](../build/)
|
|
|
|
|
2024-11-11 22:07:49 +01:00
|
|
|
When you've built GRUB, using GNU Boot, take your kepmap file (generated by
|
|
|
|
ckbcomp) and run it through `grub-mklayout` like so:
|
2021-05-18 14:21:48 +02:00
|
|
|
|
|
|
|
cat frazerty | ./grub/grub-mklayout -o frazerty.gkb
|
|
|
|
|
|
|
|
Place the newly created `.gkb` file under `resources/grub/keymap` in lbmk. When
|
2024-11-11 22:07:49 +01:00
|
|
|
you build GNU Boot, an image with GRUB payload and your newly created
|
2021-05-18 14:21:48 +02:00
|
|
|
keymap will be available under the `bin/` directory.
|
2024-11-11 22:07:49 +01:00
|
|
|
[Learn how to build GNU Boot images](../build/)
|
2021-05-18 14:21:48 +02:00
|
|
|
|
2024-11-11 22:07:49 +01:00
|
|
|
Many keymaps exist in the GNU Boot build system, but sometimes you must
|
2021-05-18 14:21:48 +02:00
|
|
|
manually tweak the file created by `ckbcomp`, adjusting the scan codes in that
|
|
|
|
file, before converting to a GRUB keymap file. Therefore, it would be unwise to
|
|
|
|
automatically add all keymaps in GRUB.
|
|
|
|
|
|
|
|
If you've added a keymap to lbmk, and it works,
|
2024-11-11 22:07:47 +01:00
|
|
|
[please submit a patch!](../../contribute.md)
|