Merge pull request #157 from ddiss/fix_relative_tmpdir

dracut.sh: support --tmpdir as a relative path
master
Harald Hoyer 2017-01-09 10:42:40 +01:00 committed by GitHub
commit 39c725dc4e
1 changed files with 5 additions and 1 deletions

View File

@ -820,7 +820,11 @@ esac

[[ $reproducible == yes ]] && DRACUT_REPRODUCIBLE=1

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