diff options
author | Leah Rowe <leah@libreboot.org> | 2025-04-17 23:43:22 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-04-17 23:43:22 +0100 |
commit | e07a2adb130e86cf78fc1ee77a4d8b233a65cedf (patch) | |
tree | 322fef83ab84abebe14c05b3b4f9be9b7912f0c9 /include/rom.sh | |
parent | 9d3b52cd1d2c91912476ac4622ef33726e349e54 (diff) |
lbmk: don't handle TMPDIR directly
lbmk creates TMPDIR as /tmp/xbmk_*, but it's theoretically
possible that something could re-export it by mistake.
this change retains the same initialisation, but further
use is now via a new variable "xbmktmp", that stores the
value of TMPDIR upon lbmk's initialisation of it.
this reduces the chance of such a bug in the future, as
described above, so it is a preemptive/preventative fix.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/rom.sh')
-rw-r--r-- | include/rom.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/rom.sh b/include/rom.sh index 4ec473e5..710df853 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -12,7 +12,8 @@ mkserprog() [ "$1" = "pico" ] && mkpicotool - basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR" + basename -as .h "$serdir/"*.h > "$xbmktmp/ser" || \ + $err "!mk $1 $xbmktmp" while read -r sertarget; do [ "$1" = "pico" ] && @@ -31,7 +32,7 @@ mkserprog() "$sersrc" BOARD=$sertarget x_ mkdir -p "bin/serprog_$1" x_ mv "$serx" "bin/serprog_$1/serprog_$sertarget.${serx##*.}" - done < "$TMPDIR/ser" + done < "$xbmktmp/ser" [ "$XBMK_RELEASE" = "y" ] && mkrom_tarball "bin/serprog_$1"; : } @@ -115,7 +116,7 @@ mkcorebootbin() { [ "$target" = "$tree" ] && return 0 - tmprom="$TMPDIR/coreboot.rom" + tmprom="$xbmktmp/coreboot.rom" $dry x_ cp "$srcdir/build/coreboot.rom" "$tmprom" initmode="${defconfig##*/}" @@ -201,8 +202,8 @@ add_grub() _grubname="fallback/payload" cbfs "$tmprom" "$grubelf" "$_grubname" printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ - > "$TMPDIR/tmpcfg" || $err "$target: !insert scandisk" - cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw + > "$xbmktmp/tmpcfg" || $err "$target: !insert scandisk" + cbfs "$tmprom" "$xbmktmp/tmpcfg" scan.cfg raw [ "$initmode" != "normal" ] && [ "$displaymode" != "txtmode" ] && \ cbfs "$tmprom" "$grubdata/background/background1280x800.png" \ "background.png" raw; : |