xbmk: remove xbloc, re-use xbtmp instead

we no longer separate them. xbloc was the on-disk
tmp directory, whereas xbtmp used to be in /tmp
which we assumed to be tmpfs (it may not be, but
often is on many workstation setups - and our
documentation recommended doing this).

as mentioned in the previous commit, benchmarking
shows little speed difference using tmpfs /tmp
versus on-disk /tmp, for our purposes at least.
therefore, the handling of tmp files is being
greatly simplified.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-09-02 06:08:57 +01:00
parent 64b69907ab
commit 0d107ad872
5 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
eval "`setvars "" loc url bkup_url subcurl subhash subgit subgit_bkup \ eval "`setvars "" loc url bkup_url subcurl subhash subgit subgit_bkup \
depend subcurl_bkup`" depend subcurl_bkup`"
tmpgit="$xbloc/gitclone" tmpgit="$xbtmp/gitclone"
tmpgitcache="$XBMK_CACHE/tmpgit" tmpgitcache="$XBMK_CACHE/tmpgit"
fetch_targets() fetch_targets()
+4 -5
View File
@@ -14,13 +14,12 @@ projectsite="https://libreboot.org/"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \ eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \
datadir version xbmkpwd relname xbmkpwd xbtmp python pyver xbloc \ datadir version xbmkpwd relname xbmkpwd xbtmp python pyver xbmklock \
xbmklock cvxbmk cvchk xbmkpath is_child basetmp`" cvxbmk cvchk xbmkpath is_child basetmp`"
xbmk_init() xbmk_init()
{ {
xbmkpwd="`pwd`" || err "Cannot generate PWD" xbmkpwd="`pwd`" || err "Cannot generate PWD"
xbloc="$xbmkpwd/tmp"
xbmklock="$xbmkpwd/lock" xbmklock="$xbmkpwd/lock"
basetmp="$xbmkpwd/xbmkwd" basetmp="$xbmkpwd/xbmkwd"
@@ -86,7 +85,7 @@ xbmk_set_env()
xbmk_parent_set_export xbmk_parent_set_export
xbmk_set_version xbmk_set_version
remkdir "$xbtmp" "$xbloc" "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath" remkdir "$xbtmp" "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath"
xbmk_set_pyver xbmk_set_pyver
} }
@@ -265,7 +264,7 @@ xbmk_child_exec()
{ {
xbmk_rval=0 xbmk_rval=0
( x_ ./mk "$@" ) || xbmk_rval=1 ( x_ ./mk "$@" ) || xbmk_rval=1
( x_ rm -Rf "$xbloc" "$xbtmp" ) || xbmk_rval=1 ( x_ rm -Rf "$xbtmp" ) || xbmk_rval=1
( x_ rm -f "$xbmklock" ) || xbmk_rval=1 ( x_ rm -f "$xbmklock" ) || xbmk_rval=1
exit $xbmk_rval exit $xbmk_rval
} }
+4 -4
View File
@@ -117,21 +117,21 @@ scankconfig()
modify_mac() modify_mac()
{ {
x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$xbloc/gbe" x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$xbtmp/gbe"
[ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \ [ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \
x_ make -C util/nvmutil clean && x_ make -C util/nvmutil && \ x_ make -C util/nvmutil clean && x_ make -C util/nvmutil && \
x_ "$nvm" "$xbloc/gbe" setmac "$new_mac" x_ "$nvm" "$xbtmp/gbe" setmac "$new_mac"
fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
printf "\nThe following GbE NVM data will be written:\n" printf "\nThe following GbE NVM data will be written:\n"
x_ "$nvm" "$xbloc/gbe" dump | grep -v "bytes read from file" || : x_ "$nvm" "$xbtmp/gbe" dump | grep -v "bytes read from file" || :
} }
newmac() newmac()
{ {
e "$1" f && xchanged="y" && x_ \ e "$1" f && xchanged="y" && x_ \
"$ifdtool" $ifdprefix -i GbE:"$xbloc/gbe" "$1" -O "$1"; : "$ifdtool" $ifdprefix -i GbE:"$xbtmp/gbe" "$1" -O "$1"; :
} }
remktar() remktar()
+7 -7
View File
@@ -145,9 +145,9 @@ extract_intel_me()
{ {
e "$mecleaner" f not && err "$cbdir: me_cleaner missing" e "$mecleaner" f not && err "$cbdir: me_cleaner missing"
_7ztest="$xbloc/metmp/a" _7ztest="$xbtmp/metmp/a"
_metmp="$xbloc/me.bin" _metmp="$xbtmp/me.bin"
x_ rm -f "$_metmp" "$xbloc/a" x_ rm -f "$_metmp" "$xbtmp/a"
mfs="" mfs=""
if [ "$ME11bootguard" = "y" ]; then if [ "$ME11bootguard" = "y" ]; then
@@ -176,7 +176,7 @@ find_me()
_7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r="" _7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r=""
"$mecleaner" $mfs $_r -t -O "$xbloc/a" -M "$_metmp" "$1" || \ "$mecleaner" $mfs $_r -t -O "$xbtmp/a" -M "$_metmp" "$1" || \
"$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \ "$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \
-O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0 -O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0
@@ -386,9 +386,9 @@ vfile()
elif [ "$nuke" = "nuke" ]; then elif [ "$nuke" = "nuke" ]; then
x_ "$cbfstool" "$rom" remove -n "$cbfsname" x_ "$cbfstool" "$rom" remove -n "$cbfsname"
elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode
x_ rm -f "$xbloc/refcode" x_ rm -f "$xbtmp/refcode"
x_ "$rmodtool" -i "$_dest" -o "$xbloc/refcode" x_ "$rmodtool" -i "$_dest" -o "$xbtmp/refcode"
x_ "$cbfstool" "$rom" add-stage -f "$xbloc/refcode" \ x_ "$cbfstool" "$rom" add-stage -f "$xbtmp/refcode" \
-n "$cbfsname" -t stage -n "$cbfsname" -t stage
else else
x_ "$cbfstool" "$rom" add -f "$_dest" -n "$cbfsname" \ x_ "$cbfstool" "$rom" add -f "$_dest" -n "$cbfsname" \
+1
View File
@@ -37,5 +37,6 @@ main "$@" && exit 0
. "include/tree.sh" . "include/tree.sh"
trees "$@" || exit 0 trees "$@" || exit 0
x_ touch "$mkhelpercfg"
. "$mkhelpercfg" . "$mkhelpercfg"
$cmd $cmd