Blame 0095-dracut.sh-make-tmp-dirs-after-the-trap-function-is-i.patch

Harald Hoyer 414eba
From 3889234f7116d7f0b39a609d5d65c490251f7d5e Mon Sep 17 00:00:00 2001
Harald Hoyer 414eba
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 414eba
Date: Wed, 29 Jun 2016 17:32:31 +0200
Harald Hoyer 414eba
Subject: [PATCH] dracut.sh: make tmp dirs after the trap function is installed
Harald Hoyer 414eba
Harald Hoyer 414eba
otherwise a good timed ctrl-c will leave the tmp dir around
Harald Hoyer 414eba
---
Harald Hoyer 414eba
 dracut.sh | 14 ++++++++------
Harald Hoyer 414eba
 1 file changed, 8 insertions(+), 6 deletions(-)
Harald Hoyer 414eba
Harald Hoyer 414eba
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer 414eba
index a50eaff..36607cf 100755
Harald Hoyer 414eba
--- a/dracut.sh
Harald Hoyer 414eba
+++ b/dracut.sh
Harald Hoyer 414eba
@@ -823,13 +823,7 @@ readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)"
Harald Hoyer 414eba
     printf "%s\n" "dracut: mktemp -p '$TMPDIR/' -d -t dracut.XXXXXX failed." >&2
Harald Hoyer 414eba
     exit 1
Harald Hoyer 414eba
 }
Harald Hoyer 414eba
-readonly initdir="${DRACUT_TMPDIR}/initramfs"
Harald Hoyer 414eba
-mkdir "$initdir"
Harald Hoyer 414eba
 
Harald Hoyer 414eba
-if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then
Harald Hoyer 414eba
-    readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio"
Harald Hoyer 414eba
-    mkdir "$early_cpio_dir"
Harald Hoyer 414eba
-fi
Harald Hoyer 414eba
 # clean up after ourselves no matter how we die.
Harald Hoyer 414eba
 trap '
Harald Hoyer 414eba
     ret=$?;
Harald Hoyer 414eba
@@ -840,6 +834,14 @@ trap '
Harald Hoyer 414eba
 # clean up after ourselves no matter how we die.
Harald Hoyer 414eba
 trap 'exit 1;' SIGINT
Harald Hoyer 414eba
 
Harald Hoyer 414eba
+readonly initdir="${DRACUT_TMPDIR}/initramfs"
Harald Hoyer 414eba
+mkdir "$initdir"
Harald Hoyer 414eba
+
Harald Hoyer 414eba
+if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then
Harald Hoyer 414eba
+    readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio"
Harald Hoyer 414eba
+    mkdir "$early_cpio_dir"
Harald Hoyer 414eba
+fi
Harald Hoyer 414eba
+
Harald Hoyer 414eba
 export DRACUT_RESOLVE_LAZY="1"
Harald Hoyer 414eba
 
Harald Hoyer 414eba
 if [[ $print_cmdline ]]; then