init.sh: unified handling of ./tmp

not to be confused with /tmp

we use ./tmp inside the lbmk work directory, for large files,
because /tmp might not be very big, or might be a tmpfs

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-03 05:32:01 +01:00
parent 47762c84ad
commit fcc52b986e
2 changed files with 6 additions and 8 deletions
+5 -1
View File
@@ -194,6 +194,10 @@ xbmk_create_tmpdir()
export TMPDIR="/tmp"
export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)"
xbmktmp="$TMPDIR"
# /tmp might be a tmpfs, so for large files we use ./tmp,
# not to be confused with xbmktmp (xbmktmp points to /tmp)
x_ mkdir -p tmp
}
xbmk_lock()
@@ -219,7 +223,7 @@ xbmk_child_exec()
{
xbmk_rval=0
( x_ ./mk "$@" ) || xbmk_rval=1
rm -Rf "$xbmktmp" || xbmk_rval=1
rm -Rf tmp "$xbmktmp" || xbmk_rval=1
rm -f lock || xbmk_rval=1
exit $xbmk_rval
}