roms: simplify timeout/scandisk insertion

we don't need to call mktemp everytime.
just use a staticly named file in tmpdir
and keep overwriting it.

these files are only small, and they get deleted
when the build system exits later on.

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6-merge1
Leah Rowe 2024-06-16 01:08:08 +01:00
parent 3a7b3660f9
commit 0e9b36c581
1 changed files with 1 additions and 2 deletions

View File

@ -250,14 +250,13 @@ build_grub_roms()
# we only need insert grub.elf once, for each coreboot config: # we only need insert grub.elf once, for each coreboot config:
cbfs "$tmprom" "$grubelf" "$grub_cbfs" cbfs "$tmprom" "$grubelf" "$grub_cbfs"
tmpcfg="$(mktemp -t coreboot_rom.XXXXXXXXXX)" tmpcfg="$tmpdir/tmpcfg"
printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" > "$tmpcfg" || \ printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" > "$tmpcfg" || \
$err "set grub_scan_disk, $grub_scan_disk, $tmpcfg" $err "set grub_scan_disk, $grub_scan_disk, $tmpcfg"
cbfs "$tmprom" "$tmpcfg" scan.cfg raw cbfs "$tmprom" "$tmpcfg" scan.cfg raw
printf "set timeout=%s\n" "$grub_timeout" > "$tmpcfg" || \ printf "set timeout=%s\n" "$grub_timeout" > "$tmpcfg" || \
$err "set timeout, $grub_timeout, $tmpcfg" $err "set timeout, $grub_timeout, $tmpcfg"
[ -z "$grub_timeout" ] || cbfs "$tmprom" "$tmpcfg" timeout.cfg raw [ -z "$grub_timeout" ] || cbfs "$tmprom" "$tmpcfg" timeout.cfg raw
x_ rm -f "$tmpcfg"
newrom="$romdir/${payload1}_${board}_${initmode}_$displaymode.rom" newrom="$romdir/${payload1}_${board}_${initmode}_$displaymode.rom"
[ "$initmode" = "normal" ] && newrom="$romdir/${payload1}_" \ [ "$initmode" = "normal" ] && newrom="$romdir/${payload1}_" \