Revert "lbmk: use mkhtemp in libreboot's build system"

This reverts commit e54862fccc.

nope. not ready yet. will fix it later.
This commit is contained in:
Leah Rowe
2026-03-29 16:25:41 +01:00
parent e54862fccc
commit 01aa95ec15
10 changed files with 17 additions and 50 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ prep_mr_import()
err "Project import disabled on releases" "prep_mr_import" "$@" err "Project import disabled on releases" "prep_mr_import" "$@"
fi fi
mr_tmpdir="`"$mkhtemp" -d || err "can't make mrtmpdir"`" || \ mr_tmpdir="`mktemp -d || err "can't make mrtmpdir"`" || \
err "can't make mrtmpdir" "prep_mr_coreboot" "$@" err "can't make mrtmpdir" "prep_mr_coreboot" "$@"
x_ remkdir "$mr_tmpdir" x_ remkdir "$mr_tmpdir"
+2 -2
View File
@@ -334,7 +334,7 @@ bad_checksum()
return 0 return 0
fi fi
bootstrap_utils build_sbase
csum="$(x_ "$sha512sum" "$2" | awk '{print $1}')" || \ csum="$(x_ "$sha512sum" "$2" | awk '{print $1}')" || \
err "!sha512 '$2' $1" bad_checksum "$@" err "!sha512 '$2' $1" bad_checksum "$@"
@@ -355,7 +355,7 @@ tmpclone()
return 0 return 0
fi fi
tmpclone_patchlist="`"$mkhtemp" || err "Can't create tmp patch list"`" || \ tmpclone_patchlist="`mktemp || err "Can't create tmp patch list"`" || \
err "Can't create tmp patch list" "tmpclone" "$@" err "Can't create tmp patch list" "tmpclone" "$@"
x_ find "$4" -type f | sort > "$tmpclone_patchlist" || \ x_ find "$4" -type f | sort > "$tmpclone_patchlist" || \
+3 -6
View File
@@ -17,7 +17,6 @@ if [ -z "${PATH+x}" ]; then
fi fi
sha512sum="util/sbase/sha512sum" sha512sum="util/sbase/sha512sum"
mkhtemp="util/libreboot-utils/mkhtemp"
aur_notice="" aur_notice=""
basetmp="" basetmp=""
@@ -232,9 +231,7 @@ xbmk_parent_check_tmp()
{ {
export TMPDIR="$basetmp" export TMPDIR="$basetmp"
bootstrap_mkhtemp xbmklist="`mktemp || err "can't make tmplist"`" || \
xbmklist="`"$mkhtemp" || err "can't make tmplist"`" || \
err "can't make tmplist" xbmk_parent_check_tmp "$@" err "can't make tmplist" xbmk_parent_check_tmp "$@"
x_ rm -f "$xbmklist" x_ rm -f "$xbmklist"
@@ -249,7 +246,7 @@ xbmk_parent_check_tmp()
done done
# set up a unified temporary directory, for common deletion later: # set up a unified temporary directory, for common deletion later:
export TMPDIR="`x_ "$mkhtemp" -d -t xbmk_XXXXXXXX`" || \ export TMPDIR="`x_ mktemp -d -t xbmk_XXXXXXXX`" || \
err "can't export TMPDIR" "xbmk_parent_check_tmp" "$@" err "can't export TMPDIR" "xbmk_parent_check_tmp" "$@"
xbtmp="$TMPDIR" xbtmp="$TMPDIR"
@@ -272,7 +269,7 @@ xbmk_parent_set_export()
"xbmk_parent_set_export" "$@" "xbmk_parent_set_export" "$@"
fi fi
export PATH="$xbmkpwd/util/libreboot-utils:$xbtmp/xbmkpath:$xbtmp/gnupath:$PATH" export PATH="$xbtmp/xbmkpath:$xbtmp/gnupath:$PATH"
xbmkpath="$PATH" xbmkpath="$PATH"
# if "y": a coreboot target won't be built if target.cfg says release=n # if "y": a coreboot target won't be built if target.cfg says release=n
+5 -27
View File
@@ -128,7 +128,7 @@ findpath()
pad_one_byte() pad_one_byte()
{ {
paddedfile="`"$mkhtemp" || err ""$mkhtemp" pad_one_byte"`" || \ paddedfile="`mktemp || err "mktemp pad_one_byte"`" || \
err "can't make tmp file" "pad_one_byte" "$@" err "can't make tmp file" "pad_one_byte" "$@"
x_ cat "$1" config/data/coreboot/0 > "$paddedfile" || \ x_ cat "$1" config/data/coreboot/0 > "$paddedfile" || \
@@ -146,39 +146,17 @@ unpad_one_byte()
err "too small, $xromsize: $1" "unpad_one_byte" "$@" err "too small, $xromsize: $1" "unpad_one_byte" "$@"
fi fi
unpaddedfile="`"$mkhtemp" || err ""$mkhtemp" unpad_one_byte"`" || \ unpaddedfile="`mktemp || err "mktemp unpad_one_byte"`" || \
err "can't make tmp file" "unpad_one_byte" "$@" err "can't make tmp file" "unpad_one_byte" "$@"
x_ dd if="$1" of="$unpaddedfile" bs=$xromsize count=1 x_ dd if="$1" of="$unpaddedfile" bs=$xromsize count=1
x_ mv "$unpaddedfile" "$1" x_ mv "$unpaddedfile" "$1"
} }
# certain utils in lbmk are needed build_sbase()
# BEFORE sha512sum-based verification
# can be done, and before TMPDIR
# generation can be done. these are:
# sha512sum and "$mkhtemp". we will use:
# libreboot's own mkhtemp and:
# suckless sbase's sha512sum
#
bootstrap_utils()
{
bootstrap_sbase
bootstrap_mkhtemp
}
bootstrap_sbase()
{ {
if [ ! -f "$sha512sum" ]; then if [ ! -f "$sha512sum" ]; then
( x_ make -C "$xbmkpwd/util/sbase" 1>/dev/null 2>/dev/null ) || \ x_ make -C "$xbmkpwd/util/sbase"
err "can't build sbase"
fi
}
bootstrap_mkhtemp()
{
if [ ! -f "$mkhtemp" ]; then
( x_ make -C "$xbmkpwd/util/libreboot-utils" 1>/dev/null \
2>/dev/null) || \
err "could not build mkhtemp"
fi fi
} }
@@ -205,7 +183,7 @@ fx_()
xchk fx_ "$@" xchk fx_ "$@"
xcmd="$1" xcmd="$1"
xfile="`"$mkhtemp" || err "can't create tmpfile"`" || \ xfile="`mktemp || err "can't create tmpfile"`" || \
err "can't make tmpfile" "fx_" "$@" err "can't make tmpfile" "fx_" "$@"
x_ rm -f "$xfile" x_ rm -f "$xfile"
+1 -1
View File
@@ -35,7 +35,7 @@ release()
err "already exists: \"$reldest\"" "release" "$@" err "already exists: \"$reldest\"" "release" "$@"
fi fi
vdir="`"$mkhtemp" -d || err "can't make vdir"`" || \ vdir="`mktemp -d || err "can't make vdir"`" || \
err "can't make tmp vdir" "release" "$@" err "can't make tmp vdir" "release" "$@"
vdir="$vdir/$version" vdir="$vdir/$version"
+1 -1
View File
@@ -463,7 +463,7 @@ cprom()
irom="$tmprom" irom="$tmprom"
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
irom="$("$mkhtemp" || err "!mk irom, $(echo "$@")")" || \ irom="$(mktemp || err "!mk irom, $(echo "$@")")" || \
err "can't copy rom" "cprom" "$@" err "can't copy rom" "cprom" "$@"
x_ cp "$tmprom" "$irom" && cpcmd="mv" x_ cp "$tmprom" "$irom" && cpcmd="mv"
+1 -1
View File
@@ -444,7 +444,7 @@ project_up_to_date()
"$@" "$@"
fi fi
bootstrap_utils build_sbase
fx_ "x_ util/sbase/sha512sum" find "$@" -type f -not -path \ fx_ "x_ util/sbase/sha512sum" find "$@" -type f -not -path \
"*/.git*/*" | awk '{print $1}' > "$xbtmp/tmp.hash" || \ "*/.git*/*" | awk '{print $1}' > "$xbtmp/tmp.hash" || \
err "!h $project $hashdir" \ err "!h $project $hashdir" \
+2 -2
View File
@@ -633,7 +633,7 @@ prep()
mksha512() mksha512()
{ {
bootstrap_utils build_sbase
if [ "${1%/*}" != "$1" ]; then if [ "${1%/*}" != "$1" ]; then
x_ cd "${1%/*}" x_ cd "${1%/*}"
@@ -746,7 +746,7 @@ vfile()
# must be called from a subshell # must be called from a subshell
check_vendor_hashes() check_vendor_hashes()
{ {
bootstrap_utils build_sbase
x_ cd "$tmpromdir" x_ cd "$tmpromdir"
-2
View File
@@ -68,8 +68,6 @@ $(PROG): $(OBJS_NVMUTIL)
$(PROGMKH): $(OBJS_MKHTEMP) $(PROGMKH): $(OBJS_MKHTEMP)
$(CC_MODE) $(OBJS_MKHTEMP) -o $(PROGMKH) $(LDFLAGS) $(CC_MODE) $(OBJS_MKHTEMP) -o $(PROGMKH) $(LDFLAGS)
cp -r mkhtemp mktemp
chmod 755 mktemp
$(PROGLOT): $(OBJS_LOTTERY) $(PROGLOT): $(OBJS_LOTTERY)
$(CC_MODE) $(OBJS_LOTTERY) -o $(PROGLOT) $(LDFLAGS) $(CC_MODE) $(OBJS_LOTTERY) -o $(PROGLOT) $(LDFLAGS)
+1 -7
View File
@@ -68,7 +68,7 @@ main(int argc, char *argv[])
xpledgex("stdio flock rpath wpath cpath", NULL); xpledgex("stdio flock rpath wpath cpath", NULL);
while ((c = while ((c =
getopt(argc, argv, "qdp:t")) != -1) { getopt(argc, argv, "qdp:")) != -1) {
switch (c) { switch (c) {
case 'd': case 'd':
@@ -83,12 +83,6 @@ main(int argc, char *argv[])
/* (exit status unchanged) */ /* (exit status unchanged) */
break; break;
case 't':
break; /* not supported yet. TODO */
/* configured above without optarg,
* so that it is treated as a normal
* template string */
default: default:
goto err_usage; goto err_usage;
} }