diff options
| -rw-r--r-- | include/chromebook.sh | 2 | ||||
| -rw-r--r-- | include/get.sh | 4 | ||||
| -rw-r--r-- | include/init.sh | 9 | ||||
| -rw-r--r-- | include/lib.sh | 32 | ||||
| -rw-r--r-- | include/release.sh | 2 | ||||
| -rw-r--r-- | include/rom.sh | 2 | ||||
| -rw-r--r-- | include/tree.sh | 2 | ||||
| -rw-r--r-- | include/vendor.sh | 4 | ||||
| -rw-r--r-- | util/libreboot-utils/Makefile | 2 | ||||
| -rw-r--r-- | util/libreboot-utils/mkhtemp.c | 8 |
10 files changed, 17 insertions, 50 deletions
diff --git a/include/chromebook.sh b/include/chromebook.sh index ce1bcd5c..0b8b50f1 100644 --- a/include/chromebook.sh +++ b/include/chromebook.sh @@ -35,7 +35,7 @@ prep_mr_import() err "Project import disabled on releases" "prep_mr_import" "$@" 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" "$@" x_ remkdir "$mr_tmpdir" diff --git a/include/get.sh b/include/get.sh index 5f932b07..3e25ea3f 100644 --- a/include/get.sh +++ b/include/get.sh @@ -334,7 +334,7 @@ bad_checksum() return 0 fi - bootstrap_utils + build_sbase csum="$(x_ "$sha512sum" "$2" | awk '{print $1}')" || \ err "!sha512 '$2' $1" bad_checksum "$@" @@ -355,7 +355,7 @@ tmpclone() return 0 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" "$@" x_ find "$4" -type f | sort > "$tmpclone_patchlist" || \ diff --git a/include/init.sh b/include/init.sh index d2ee4e32..cde489dd 100644 --- a/include/init.sh +++ b/include/init.sh @@ -17,7 +17,6 @@ if [ -z "${PATH+x}" ]; then fi sha512sum="util/sbase/sha512sum" -mkhtemp="util/libreboot-utils/mkhtemp" aur_notice="" basetmp="" @@ -232,9 +231,7 @@ xbmk_parent_check_tmp() { export TMPDIR="$basetmp" - bootstrap_mkhtemp - - xbmklist="`"$mkhtemp" || err "can't make tmplist"`" || \ + xbmklist="`mktemp || err "can't make tmplist"`" || \ err "can't make tmplist" xbmk_parent_check_tmp "$@" x_ rm -f "$xbmklist" @@ -249,7 +246,7 @@ xbmk_parent_check_tmp() done # 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" "$@" xbtmp="$TMPDIR" @@ -272,7 +269,7 @@ xbmk_parent_set_export() "xbmk_parent_set_export" "$@" fi - export PATH="$xbmkpwd/util/libreboot-utils:$xbtmp/xbmkpath:$xbtmp/gnupath:$PATH" + export PATH="$xbtmp/xbmkpath:$xbtmp/gnupath:$PATH" xbmkpath="$PATH" # if "y": a coreboot target won't be built if target.cfg says release=n diff --git a/include/lib.sh b/include/lib.sh index 9526dfc7..812341f4 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -128,7 +128,7 @@ findpath() 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" "$@" x_ cat "$1" config/data/coreboot/0 > "$paddedfile" || \ @@ -146,39 +146,17 @@ unpad_one_byte() err "too small, $xromsize: $1" "unpad_one_byte" "$@" fi - unpaddedfile="`"$mkhtemp" || err ""$mkhtemp" unpad_one_byte"`" || \ + unpaddedfile="`mktemp || err "mktemp unpad_one_byte"`" || \ err "can't make tmp file" "unpad_one_byte" "$@" x_ dd if="$1" of="$unpaddedfile" bs=$xromsize count=1 x_ mv "$unpaddedfile" "$1" } -# certain utils in lbmk are needed -# 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() +build_sbase() { if [ ! -f "$sha512sum" ]; then - ( x_ make -C "$xbmkpwd/util/sbase" 1>/dev/null 2>/dev/null ) || \ - 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" + x_ make -C "$xbmkpwd/util/sbase" fi } @@ -205,7 +183,7 @@ fx_() xchk fx_ "$@" xcmd="$1" - xfile="`"$mkhtemp" || err "can't create tmpfile"`" || \ + xfile="`mktemp || err "can't create tmpfile"`" || \ err "can't make tmpfile" "fx_" "$@" x_ rm -f "$xfile" diff --git a/include/release.sh b/include/release.sh index 079afdf6..e9017a05 100644 --- a/include/release.sh +++ b/include/release.sh @@ -35,7 +35,7 @@ release() err "already exists: \"$reldest\"" "release" "$@" fi - vdir="`"$mkhtemp" -d || err "can't make vdir"`" || \ + vdir="`mktemp -d || err "can't make vdir"`" || \ err "can't make tmp vdir" "release" "$@" vdir="$vdir/$version" diff --git a/include/rom.sh b/include/rom.sh index afeba7d9..6f0e3529 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -463,7 +463,7 @@ cprom() irom="$tmprom" if [ $# -gt 0 ]; then - irom="$("$mkhtemp" || err "!mk irom, $(echo "$@")")" || \ + irom="$(mktemp || err "!mk irom, $(echo "$@")")" || \ err "can't copy rom" "cprom" "$@" x_ cp "$tmprom" "$irom" && cpcmd="mv" diff --git a/include/tree.sh b/include/tree.sh index 0bcb9208..8496a49a 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -444,7 +444,7 @@ project_up_to_date() "$@" fi - bootstrap_utils + build_sbase fx_ "x_ util/sbase/sha512sum" find "$@" -type f -not -path \ "*/.git*/*" | awk '{print $1}' > "$xbtmp/tmp.hash" || \ err "!h $project $hashdir" \ diff --git a/include/vendor.sh b/include/vendor.sh index 4c472b13..8076d9ab 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -633,7 +633,7 @@ prep() mksha512() { - bootstrap_utils + build_sbase if [ "${1%/*}" != "$1" ]; then x_ cd "${1%/*}" @@ -746,7 +746,7 @@ vfile() # must be called from a subshell check_vendor_hashes() { - bootstrap_utils + build_sbase x_ cd "$tmpromdir" diff --git a/util/libreboot-utils/Makefile b/util/libreboot-utils/Makefile index 5ebc9b93..07b3a727 100644 --- a/util/libreboot-utils/Makefile +++ b/util/libreboot-utils/Makefile @@ -68,8 +68,6 @@ $(PROG): $(OBJS_NVMUTIL) $(PROGMKH): $(OBJS_MKHTEMP) $(CC_MODE) $(OBJS_MKHTEMP) -o $(PROGMKH) $(LDFLAGS) - cp -r mkhtemp mktemp - chmod 755 mktemp $(PROGLOT): $(OBJS_LOTTERY) $(CC_MODE) $(OBJS_LOTTERY) -o $(PROGLOT) $(LDFLAGS) diff --git a/util/libreboot-utils/mkhtemp.c b/util/libreboot-utils/mkhtemp.c index c9315b0c..de86a2bf 100644 --- a/util/libreboot-utils/mkhtemp.c +++ b/util/libreboot-utils/mkhtemp.c @@ -68,7 +68,7 @@ main(int argc, char *argv[]) xpledgex("stdio flock rpath wpath cpath", NULL); while ((c = - getopt(argc, argv, "qdp:t")) != -1) { + getopt(argc, argv, "qdp:")) != -1) { switch (c) { case 'd': @@ -83,12 +83,6 @@ main(int argc, char *argv[]) /* (exit status unchanged) */ break; - case 't': - break; /* not supported yet. TODO */ - /* configured above without optarg, - * so that it is treated as a normal - * template string */ - default: goto err_usage; } |
