summaryrefslogtreecommitdiff
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
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>
-rw-r--r--config/coreboot/g43t-am3/target.cfg1
-rw-r--r--config/coreboot/g43t-am3_16mb/target.cfg1
-rw-r--r--config/coreboot/ga-g41m-es2l/target.cfg1
-rw-r--r--config/coreboot/hp2170p_16mb/target.cfg1
-rw-r--r--config/coreboot/hp2560p_8mb/target.cfg1
-rw-r--r--config/coreboot/hp2570p_16mb/target.cfg1
-rw-r--r--config/coreboot/hp8200sff_4mb/target.cfg1
-rw-r--r--config/coreboot/hp8200sff_8mb/target.cfg1
-rw-r--r--config/coreboot/hp8300usdt_16mb/target.cfg1
-rw-r--r--config/coreboot/hp8470pintel_16mb/target.cfg1
-rw-r--r--config/coreboot/hp9470m_16mb/target.cfg1
-rw-r--r--config/coreboot/kfsn4-dre_1mb/target.cfg1
-rw-r--r--config/coreboot/kfsn4-dre_2mb/target.cfg1
-rw-r--r--config/coreboot/kgpe-d16-rdimm_16mb/target.cfg1
-rw-r--r--config/coreboot/kgpe-d16-rdimm_2mb/target.cfg1
-rw-r--r--config/coreboot/kgpe-d16-udimm_16mb/target.cfg1
-rw-r--r--config/coreboot/kgpe-d16-udimm_2mb/target.cfg1
-rw-r--r--config/grub/config/grub.cfg6
-rwxr-xr-xscript/build/boot/roms_helper12
19 files changed, 31 insertions, 4 deletions
diff --git a/config/coreboot/g43t-am3/target.cfg b/config/coreboot/g43t-am3/target.cfg
index a71ee06d..facdd5b5 100644
--- a/config/coreboot/g43t-am3/target.cfg
+++ b/config/coreboot/g43t-am3/target.cfg
@@ -5,3 +5,4 @@ payload_seabios="y"
payload_memtest="y"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/g43t-am3_16mb/target.cfg b/config/coreboot/g43t-am3_16mb/target.cfg
index a71ee06d..facdd5b5 100644
--- a/config/coreboot/g43t-am3_16mb/target.cfg
+++ b/config/coreboot/g43t-am3_16mb/target.cfg
@@ -5,3 +5,4 @@ payload_seabios="y"
payload_memtest="y"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/ga-g41m-es2l/target.cfg b/config/coreboot/ga-g41m-es2l/target.cfg
index 7d15972b..2bdf0e76 100644
--- a/config/coreboot/ga-g41m-es2l/target.cfg
+++ b/config/coreboot/ga-g41m-es2l/target.cfg
@@ -6,3 +6,4 @@ payload_memtest="y"
grub_scan_disk="ata"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/hp2170p_16mb/target.cfg b/config/coreboot/hp2170p_16mb/target.cfg
index f5dfa8d8..784e020b 100644
--- a/config/coreboot/hp2170p_16mb/target.cfg
+++ b/config/coreboot/hp2170p_16mb/target.cfg
@@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/hp2560p_8mb/target.cfg b/config/coreboot/hp2560p_8mb/target.cfg
index f5dfa8d8..784e020b 100644
--- a/config/coreboot/hp2560p_8mb/target.cfg
+++ b/config/coreboot/hp2560p_8mb/target.cfg
@@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/hp2570p_16mb/target.cfg b/config/coreboot/hp2570p_16mb/target.cfg
index f5dfa8d8..784e020b 100644
--- a/config/coreboot/hp2570p_16mb/target.cfg
+++ b/config/coreboot/hp2570p_16mb/target.cfg
@@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/hp8200sff_4mb/target.cfg b/config/coreboot/hp8200sff_4mb/target.cfg
index 3b1ace62..1467dcd2 100644
--- a/config/coreboot/hp8200sff_4mb/target.cfg
+++ b/config/coreboot/hp8200sff_4mb/target.cfg
@@ -5,3 +5,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/hp8200sff_8mb/target.cfg b/config/coreboot/hp8200sff_8mb/target.cfg
index 3b1ace62..1467dcd2 100644
--- a/config/coreboot/hp8200sff_8mb/target.cfg
+++ b/config/coreboot/hp8200sff_8mb/target.cfg
@@ -5,3 +5,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/hp8300usdt_16mb/target.cfg b/config/coreboot/hp8300usdt_16mb/target.cfg
index 3b1ace62..1467dcd2 100644
--- a/config/coreboot/hp8300usdt_16mb/target.cfg
+++ b/config/coreboot/hp8300usdt_16mb/target.cfg
@@ -5,3 +5,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/hp8470pintel_16mb/target.cfg b/config/coreboot/hp8470pintel_16mb/target.cfg
index f5dfa8d8..784e020b 100644
--- a/config/coreboot/hp8470pintel_16mb/target.cfg
+++ b/config/coreboot/hp8470pintel_16mb/target.cfg
@@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/hp9470m_16mb/target.cfg b/config/coreboot/hp9470m_16mb/target.cfg
index f5dfa8d8..784e020b 100644
--- a/config/coreboot/hp9470m_16mb/target.cfg
+++ b/config/coreboot/hp9470m_16mb/target.cfg
@@ -6,3 +6,4 @@ payload_grub_withseabios="y"
payload_seabios="y"
payload_memtest="y"
grub_scan_disk="ahci"
+grub_timeout=10
diff --git a/config/coreboot/kfsn4-dre_1mb/target.cfg b/config/coreboot/kfsn4-dre_1mb/target.cfg
index e7863a3e..4f009b44 100644
--- a/config/coreboot/kfsn4-dre_1mb/target.cfg
+++ b/config/coreboot/kfsn4-dre_1mb/target.cfg
@@ -6,3 +6,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/kfsn4-dre_2mb/target.cfg b/config/coreboot/kfsn4-dre_2mb/target.cfg
index e9d7512a..b13f2309 100644
--- a/config/coreboot/kfsn4-dre_2mb/target.cfg
+++ b/config/coreboot/kfsn4-dre_2mb/target.cfg
@@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/kgpe-d16-rdimm_16mb/target.cfg b/config/coreboot/kgpe-d16-rdimm_16mb/target.cfg
index 5fe0f9e6..8e768bba 100644
--- a/config/coreboot/kgpe-d16-rdimm_16mb/target.cfg
+++ b/config/coreboot/kgpe-d16-rdimm_16mb/target.cfg
@@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/kgpe-d16-rdimm_2mb/target.cfg b/config/coreboot/kgpe-d16-rdimm_2mb/target.cfg
index 5fe0f9e6..8e768bba 100644
--- a/config/coreboot/kgpe-d16-rdimm_2mb/target.cfg
+++ b/config/coreboot/kgpe-d16-rdimm_2mb/target.cfg
@@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/kgpe-d16-udimm_16mb/target.cfg b/config/coreboot/kgpe-d16-udimm_16mb/target.cfg
index b4215683..c17e207a 100644
--- a/config/coreboot/kgpe-d16-udimm_16mb/target.cfg
+++ b/config/coreboot/kgpe-d16-udimm_16mb/target.cfg
@@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/coreboot/kgpe-d16-udimm_2mb/target.cfg b/config/coreboot/kgpe-d16-udimm_2mb/target.cfg
index b4215683..c17e207a 100644
--- a/config/coreboot/kgpe-d16-udimm_2mb/target.cfg
+++ b/config/coreboot/kgpe-d16-udimm_2mb/target.cfg
@@ -7,3 +7,4 @@ payload_memtest="y"
crossgcc_ada="n"
microcode_required="n"
blobs_required="n"
+grub_timeout=10
diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg
index 586eb145..64fe9b3d 100644
--- a/config/grub/config/grub.cfg
+++ b/config/grub/config/grub.cfg
@@ -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
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