xbmk: rename xbmklocal/xbmktmp variables

shorten them

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-26 00:57:50 +01:00
parent e981132c82
commit 18dacd4c22
7 changed files with 28 additions and 29 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 repofail`" depend subcurl_bkup repofail`"
tmpgit="$xbmklocal/gitclone" tmpgit="$xbloc/gitclone"
tmpgitcache="$XBMK_CACHE/tmpgit" tmpgitcache="$XBMK_CACHE/tmpgit"
fetch_targets() fetch_targets()
+6 -7
View File
@@ -14,13 +14,13 @@ 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 xbmktmp python pyver xbmklocal \ datadir version xbmkpwd relname xbmkpwd xbtmp python pyver xbloc \
xbmklock cvxbmk cvchk xbmkpath`" xbmklock cvxbmk cvchk xbmkpath`"
xbmk_init() xbmk_init()
{ {
xbmkpwd="`pwd`" || err "Cannot generate PWD" xbmkpwd="`pwd`" || err "Cannot generate PWD"
xbmklocal="$xbmkpwd/tmp" xbloc="$xbmkpwd/tmp"
xbmklock="$xbmkpwd/lock" xbmklock="$xbmkpwd/lock"
export PWD="$xbmkpwd" export PWD="$xbmkpwd"
@@ -71,7 +71,7 @@ xbmk_set_env()
# unify all temporary files/directories in a single TMPDIR # unify all temporary files/directories in a single TMPDIR
[ -z "${TMPDIR+x}" ] || [ "${TMPDIR%_*}" = "/tmp/xbmk" ] || \ [ -z "${TMPDIR+x}" ] || [ "${TMPDIR%_*}" = "/tmp/xbmk" ] || \
unset TMPDIR unset TMPDIR
[ -n "${TMPDIR+x}" ] && export TMPDIR="$TMPDIR" && xbmktmp="$TMPDIR" [ -n "${TMPDIR+x}" ] && export TMPDIR="$TMPDIR" && xbtmp="$TMPDIR"
[ -z "${TMPDIR+x}" ] || is_child="y" # child instance, so return [ -z "${TMPDIR+x}" ] || is_child="y" # child instance, so return
if [ "$is_child" = "y" ]; then if [ "$is_child" = "y" ]; then
@@ -87,7 +87,7 @@ xbmk_set_env()
# parent instance of xbmk, so don't return. set up TMPDIR # parent instance of xbmk, so don't return. set up TMPDIR
export TMPDIR="/tmp" export TMPDIR="/tmp"
export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)" export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)"
xbmktmp="$TMPDIR" xbtmp="$TMPDIR"
export XBMK_CACHE="$xbmkpwd/cache" export XBMK_CACHE="$xbmkpwd/cache"
[ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$xbmkpwd/cache" ] && \ [ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$xbmkpwd/cache" ] && \
@@ -107,8 +107,7 @@ xbmk_set_env()
xbmk_set_version xbmk_set_version
export LOCALVERSION="-$projectname-${version%%-*}" export LOCALVERSION="-$projectname-${version%%-*}"
remkdir "$xbmktmp" "$xbmklocal" remkdir "$xbtmp" "$xbloc" "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath"
remkdir "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath"
xbmk_set_pyver xbmk_set_pyver
} }
@@ -211,7 +210,7 @@ xbmk_child_exec()
{ {
xbmk_rval=0 xbmk_rval=0
( x_ ./mk "$@" ) || xbmk_rval=1 ( x_ ./mk "$@" ) || xbmk_rval=1
( x_ rm -Rf "$xbmklocal" "$xbmktmp" ) || xbmk_rval=1 ( x_ rm -Rf "$xbloc" "$xbtmp" ) || xbmk_rval=1
( x_ rm -f "$xbmklock" ) || xbmk_rval=1 ( x_ rm -f "$xbmklock" ) || xbmk_rval=1
exit $xbmk_rval exit $xbmk_rval
} }
+7 -7
View File
@@ -103,36 +103,36 @@ patch_release()
readkconfig() readkconfig()
{ {
x_ rm -f "$xbmktmp/cbcfg" x_ rm -f "$xbtmp/cbcfg"
fx_ scankconfig x_ find "$boarddir/config" -type f fx_ scankconfig x_ find "$boarddir/config" -type f
eval "`setcfg "$xbmktmp/cbcfg" 1`" eval "`setcfg "$xbtmp/cbcfg" 1`"
setvfile "$@" || return 1; : setvfile "$@" || return 1; :
} }
scankconfig() scankconfig()
{ {
for cbc in $cv; do for cbc in $cv; do
grep "$cbc" "$1" 1>>"$xbmktmp/cbcfg" 2>/dev/null || : grep "$cbc" "$1" 1>>"$xbtmp/cbcfg" 2>/dev/null || :
done done
} }
modify_mac() modify_mac()
{ {
x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$xbmklocal/gbe" x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$xbloc/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" "$xbmklocal/gbe" setmac "$new_mac" x_ "$nvm" "$xbloc/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" "$xbmklocal/gbe" dump | grep -v "bytes read from file" || : x_ "$nvm" "$xbloc/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:"$xbmklocal/gbe" "$1" -O "$1"; : "$ifdtool" $ifdprefix -i GbE:"$xbloc/gbe" "$1" -O "$1"; :
} }
remktar() remktar()
+1 -1
View File
@@ -22,7 +22,7 @@ release()
[ -e "$reldest" ] && \ [ -e "$reldest" ] && \
err "already exists: \"$reldest\"" err "already exists: \"$reldest\""
vdir="$XBMK_CACHE/relpwd/${xbmktmp##*/}/$version" vdir="$XBMK_CACHE/relpwd/${xbtmp##*/}/$version"
rsrc="$vdir/${relname}_src" rsrc="$vdir/${relname}_src"
remkdir "$vdir" remkdir "$vdir"
+3 -3
View File
@@ -78,7 +78,7 @@ mkcorebootbin()
{ {
[ "$target" = "$tree" ] && return 0 [ "$target" = "$tree" ] && return 0
tmprom="$xbmktmp/coreboot.rom" tmprom="$xbtmp/coreboot.rom"
$dry x_ cp "$srcdir/build/coreboot.rom" "$tmprom" $dry x_ cp "$srcdir/build/coreboot.rom" "$tmprom"
initmode="${defconfig##*/}" initmode="${defconfig##*/}"
@@ -158,8 +158,8 @@ add_grub()
_grubname="fallback/payload" _grubname="fallback/payload"
cbfs "$tmprom" "$grubelf" "$_grubname" cbfs "$tmprom" "$grubelf" "$_grubname"
printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \
> "$xbmktmp/tmpcfg" || err "$target: !insert scandisk" > "$xbtmp/tmpcfg" || err "$target: !insert scandisk"
cbfs "$tmprom" "$xbmktmp/tmpcfg" scan.cfg raw cbfs "$tmprom" "$xbtmp/tmpcfg" scan.cfg raw
[ "$initmode" != "normal" ] && [ "$displaymode" != "txtmode" ] && \ [ "$initmode" != "normal" ] && [ "$displaymode" != "txtmode" ] && \
cbfs "$tmprom" "$grubdata/background/background1280x800.png" \ cbfs "$tmprom" "$grubdata/background/background1280x800.png" \
"background.png" raw; : "background.png" raw; :
+3 -3
View File
@@ -58,7 +58,7 @@ trees()
mkhelpercfg="$datadir/mkhelper.cfg" mkhelpercfg="$datadir/mkhelper.cfg"
if e "$mkhelpercfg" f missing; then if e "$mkhelpercfg" f missing; then
mkhelpercfg="$xbmktmp/mkhelper.cfg" mkhelpercfg="$xbtmp/mkhelper.cfg"
x_ touch "$mkhelpercfg" x_ touch "$mkhelpercfg"
fi fi
@@ -181,9 +181,9 @@ check_project_hashes()
fx_ "x_ sha512sum" find "$datadir" "$configdir/$tree" "$mdir" \ fx_ "x_ sha512sum" find "$datadir" "$configdir/$tree" "$mdir" \
-type f -not -path "*/.git*/*" | awk '{print $1}' > \ -type f -not -path "*/.git*/*" | awk '{print $1}' > \
"$xbmktmp/project.hash" || err "!h $project $tree" "$xbtmp/project.hash" || err "!h $project $tree"
pjhash="$(sha512sum "$xbmktmp/project.hash" | awk '{print $1}')" || : pjhash="$(sha512sum "$xbtmp/project.hash" | awk '{print $1}')" || :
[ "$pjhash" != "$old_pjhash" ] && badhash="y" [ "$pjhash" != "$old_pjhash" ] && badhash="y"
[ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y" [ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y"
+7 -7
View File
@@ -150,9 +150,9 @@ extract_intel_me()
{ {
e "$mecleaner" f not && err "$cbdir: me_cleaner missing" e "$mecleaner" f not && err "$cbdir: me_cleaner missing"
_7ztest="$xbmklocal/metmp/a" _7ztest="$xbloc/metmp/a"
_metmp="$xbmklocal/me.bin" _metmp="$xbloc/me.bin"
x_ rm -f "$_metmp" "$xbmklocal/a" x_ rm -f "$_metmp" "$xbloc/a"
mfs="" && [ "$ME11bootguard" = "y" ] && mfs="--whitelist MFS" && \ mfs="" && [ "$ME11bootguard" = "y" ] && mfs="--whitelist MFS" && \
chkvars ME11delta ME11version ME11sku ME11pch chkvars ME11delta ME11version ME11sku ME11pch
@@ -178,7 +178,7 @@ find_me()
_7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r="" _7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r=""
"$mecleaner" $mfs $_r -t -O "$xbmklocal/a" -M "$_metmp" "$1" || \ "$mecleaner" $mfs $_r -t -O "$xbloc/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
@@ -387,9 +387,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 "$xbmklocal/refcode" x_ rm -f "$xbloc/refcode"
x_ "$rmodtool" -i "$_dest" -o "$xbmklocal/refcode" x_ "$rmodtool" -i "$_dest" -o "$xbloc/refcode"
x_ "$cbfstool" "$rom" add-stage -f "$xbmklocal/refcode" \ x_ "$cbfstool" "$rom" add-stage -f "$xbloc/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" \