summaryrefslogtreecommitdiff
path: root/resources/scripts/build/payload/grub
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-20 19:55:11 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-20 19:55:40 +0100
commitdb7e81612ade9e0a89b312e536c47d612f8e1088 (patch)
tree97832c666d91d9205035a4f46efebda6edc1756a /resources/scripts/build/payload/grub
parent92bd18c45aa1fea5b88d5d0603057b7cba689721 (diff)
build/payload/grub: 79 chars or less per line
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'resources/scripts/build/payload/grub')
-rwxr-xr-xresources/scripts/build/payload/grub48
1 files changed, 28 insertions, 20 deletions
diff --git a/resources/scripts/build/payload/grub b/resources/scripts/build/payload/grub
index e7cca4a8..020a5cbc 100755
--- a/resources/scripts/build/payload/grub
+++ b/resources/scripts/build/payload/grub
@@ -2,7 +2,7 @@
# generate GRUB ELF files (coreboot payload) and configuration files
#
-# Copyright (C) 2014, 2015, 2020, 2021 Leah Rowe <info@minifree.org>
+# Copyright (C) 2014,2015,2020,2021,2023 Leah Rowe <info@minifree.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,8 +21,9 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
-# This is where GRUB is expected to be (outside of the grub-assemble, instead in main checkout)
-. "resources/grub/modules.list" # source
+grubcfgsdir="resources/grub"
+
+. "${grubcfgsdir}/modules.list"
printf "Creating GRUB payloads and configuration files\n"
@@ -39,37 +40,44 @@ fi
rm -f payload/grub/*
-# Separate GRUB payload per keymap. This saves space in the ROM, otherwise
-# a lot of space would be used if every keymap was stored in a single image
+# Separate GRUB payload per keymap to save space in ROM.
-for keylayoutfile in resources/grub/keymap/*.gkb; do
+for keylayoutfile in ${grubcfgsdir}/keymap/*.gkb; do
if [ ! -f "${keylayoutfile}" ]; then
continue
fi
- keymap="${keylayoutfile##resources/grub/keymap/}"
+ keymap="${keylayoutfile##${grubcfgsdir}/keymap/}"
keymap="${keymap%.gkb}"
+ gcfg="/boot/grub/grub.cfg=${grubcfgsdir}"
+ gcfg="${gcfg}/config/grub_memdisk.cfg"
+ grubk="/boot/grub/layouts/${keymap}.gkb=${keylayoutfile}"
grub/grub-mkstandalone \
- --grub-mkimage="grub/grub-mkimage" \
- -O i386-coreboot \
- -o payload/grub/grub_${keymap}.elf \
- -d grub/grub-core/ \
- --fonts= --themes= --locales= \
- --modules="${grub_modules}" \
- --install-modules="${grub_install_modules}" \
- /boot/grub/grub.cfg=resources/grub/config/grub_memdisk.cfg \
- /boot/grub/layouts/${keymap}.gkb=${keylayoutfile}
+ --grub-mkimage="grub/grub-mkimage" \
+ -O i386-coreboot \
+ -o payload/grub/grub_${keymap}.elf \
+ -d grub/grub-core/ \
+ --fonts= --themes= --locales= \
+ --modules="${grub_modules}" \
+ --install-modules="${grub_install_modules}" \
+ ${gcfg} ${grubk}
if [ "${keymap}" = "usqwerty" ]; then
- cp resources/grub/config/grub.cfg payload/grub/grub_usqwerty.cfg
+ cp ${grubcfgsdir}/config/grub.cfg \
+ payload/grub/grub_usqwerty.cfg
else
- sed "s/usqwerty/${keymap}/" < resources/grub/config/grub.cfg > payload/grub/grub_${keymap}.cfg
+ sed "s/usqwerty/${keymap}/" \
+ < ${grubcfgsdir}/config/grub.cfg \
+ > payload/grub/grub_${keymap}.cfg
fi
- sed "s/grubtest.cfg/grub.cfg/" < payload/grub/grub_${keymap}.cfg > payload/grub/grub_${keymap}_test.cfg
+ sed "s/grubtest.cfg/grub.cfg/" \
+ < payload/grub/grub_${keymap}.cfg \
+ > payload/grub/grub_${keymap}_test.cfg
- printf "Generated: 'payload/grub/grub_%s.elf' and configs.'\n" "${keymap}"
+ printf "Created 'payload/grub/grub_%s.elf' and configs.'\n" \
+ "${keymap}"
done
printf "Done! Check payload/grub/ to see the files.\n\n"