diff options
| author | Jessica Clarke <jrtc27@FreeBSD.org> | 2022-02-28 22:36:51 +0000 |
|---|---|---|
| committer | Jessica Clarke <jrtc27@FreeBSD.org> | 2022-02-28 22:36:51 +0000 |
| commit | 045c8f526484cb3b97f5fd693987f4376fa43c5f (patch) | |
| tree | bd92e103d8289d9c3eaa5359e8066baab4fa2bad | |
| parent | b58ea3e1f7779aac4eebcec5dffc9ebef203e583 (diff) | |
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
| -rw-r--r-- | release/amd64/mkisoimages.sh | 7 | ||||
| -rw-r--r-- | release/arm64/mkisoimages.sh | 7 | ||||
| -rw-r--r-- | release/riscv/mkisoimages.sh | 7 |
3 files changed, 12 insertions, 9 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 diff --git a/release/arm64/mkisoimages.sh b/release/arm64/mkisoimages.sh index 5556336840cd..8d260883c294 100644 --- a/release/arm64/mkisoimages.sh +++ b/release/arm64/mkisoimages.sh @@ -81,13 +81,14 @@ if [ "$bootable" != "" ]; then done # Create a GPT image containing the EFI partition. + efifilename=$(mktemp /tmp/efi.img.XXXXXX) imgsize=`stat -f %z "$NAME"` $MKIMG -s gpt \ --capacity $imgsize \ $espparam \ - -o efi.img + -o $efifilename # Drop the GPT into the System Area of the ISO. - dd if=efi.img of="$NAME" bs=32k count=1 conv=notrunc - rm -f efi.img + dd if=$efifilename of="$NAME" bs=32k count=1 conv=notrunc + rm -f $efifilename fi diff --git a/release/riscv/mkisoimages.sh b/release/riscv/mkisoimages.sh index 5556336840cd..8d260883c294 100644 --- a/release/riscv/mkisoimages.sh +++ b/release/riscv/mkisoimages.sh @@ -81,13 +81,14 @@ if [ "$bootable" != "" ]; then done # Create a GPT image containing the EFI partition. + efifilename=$(mktemp /tmp/efi.img.XXXXXX) imgsize=`stat -f %z "$NAME"` $MKIMG -s gpt \ --capacity $imgsize \ $espparam \ - -o efi.img + -o $efifilename # Drop the GPT into the System Area of the ISO. - dd if=efi.img of="$NAME" bs=32k count=1 conv=notrunc - rm -f efi.img + dd if=$efifilename of="$NAME" bs=32k count=1 conv=notrunc + rm -f $efifilename fi |
