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>
btrfsvols
Leah Rowe 2023-09-08 23:48:06 +01:00
parent 4a459b0217
commit a69e8548b3
19 changed files with 31 additions and 4 deletions

View File

@ -5,3 +5,4 @@ payload_seabios="y"
payload_memtest="y"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -5,3 +5,4 @@ payload_seabios="y"
payload_memtest="y"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -6,3 +6,4 @@ payload_memtest="y"
grub_scan_disk="ata"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -5,3 +5,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -5,3 +5,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -5,3 +5,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
grub_timeout=10

View File

@ -6,3 +6,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
grub_timeout=10

View File

@ -26,7 +26,11 @@ elif [ -f (cbfsdisk)/background.jpg ]; then
fi
set default="0"
set timeout=30
if [ -f (cbfsdisk)/timeout.cfg ]; then
source (cbfsdisk)/timeout.cfg
else
set timeout=5
fi
set pager=1
set grub_scan_disk="both"
if [ -f (cbfsdisk)/scan.cfg ]; then

View File

@ -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