summaryrefslogtreecommitdiff
path: root/script/build/boot/roms_helper
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-08 23:48:06 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-09 00:01:22 +0100
commita69e8548b360e288b3e534cfbc201a5fb410e885 (patch)
tree41429e3b49711fb3a410cd3d564e2b7e08980087 /script/build/boot/roms_helper
parent4a459b0217c45a9dbd761793b040be67502c4d7e (diff)
set grub.cfg timeout to 5s (10 on some boards)
target.cfg can now specify e.g. grub_timeout=20 this would then be inserted as timeout.cfg in cbfs, containing the instruction: set timeout=20 HP laptops need a bit of extra time, due to the delay caused by the EC bug workaround deployed in GRUB desktops in general need extra time. this too is set to 10s, like the HP laptops. only insert timeout.cfg if actually needed (declared in target.cfg), otherwise grub.cfg will default to 5s Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/build/boot/roms_helper')
-rwxr-xr-xscript/build/boot/roms_helper12
1 files changed, 9 insertions, 3 deletions
diff --git a/script/build/boot/roms_helper b/script/build/boot/roms_helper
index 4cfe4bf1..4057b889 100755
--- a/script/build/boot/roms_helper
+++ b/script/build/boot/roms_helper
@@ -41,6 +41,7 @@ displaymodes=""
payloads=""
keyboard_layouts=""
+grub_timeout=""
grub_scan_disk="undefined"
tree="undefined"
arch="undefined"
@@ -370,13 +371,18 @@ build_grub_roms() {
fi
- tmpscancfg=$(mktemp -t coreboot_rom.XXXXXXXXXX) ||
+ tmpcfg=$(mktemp -t coreboot_rom.XXXXXXXXXX) ||
err "mkGrubRom: cannot create temporary scan.cfg"
printf "set grub_scan_disk=\"%s\"\n" "${grub_scan_disk}" > \
- "${tmpscancfg}" || \
+ "${tmpcfg}" || \
err "mkGrubRom: cannot insert into temporary scan.cfg"
- "${cbfstool}" "${tmprompath}" add -f "${tmpscancfg}" -n scan.cfg \
+ "${cbfstool}" "${tmprompath}" add -f "${tmpcfg}" -n scan.cfg \
-t raw || err "mkGrubROM: cannot insert scan.cfg into CBFS"
+ printf "set timeout=%s\n" "${grub_timeout}" > "${tmpcfg}" || \
+ err "mkGrubRom: cannot insert into temporary timeout.cfg"
+ [ -z "${grub_timeout}" ] || \
+ "${cbfstool}" "${tmprompath}" add -f "${tmpcfg}" -n timeout.cfg \
+ -t raw || err "mkGrubROM: cannot insert timeout.cfg into CBFS"
keymaps=""
if [ -z ${keyboard_layouts} ]; then