]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
crypt/parse-crypt.sh: create udev rule for systemd
authorHarald Hoyer <harald@redhat.com>
Thu, 4 Apr 2013 10:54:59 +0000 (12:54 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 4 Apr 2013 10:54:59 +0000 (12:54 +0200)
Start the systemd-cryptsetup@luks-*.service for the detected crypto_LUKS
device in the initqueue, so we block in the initqueue and wait for the
password entry.

modules.d/90crypt/parse-crypt.sh

index d61220c4a5b6a5db5c8a9bf9645f58f864f30fed..4cb281bf9db01b99f0c8c8e7973b6d57f999f4d3 100755 (executable)
@@ -27,6 +27,14 @@ else
                     printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
                     printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
                 } >> /etc/udev/rules.d/70-luks.rules.new
+            else
+                {
+                    printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
+                    printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
+                    printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
+                    printf -- '--name systemd-cryptsetup-%%k %s start ' $(command -v systemctl)
+                    printf -- 'systemd-cryptsetup@luks$$(dev_unit_name -$env{ID_FS_UUID}).service"\n'
+                } >> /etc/udev/rules.d/70-luks.rules.new
             fi
 
             uuid=$luksid