From: Daniel Molkentin Date: Tue, 29 Oct 2019 13:29:34 +0000 (+0100) Subject: 90crypt: Do not call cryptsetup in a systemd environment X-Git-Tag: 050~7 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fdracut.git;a=commitdiff_plain;h=452cb404972a33afebbda2929d68b6dfe15147dc 90crypt: Do not call cryptsetup in a systemd environment systemd provides its own cryptsetup facilities, and the cryptsetup binary might not even exist, failing to execute the discard flag processing. Fixes #602 --- diff --git a/modules.d/90crypt/crypt-run-generator.sh b/modules.d/90crypt/crypt-run-generator.sh index 8dad76ba1..7a8cfdff1 100755 --- a/modules.d/90crypt/crypt-run-generator.sh +++ b/modules.d/90crypt/crypt-run-generator.sh @@ -11,7 +11,7 @@ crypttab_contains "$luks" "$dev" && exit 0 allowdiscards="-" # parse for allow-discards -if strstr "$(cryptsetup --help)" "allow-discards"; then +if [ -n "$DRACUT_SYSTEMD" ] || strstr "$(cryptsetup --help)" "allow-discards"; then if discarduuids=$(getargs "rd.luks.allow-discards"); then discarduuids=$(str_replace "$discarduuids" 'luks-' '') if strstr " $discarduuids " " ${luks##luks-}"; then