dracut.sh: make tmp dirs after the trap function is installed

otherwise a good timed ctrl-c will leave the tmp dir around
master
Harald Hoyer 2016-06-29 17:32:31 +02:00
parent c98d1756f7
commit 3889234f71
1 changed files with 8 additions and 6 deletions

View File

@ -823,13 +823,7 @@ readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)"
printf "%s\n" "dracut: mktemp -p '$TMPDIR/' -d -t dracut.XXXXXX failed." >&2
exit 1
}
readonly initdir="${DRACUT_TMPDIR}/initramfs"
mkdir "$initdir"

if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then
readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio"
mkdir "$early_cpio_dir"
fi
# clean up after ourselves no matter how we die.
trap '
ret=$?;
@ -840,6 +834,14 @@ trap '
# clean up after ourselves no matter how we die.
trap 'exit 1;' SIGINT

readonly initdir="${DRACUT_TMPDIR}/initramfs"
mkdir "$initdir"

if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then
readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio"
mkdir "$early_cpio_dir"
fi

export DRACUT_RESOLVE_LAZY="1"

if [[ $print_cmdline ]]; then