build/payload/grub: 79 chars or less per line
Signed-off-by: Leah Rowe <leah@libreboot.org>fsdg20230625
parent
92bd18c45a
commit
db7e81612a
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# generate GRUB ELF files (coreboot payload) and configuration files
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -21,8 +21,9 @@
|
||||||
[ "x${DEBUG+set}" = 'xset' ] && set -v
|
[ "x${DEBUG+set}" = 'xset' ] && set -v
|
||||||
set -u -e
|
set -u -e
|
||||||
|
|
||||||
# This is where GRUB is expected to be (outside of the grub-assemble, instead in main checkout)
|
grubcfgsdir="resources/grub"
|
||||||
. "resources/grub/modules.list" # source
|
|
||||||
|
. "${grubcfgsdir}/modules.list"
|
||||||
|
|
||||||
printf "Creating GRUB payloads and configuration files\n"
|
printf "Creating GRUB payloads and configuration files\n"
|
||||||
|
|
||||||
|
@ -39,37 +40,44 @@ fi
|
||||||
|
|
||||||
rm -f payload/grub/*
|
rm -f payload/grub/*
|
||||||
|
|
||||||
# Separate GRUB payload per keymap. This saves space in the ROM, otherwise
|
# Separate GRUB payload per keymap to save space in ROM.
|
||||||
# a lot of space would be used if every keymap was stored in a single image
|
|
||||||
|
|
||||||
for keylayoutfile in resources/grub/keymap/*.gkb; do
|
for keylayoutfile in ${grubcfgsdir}/keymap/*.gkb; do
|
||||||
if [ ! -f "${keylayoutfile}" ]; then
|
if [ ! -f "${keylayoutfile}" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
keymap="${keylayoutfile##resources/grub/keymap/}"
|
keymap="${keylayoutfile##${grubcfgsdir}/keymap/}"
|
||||||
keymap="${keymap%.gkb}"
|
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/grub-mkstandalone \
|
||||||
--grub-mkimage="grub/grub-mkimage" \
|
--grub-mkimage="grub/grub-mkimage" \
|
||||||
-O i386-coreboot \
|
-O i386-coreboot \
|
||||||
-o payload/grub/grub_${keymap}.elf \
|
-o payload/grub/grub_${keymap}.elf \
|
||||||
-d grub/grub-core/ \
|
-d grub/grub-core/ \
|
||||||
--fonts= --themes= --locales= \
|
--fonts= --themes= --locales= \
|
||||||
--modules="${grub_modules}" \
|
--modules="${grub_modules}" \
|
||||||
--install-modules="${grub_install_modules}" \
|
--install-modules="${grub_install_modules}" \
|
||||||
/boot/grub/grub.cfg=resources/grub/config/grub_memdisk.cfg \
|
${gcfg} ${grubk}
|
||||||
/boot/grub/layouts/${keymap}.gkb=${keylayoutfile}
|
|
||||||
|
|
||||||
|
|
||||||
if [ "${keymap}" = "usqwerty" ]; then
|
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
|
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
|
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
|
done
|
||||||
|
|
||||||
printf "Done! Check payload/grub/ to see the files.\n\n"
|
printf "Done! Check payload/grub/ to see the files.\n\n"
|
||||||
|
|
Loading…
Reference in New Issue