]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
cryptroot-ask: no warn if /run/cryptsetup exist
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Sat, 14 Mar 2020 04:44:47 +0000 (11:44 +0700)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 16 Mar 2020 17:26:33 +0000 (18:26 +0100)
In either case:
- encrypted device is decrypted, udev will trigger device changes again,
- multiple encrypted device,

cryptroot-ask will run multiple time, then report:
> mkdir: cannot create directory '/run/cryptsetup': File exists

Pass `-p` into mkdir to ignore that warning.

modules.d/90crypt/cryptroot-ask.sh

index e1f17975ef37b0b9cb3e0f04fcc51f98c236cd1f..97047ae9c059e77d73f6a8f868b5bfe7ff51a6a6 100755 (executable)
@@ -8,7 +8,7 @@ NEWROOT=${NEWROOT:-"/sysroot"}
 
 . /lib/dracut-lib.sh
 
-mkdir -m 0700 /run/cryptsetup
+mkdir -p -m 0700 /run/cryptsetup
 
 # if device name is /dev/dm-X, convert to /dev/mapper/name
 if [ "${1##/dev/dm-}" != "$1" ]; then