3a8223
From aa4cf6df94dd3a858144040138d970a57c701a8d Mon Sep 17 00:00:00 2001
3a8223
From: Jonathan Lebon <jonathan@jlebon.com>
3a8223
Date: Thu, 12 Nov 2020 11:27:39 -0500
3a8223
Subject: [PATCH] 90crypt: pull in remote-cryptsetup.target enablement
3a8223
3a8223
This should've been part of #964. As mentioned there, the
3a8223
`initrd-cryptsetup.target` approach was reverted in the end, and we went
3a8223
back to relying in `remote-cryptsetup.target`:
3a8223
3a8223
https://github.com/systemd/systemd/pull/17467
3a8223
3a8223
So we do need to ship the enablement symlink for it.
3a8223
3a8223
(cherry picked from commit a23a4680e7d04d1016e9d5e4b53b1e65f1ca98aa)
3a8223
3a8223
Resolves: #1897384
3a8223
---
3a8223
 modules.d/90crypt/module-setup.sh | 4 ++++
3a8223
 1 file changed, 4 insertions(+)
3a8223
3a8223
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
3a8223
index 1ec59096..a26b6dff 100755
3a8223
--- a/modules.d/90crypt/module-setup.sh
3a8223
+++ b/modules.d/90crypt/module-setup.sh
3a8223
@@ -120,6 +120,8 @@ install() {
3a8223
     inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
3a8223
 
3a8223
     if dracut_module_included "systemd"; then
3a8223
+        # the cryptsetup targets are already pulled in by 00systemd, but not
3a8223
+        # the enablement symlinks
3a8223
         inst_multiple -o \
3a8223
                       $systemdutildir/system-generators/systemd-cryptsetup-generator \
3a8223
                       $systemdutildir/systemd-cryptsetup \
3a8223
@@ -127,6 +129,8 @@ install() {
3a8223
                       $systemdsystemunitdir/systemd-ask-password-console.service \
3a8223
                       $systemdsystemunitdir/cryptsetup.target \
3a8223
                       $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
3a8223
+                      $systemdsystemunitdir/remote-cryptsetup.target \
3a8223
+                      $systemdsystemunitdir/initrd-root-device.target.wants/remote-cryptsetup.target \
3a8223
                       systemd-ask-password systemd-tty-ask-password-agent
3a8223
         inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
3a8223
     fi
3a8223