From f3e552d67cbb117e0d9e14572fe2e623308223a0 Mon Sep 17 00:00:00 2001 From: Peter Oberparleiter Date: Mon, 28 Aug 2017 16:13:45 +0200 Subject: [PATCH] zdev: Fix zdev dracut module temp file location During processing, the zdev-provided dracut module creates a temporary file using the mktemp tool. Due to a missing path specification in the filename template, mktemp tries to create the temporary file in the current working directory which fails if that directory is not writable: # cd /sys # dracut -Nf mktemp: failed to create file via template 'dracut-zdev.XXXX': No such file or directory chzdev: Could not write to file : No such file or directory sed: can't read : No such file or directory chzdev: Could not open file : No such file or directory Fix this by specifying option --tmpdir when calling mktemp. Signed-off-by: Peter Oberparleiter Signed-off-by: Michael Holzheu --- zdev/dracut/95zdev/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdev/dracut/95zdev/module-setup.sh b/zdev/dracut/95zdev/module-setup.sh index f7f727ff..7c67cd73 100644 --- a/zdev/dracut/95zdev/module-setup.sh +++ b/zdev/dracut/95zdev/module-setup.sh @@ -35,7 +35,7 @@ installkernel() { } install() { - local _tempfile=$(mktemp dracut-zdev.XXXX) + local _tempfile=$(mktemp --tmpdir dracut-zdev.XXXXXX) if chzdev --export - --persistent --by-path / >/dev/null 2>&1 ; then # Use persistent configuration