aboutsummaryrefslogtreecommitdiff
path: root/release/amd64
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@FreeBSD.org>2022-02-28 22:36:51 +0000
committerJessica Clarke <jrtc27@FreeBSD.org>2022-02-28 22:36:51 +0000
commit045c8f526484cb3b97f5fd693987f4376fa43c5f (patch)
treebd92e103d8289d9c3eaa5359e8066baab4fa2bad /release/amd64
parentb58ea3e1f7779aac4eebcec5dffc9ebef203e583 (diff)
downloadsrc-045c8f526484cb3b97f5fd693987f4376fa43c5f.tar.gz
src-045c8f526484cb3b97f5fd693987f4376fa43c5f.zip
mkisoimages.sh: Avoid creating temporary files in the current directory
Currently the current directory is the parent of the rootfs directory, but this will change in order to support NO_ROOT builds that use a metalog manifest, since those need to have the current directory be the rootfs itself in order for the relative paths to be correct, and we do not want the non-METALOG case (which passes the directory to makefs) to pick up leftover temporary .img files from a previous failed build. Reviewed by: brooks, emaste, gjb Differential Revision: https://reviews.freebsd.org/D33998
Diffstat (limited to 'release/amd64')
-rw-r--r--release/amd64/mkisoimages.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh
index a9e8a2c04392..7f79ddc800e9 100644
--- a/release/amd64/mkisoimages.sh
+++ b/release/amd64/mkisoimages.sh
@@ -85,15 +85,16 @@ if [ "$bootable" != "" ]; then
done
# Create a GPT image containing the partitions we need for hybrid boot.
+ hybridfilename=$(mktemp /tmp/hybrid.img.XXXXXX)
imgsize=`stat -f %z "$NAME"`
$MKIMG -s gpt \
--capacity $imgsize \
-b "$BASEBITSDIR/boot/pmbr" \
-p freebsd-boot:="$BASEBITSDIR/boot/isoboot" \
$espparam \
- -o hybrid.img
+ -o $hybridfilename
# Drop the PMBR, GPT, and boot code into the System Area of the ISO.
- dd if=hybrid.img of="$NAME" bs=32k count=1 conv=notrunc
- rm -f hybrid.img
+ dd if=$hybridfilename of="$NAME" bs=32k count=1 conv=notrunc
+ rm -f $hybridfilename
fi