From 452cb404972a33afebbda2929d68b6dfe15147dc Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 29 Oct 2019 14:29:34 +0100 Subject: [PATCH] 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 --- modules.d/90crypt/crypt-run-generator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.2