summaryrefslogtreecommitdiff
path: root/dracut.sh
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-03-09 15:30:44 +0100
committerHarald Hoyer <harald@redhat.com>2013-03-09 15:31:09 +0100
commitd008b6b89f69772a119da779c9e934e9bdd426ec (patch)
tree4709c8a1026f9dc784c88b60622be77d6ed796c0 /dracut.sh
parentaede120c92e08712e5ab93b283b12ab5f3df510d (diff)
downloaddracut-d008b6b89f69772a119da779c9e934e9bdd426ec.tar.gz
dracut-d008b6b89f69772a119da779c9e934e9bdd426ec.tar.bz2
dracut-d008b6b89f69772a119da779c9e934e9bdd426ec.zip
dracut.sh: move cleanup trap, just after mktemp
Diffstat (limited to 'dracut.sh')
-rwxr-xr-xdracut.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/dracut.sh b/dracut.sh
index 8f3e5d21..860cfb5c 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -623,6 +623,11 @@ readonly initdir=$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)
exit 1
}
+# clean up after ourselves no matter how we die.
+trap 'ret=$?;[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf "$initdir";exit $ret; };' EXIT
+# clean up after ourselves no matter how we die.
+trap 'exit 1;' SIGINT
+
export DRACUT_KERNEL_LAZY="1"
export DRACUT_RESOLVE_LAZY="1"
@@ -742,11 +747,6 @@ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
exit 1
fi
-# clean up after ourselves no matter how we die.
-trap 'ret=$?;[[ $keep ]] && echo "Not removing $initdir." >&2 || rm -rf "$initdir";exit $ret;' EXIT
-# clean up after ourselves no matter how we die.
-trap 'exit 1;' SIGINT
-
# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"