summaryrefslogtreecommitdiff
path: root/config/grub
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-01-17 23:54:53 +0000
committerLeah Rowe <leah@libreboot.org>2024-01-18 00:27:33 +0000
commit37817e6bcb7c7272d7c70c3afe89a5b3b2604824 (patch)
treeb32b555e0b3fb8dcb643052402a2037a29b14f03 /config/grub
parentdf007d22ec801679b5e8f43ee861b78515518ce2 (diff)
GRUB: insert only 1 keymap per board, in cbfs
There is no need to add multiple keymap files, because GRUB can load keymaps from CBFS. The current build logic is designed to avoid building multiple GRUB binaries, which are expensive computationally because each one would then have to be compressed for each board. This patch provides the best of both worlds: less space used in flash like in the old lbmk design (1 keymap per board), but retaining the current build speeds and therefore not re-introducing the slowness of lbmk's previous GRUB build logic. The grub.cfg file has been modified, accordingly. It now only loads a keymap.gkb file from CBFS, by default. It does this, only if that file exists; if not, GRUB already defaults to US Qwerty layout anyway. ALSO: compress all keymap gkb files with xz -6 GRUB automatically decompresses files when accessed. This results in about 2KB of flash space saved in CBFS. Here is real-world data, showing the increased flash space: < fallback/payload 0x3eb80 simple elf 548821 none < keymap.cfg 0xc4bc0 raw 16 none < (empty) 0xc4c00 null 11633316 none --- > fallback/payload 0x3eb80 simple elf 546787 none > keymap.gkb 0xc43c0 raw 344 none > (empty) 0xc4540 null 11635044 none This was taken by diffing the cbfstool "print" output, both before and after. The *after* result is with this change. 11633316. In this example, 1728 bytes have been saved. Therefore, with compression taken into account, this patch saves about 1.7KB of space in CBFS. This change means that lbmk can now scale to support hundreds of keymaps, without increasing the amount of flash space used, in each given image. Since the keymap files are compressed in lbmk.git, in advance, we spend no additional time on compression at build time. The resulting change in build speed in negligible. Adding your own keymap.gkb file was already possible, for changing the keymap in libreboot images, if you didn't want to change the memdisk (and thus re-compile grub.elf). Now, this is the default behaviour, and the only way to do it. It's much more efficient. The original keymap files can be restored, by running unxz. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config/grub')
-rw-r--r--config/grub/config/grub.cfg4
-rw-r--r--config/grub/keymap/colemak.gkbbin2572 -> 488 bytes
-rw-r--r--config/grub/keymap/deqwertz.gkbbin2572 -> 508 bytes
-rw-r--r--config/grub/keymap/esqwerty.gkbbin2572 -> 492 bytes
-rw-r--r--config/grub/keymap/frazerty.gkbbin2572 -> 496 bytes
-rw-r--r--config/grub/keymap/frdvbepo.gkbbin2572 -> 516 bytes
-rw-r--r--config/grub/keymap/itqwerty.gkbbin2572 -> 488 bytes
-rw-r--r--config/grub/keymap/svenska.gkbbin2572 -> 488 bytes
-rw-r--r--config/grub/keymap/trqwerty.gkbbin2572 -> 476 bytes
-rw-r--r--config/grub/keymap/ukdvorak.gkbbin2572 -> 372 bytes
-rw-r--r--config/grub/keymap/ukqwerty.gkbbin2572 -> 488 bytes
-rw-r--r--config/grub/keymap/usdvorak.gkbbin2572 -> 364 bytes
-rw-r--r--config/grub/keymap/usqwerty.gkbbin2572 -> 344 bytes
13 files changed, 0 insertions, 4 deletions
diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg
index efc10aa4..17576b5f 100644
--- a/config/grub/config/grub.cfg
+++ b/config/grub/config/grub.cfg
@@ -38,10 +38,6 @@ fi
if [ -f (cbfsdisk)/keymap.gkb ]; then
keymap (cbfsdisk)/keymap.gkb
-elif [ -f (cbfsdisk)/keymap.cfg ]; then
- source (cbfsdisk)/keymap.cfg
-else
- keymap usqwerty
fi
function try_user_config {
diff --git a/config/grub/keymap/colemak.gkb b/config/grub/keymap/colemak.gkb
index 6756bd73..d357816b 100644
--- a/config/grub/keymap/colemak.gkb
+++ b/config/grub/keymap/colemak.gkb
Binary files differ
diff --git a/config/grub/keymap/deqwertz.gkb b/config/grub/keymap/deqwertz.gkb
index a0c8e5ae..4928d026 100644
--- a/config/grub/keymap/deqwertz.gkb
+++ b/config/grub/keymap/deqwertz.gkb
Binary files differ
diff --git a/config/grub/keymap/esqwerty.gkb b/config/grub/keymap/esqwerty.gkb
index 18bb537f..6ce76330 100644
--- a/config/grub/keymap/esqwerty.gkb
+++ b/config/grub/keymap/esqwerty.gkb
Binary files differ
diff --git a/config/grub/keymap/frazerty.gkb b/config/grub/keymap/frazerty.gkb
index c048cec5..f8455154 100644
--- a/config/grub/keymap/frazerty.gkb
+++ b/config/grub/keymap/frazerty.gkb
Binary files differ
diff --git a/config/grub/keymap/frdvbepo.gkb b/config/grub/keymap/frdvbepo.gkb
index c90b37cf..20702607 100644
--- a/config/grub/keymap/frdvbepo.gkb
+++ b/config/grub/keymap/frdvbepo.gkb
Binary files differ
diff --git a/config/grub/keymap/itqwerty.gkb b/config/grub/keymap/itqwerty.gkb
index f247cd17..db10a54c 100644
--- a/config/grub/keymap/itqwerty.gkb
+++ b/config/grub/keymap/itqwerty.gkb
Binary files differ
diff --git a/config/grub/keymap/svenska.gkb b/config/grub/keymap/svenska.gkb
index ec627db2..75ca762d 100644
--- a/config/grub/keymap/svenska.gkb
+++ b/config/grub/keymap/svenska.gkb
Binary files differ
diff --git a/config/grub/keymap/trqwerty.gkb b/config/grub/keymap/trqwerty.gkb
index 090454e9..452100d5 100644
--- a/config/grub/keymap/trqwerty.gkb
+++ b/config/grub/keymap/trqwerty.gkb
Binary files differ
diff --git a/config/grub/keymap/ukdvorak.gkb b/config/grub/keymap/ukdvorak.gkb
index c793cae8..76b9e380 100644
--- a/config/grub/keymap/ukdvorak.gkb
+++ b/config/grub/keymap/ukdvorak.gkb
Binary files differ
diff --git a/config/grub/keymap/ukqwerty.gkb b/config/grub/keymap/ukqwerty.gkb
index 8e5ff299..5f513d85 100644
--- a/config/grub/keymap/ukqwerty.gkb
+++ b/config/grub/keymap/ukqwerty.gkb
Binary files differ
diff --git a/config/grub/keymap/usdvorak.gkb b/config/grub/keymap/usdvorak.gkb
index 41301efd..ef88232c 100644
--- a/config/grub/keymap/usdvorak.gkb
+++ b/config/grub/keymap/usdvorak.gkb
Binary files differ
diff --git a/config/grub/keymap/usqwerty.gkb b/config/grub/keymap/usqwerty.gkb
index 5fb78d33..0ea130f2 100644
--- a/config/grub/keymap/usqwerty.gkb
+++ b/config/grub/keymap/usqwerty.gkb
Binary files differ