Browse Source

use mktemp "-p" instead of "--tmpdir" for busybox

master
Harald Hoyer 9 years ago
parent
commit
e50f91e600
  1. 2
      dracut-logger.sh
  2. 10
      dracut.sh
  3. 2
      test/test-functions

2
dracut-logger.sh

@ -148,7 +148,7 @@ dlog_init() { @@ -148,7 +148,7 @@ dlog_init() {
&& type -P systemd-cat &>/dev/null \
&& systemctl --quiet is-active systemd-journald.socket &>/dev/null \
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then
readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)"
readonly _dlogdir="$(mktemp -p "$TMPDIR/" -d -t dracut-log.XXXXXX)"
readonly _systemdcatfile="$_dlogdir/systemd-cat"
mkfifo "$_systemdcatfile"
readonly _dlogfd=15

10
dracut.sh

@ -777,16 +777,16 @@ fi @@ -777,16 +777,16 @@ fi
[[ $reproducible == yes ]] && DRACUT_REPRODUCIBLE=1

readonly TMPDIR="$tmpdir"
readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)"
readonly initdir="$(mktemp -p "$TMPDIR/" -d -t initramfs.XXXXXX)"
[ -d "$initdir" ] || {
printf "%s\n" "dracut: mktemp --tmpdir='$TMPDIR/' -d -t initramfs.XXXXXX failed." >&2
printf "%s\n" "dracut: mktemp -p '$TMPDIR/' -d -t initramfs.XXXXXX failed." >&2
exit 1
}

if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then
readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)"
readonly early_cpio_dir="$(mktemp -p "$TMPDIR/" -d -t early_cpio.XXXXXX)"
[ -d "$early_cpio_dir" ] || {
printf "%s\n" "dracut: mktemp --tmpdir='$TMPDIR/' -d -t early_cpio.XXXXXX failed." >&2
printf "%s\n" "dracut: mktemp -p '$TMPDIR/' -d -t early_cpio.XXXXXX failed." >&2
exit 1
}
fi
@ -1614,7 +1614,7 @@ dinfo "*** Creating image file '$outfile' ***" @@ -1614,7 +1614,7 @@ dinfo "*** Creating image file '$outfile' ***"

if [[ $uefi = yes ]]; then
uefi_outfile="$outfile"
readonly uefi_outdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initrd.XXXXXX)"
readonly uefi_outdir="$(mktemp -p "$TMPDIR/" -d -t initrd.XXXXXX)"
# redirect initrd output
outfile="$uefi_outdir/initrd"
fi

2
test/test-functions

@ -4,7 +4,7 @@ export PATH @@ -4,7 +4,7 @@ export PATH

[[ -e .testdir ]] && . .testdir
if [[ -z "$TESTDIR" ]] || [[ ! -d "$TESTDIR" ]]; then
TESTDIR=$(mktemp -d --tmpdir="/var/tmp" -t dracut-test.XXXXXX)
TESTDIR=$(mktemp -d -p "/var/tmp" -t dracut-test.XXXXXX)
fi
echo "TESTDIR=\"$TESTDIR\"" > .testdir
export TESTDIR

Loading…
Cancel
Save