From a69e8548b360e288b3e534cfbc201a5fb410e885 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 8 Sep 2023 23:48:06 +0100 Subject: 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 --- script/build/boot/roms_helper | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'script/build') 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 -- cgit v1.2.1