2021-05-18 12:21:48 +00:00
|
|
|
---
|
|
|
|
title: GRUB payload
|
|
|
|
x-toc-enable: true
|
|
|
|
...
|
|
|
|
|
|
|
|
TODO: this guide should be reviewed and updated. Some info might be out of
|
|
|
|
date.
|
|
|
|
|
2022-11-23 01:26:21 +00:00
|
|
|
[GRUB](https://www.gnu.org/software/grub/) already has excellent
|
2022-11-14 02:31:12 +00:00
|
|
|
documentation, but there are aspects of libreboot that deserve special
|
|
|
|
treatment. libreboot provides the option to boot GNU GRUB directly, running on
|
2021-05-18 12:21:48 +00:00
|
|
|
bare metal (instead of using BIOS or UEFI services).
|
|
|
|
|
2022-11-23 01:26:21 +00:00
|
|
|
[The Linux section](../gnulinux/) also has libreboot-specific guides for
|
|
|
|
dealing with Linux distributions when using GRUB directly, in this
|
2021-05-18 12:21:48 +00:00
|
|
|
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:
|
|
|
|
|
2023-01-08 01:22:04 +00:00
|
|
|
ckbcomp fr > frazerty
|
2021-05-18 12:21:48 +00:00
|
|
|
|
|
|
|
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/)
|
|
|
|
|
2022-11-14 02:31:12 +00:00
|
|
|
When you've built GRUB, using `lbmk` (libreboot build system), take your kepmap
|
2021-05-18 12:21:48 +00:00
|
|
|
file (generated by ckbcomp) and run it through `grub-mklayout` like so:
|
|
|
|
|
2023-01-08 01:22:04 +00:00
|
|
|
cat frazerty | ./grub/grub-mklayout -o frazerty.gkb
|
2021-05-18 12:21:48 +00:00
|
|
|
|
2022-11-14 02:31:12 +00:00
|
|
|
Place the newly created `.gkb` file under `resources/grub/keymap` in lbmk. When
|
|
|
|
you build libreboot, a ROM image with GRUB payload and your newly created
|
2021-05-18 12:21:48 +00:00
|
|
|
keymap will be available under the `bin/` directory.
|
2022-11-14 02:31:12 +00:00
|
|
|
[Learn how to build libreboot ROM images](../build/)
|
2021-05-18 12:21:48 +00:00
|
|
|
|
2022-11-14 02:31:12 +00:00
|
|
|
Many keymaps exist in the libreboot build system, but sometimes you must
|
2021-05-18 12:21:48 +00: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.
|
|
|
|
|
2022-11-14 02:31:12 +00:00
|
|
|
If you've added a keymap to lbmk, and it works,
|
2021-05-18 12:21:48 +00:00
|
|
|
[please submit a patch!](../../git.md)
|