diff options
author | Leah Rowe <leah@libreboot.org> | 2025-05-03 05:32:01 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-05-03 05:32:01 +0100 |
commit | fcc52b986e7612d8bb53e9b51f305c62f611a35b (patch) | |
tree | 2a6588b21b809a6f6c4dc62e14938a38b2c3e19e | |
parent | 47762c84ad0f5e2a6fbe5ceec0bff623239e1e9a (diff) |
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>
-rw-r--r-- | include/init.sh | 6 | ||||
-rw-r--r-- | include/inject.sh | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/include/init.sh b/include/init.sh index b8839921..9e0e3a37 100644 --- a/include/init.sh +++ b/include/init.sh @@ -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 } diff --git a/include/inject.sh b/include/inject.sh index 2e821d86..26bcd02f 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -148,8 +148,6 @@ extract_intel_me() chkvars ME11delta ME11version ME11sku ME11pch [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard - x_ mkdir -p tmp - extract_intel_me_bruteforce if [ "$ME11bootguard" = "y" ]; then apply_me11_deguard_mod @@ -281,7 +279,6 @@ extract_sch5545ec() extract_tbfw() { chkvars TBFW_size # size in bytes, matching TBFW's flash IC - x_ mkdir -p tmp x_ rm -f tmp/tb.bin && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" @@ -418,8 +415,6 @@ patch_release_roms() hashfile="$_hashes" && break; : done - x_ mkdir -p "tmp" - if readkconfig; then fe_ prep_rom "$tmpromdir" -maxdepth 1 -type f -name "*.rom" [ "$nukemode" != "nuke" ] || \ @@ -551,7 +546,6 @@ insert() elif [ "$nukemode" = "nuke" ]; then x_ "$cbfstool" "$rom" remove -n "$cbfsname" elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode - x_ mkdir -p tmp x_ rm -f "tmp/refcode" "$rmodtool" -i "$_dest" -o "tmp/refcode" || "!reloc refcode" "$cbfstool" "$rom" add-stage -f "tmp/refcode" -n "$cbfsname" \ @@ -567,7 +561,7 @@ modify_mac() { [ -n "$CONFIG_GBE_BIN_PATH" ] || return 1 - x_ mkdir -p tmp && x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe + x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil && \ x_ "$nvm" tmp/gbe setmac "$new_mac" |