Harald Hoyer 308914
From 17d62d12065c264d899609cf69e8d913fc84460d Mon Sep 17 00:00:00 2001
Harald Hoyer 308914
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
Harald Hoyer 308914
 <congdanhqx@gmail.com>
Harald Hoyer 308914
Date: Sat, 14 Mar 2020 11:44:47 +0700
Harald Hoyer 308914
Subject: [PATCH] cryptroot-ask: no warn if /run/cryptsetup exist
Harald Hoyer 308914
Harald Hoyer 308914
In either case:
Harald Hoyer 308914
- encrypted device is decrypted, udev will trigger device changes again,
Harald Hoyer 308914
- multiple encrypted device,
Harald Hoyer 308914
Harald Hoyer 308914
cryptroot-ask will run multiple time, then report:
Harald Hoyer 308914
> mkdir: cannot create directory '/run/cryptsetup': File exists
Harald Hoyer 308914
Harald Hoyer 308914
Pass `-p` into mkdir to ignore that warning.
Harald Hoyer 308914
---
Harald Hoyer 308914
 modules.d/90crypt/cryptroot-ask.sh | 2 +-
Harald Hoyer 308914
 1 file changed, 1 insertion(+), 1 deletion(-)
Harald Hoyer 308914
Harald Hoyer 308914
diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh
Harald Hoyer 308914
index e1f17975..97047ae9 100755
Harald Hoyer 308914
--- a/modules.d/90crypt/cryptroot-ask.sh
Harald Hoyer 308914
+++ b/modules.d/90crypt/cryptroot-ask.sh
Harald Hoyer 308914
@@ -8,7 +8,7 @@ NEWROOT=${NEWROOT:-"/sysroot"}
Harald Hoyer 308914
 
Harald Hoyer 308914
 . /lib/dracut-lib.sh
Harald Hoyer 308914
 
Harald Hoyer 308914
-mkdir -m 0700 /run/cryptsetup
Harald Hoyer 308914
+mkdir -p -m 0700 /run/cryptsetup
Harald Hoyer 308914
 
Harald Hoyer 308914
 # if device name is /dev/dm-X, convert to /dev/mapper/name
Harald Hoyer 308914
 if [ "${1##/dev/dm-}" != "$1" ]; then
Harald Hoyer 308914