mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
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>
This commit is contained in:
+6
-5
@@ -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; :
|
||||
|
||||
Reference in New Issue
Block a user