<commit_before>diff -Naur 90crypt.backup/cryptroot-ask.sh 90crypt/cryptroot-ask.sh
--- 90crypt.backup/cryptroot-ask.sh	2016-06-07 04:36:56.059789343 +0000
+++ 90crypt/cryptroot-ask.sh	2016-06-07 04:35:43.408227055 +0000
@@ -65,6 +65,25 @@
 
 #
 # Open LUKS device
+MountPoint=/tmp-keydisk-mount
+KeyFileName=LinuxPassPhraseFileName
+echo "Trying to get the key from disks ..." >&2
+mkdir -p $MountPoint >&2
+modprobe vfat >/dev/null >&2
+for SFS in /dev/sd*; do
+echo "> Trying device:$SFS..." >&2
+mount ${SFS}1 $MountPoint -t vfat -r >&2
+if [ -f $MountPoint/$KeyFileName ]; then
+echo "> keyfile got..." >&2
+luksfile=$MountPoint/$KeyFileName
+break
+fi
+done
+
+mkdir /boot
+mount /dev/sda1 /boot
+cryptsetupopts="$cryptsetupopts --header /boot/luks/osluksheader"
+
 #
 
 info "luksOpen $device $luksname $luksfile $luksoptions"
diff -Naur 90crypt.backup/module-setup.sh 90crypt/module-setup.sh
--- 90crypt.backup/module-setup.sh	2016-06-07 04:36:56.059789343 +0000
+++ 90crypt/module-setup.sh	2016-06-07 04:35:43.408227055 +0000
@@ -33,8 +33,7 @@
         [[ "${host_fs_types[$dev]}" != "crypto_LUKS" ]] && continue
 
         UUID=$(
-            blkid -u crypto -o export $dev \
-                | while read line; do
+            blkid -u crypto -o export $dev                 | while read line; do
                 [[ ${line#UUID} = $line ]] && continue
                 printf "%s" "${line#UUID=}"
                 break
@@ -67,8 +66,7 @@
             [[ $_mapper = \#* ]] && continue
             [[ $_dev ]] || continue
 
-            [[ $_dev == UUID=* ]] && \
-                _dev="/dev/disk/by-uuid/${_dev#UUID=}"
+            [[ $_dev == UUID=* ]] &&                 _dev="/dev/disk/by-uuid/${_dev#UUID=}"
 
             for _hdev in "${!host_fs_types[@]}"; do
                 [[ ${host_fs_types[$_hdev]} == "crypto_LUKS" ]] || continue
@@ -82,14 +80,7 @@
 
     inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
 
-    inst_multiple -o \
-        $systemdutildir/system-generators/systemd-cryptsetup-generator \
-        $systemdutildir/systemd-cryptsetup \
-        $systemdsystemunitdir/systemd-ask-password-console.path \
-        $systemdsystemunitdir/systemd-ask-password-console.service \
-        $systemdsystemunitdir/cryptsetup.target \
-        $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
-        systemd-ask-password systemd-tty-ask-password-agent
-    inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
+    
+    
     dracut_need_initqueue
 }
diff -Naur 90crypt.backup/parse-crypt.sh 90crypt/parse-crypt.sh
--- 90crypt.backup/parse-crypt.sh	2016-06-07 04:36:56.059789343 +0000
+++ 90crypt/parse-crypt.sh	2016-06-07 04:37:57.213233266 +0000
@@ -1,6 +1,7 @@
 #!/bin/sh
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
+DRACUT_SYSTEMD=0
 
 type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
 
@@ -21,18 +22,18 @@
 
             luksid=${luksid##luks-}
 
-            if [ -z "$DRACUT_SYSTEMD" ]; then
+            if [ 1 ]; then
                 {
-                    printf -- 'ENV{DEVNAME}=="/dev/sda2", ' $luksid
+                    printf -- 'KERNEL=="/dev/sda2", ' $luksid
                     printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
                     printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
-                    printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
+                    printf -- '$env{DEVNAME} osencrypt %s"\n' $tout
                 } >> /etc/udev/rules.d/70-luks.rules.new
             else
                 if ! crypttab_contains "$luksid"; then
                     {
-                        printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
-                        printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
+                        printf -- 'KERNEL=="sda2", '
+                        
                         printf -- 'RUN+="%s --settled --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'
@@ -42,26 +43,26 @@
 
             uuid=$luksid
             while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
-            printf -- '[ -e /dev/disk/by-id/dm-uuid-CRYPT-LUKS?-*%s*-* ] || exit 1\n' $uuid \
+            printf -- '[ -e /dev/mapper/osencrypt ] || exit 1\n' $uuid \
                 >> $hookdir/initqueue/finished/90-crypt.sh
 
             {
-                printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid<commit_msg>Fix device name in dracut patch<commit_after>diff -Naur 90crypt.backup/cryptroot-ask.sh 90crypt/cryptroot-ask.sh
--- 90crypt.backup/cryptroot-ask.sh	2016-06-07 04:36:56.059789343 +0000
+++ 90crypt/cryptroot-ask.sh	2016-06-07 04:35:43.408227055 +0000
@@ -65,6 +65,25 @@
 
 #
 # Open LUKS device
+MountPoint=/tmp-keydisk-mount
+KeyFileName=LinuxPassPhraseFileName
+echo "Trying to get the key from disks ..." >&2
+mkdir -p $MountPoint >&2
+modprobe vfat >/dev/null >&2
+for SFS in /dev/sd*; do
+echo "> Trying device:$SFS..." >&2
+mount ${SFS}1 $MountPoint -t vfat -r >&2
+if [ -f $MountPoint/$KeyFileName ]; then
+echo "> keyfile got..." >&2
+luksfile=$MountPoint/$KeyFileName
+break
+fi
+done
+
+mkdir /boot
+mount /dev/sda1 /boot
+cryptsetupopts="$cryptsetupopts --header /boot/luks/osluksheader"
+
 #
 
 info "luksOpen $device $luksname $luksfile $luksoptions"
diff -Naur 90crypt.backup/module-setup.sh 90crypt/module-setup.sh
--- 90crypt.backup/module-setup.sh	2016-06-07 04:36:56.059789343 +0000
+++ 90crypt/module-setup.sh	2016-06-07 04:35:43.408227055 +0000
@@ -33,8 +33,7 @@
         [[ "${host_fs_types[$dev]}" != "crypto_LUKS" ]] && continue
 
         UUID=$(
-            blkid -u crypto -o export $dev \
-                | while read line; do
+            blkid -u crypto -o export $dev                 | while read line; do
                 [[ ${line#UUID} = $line ]] && continue
                 printf "%s" "${line#UUID=}"
                 break
@@ -67,8 +66,7 @@
             [[ $_mapper = \#* ]] && continue
             [[ $_dev ]] || continue
 
-            [[ $_dev == UUID=* ]] && \
-                _dev="/dev/disk/by-uuid/${_dev#UUID=}"
+            [[ $_dev == UUID=* ]] &&                 _dev="/dev/disk/by-uuid/${_dev#UUID=}"
 
             for _hdev in "${!host_fs_types[@]}"; do
                 [[ ${host_fs_types[$_hdev]} == "crypto_LUKS" ]] || continue
@@ -82,14 +80,7 @@
 
     inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
 
-    inst_multiple -o \
-        $systemdutildir/system-generators/systemd-cryptsetup-generator \
-        $systemdutildir/systemd-cryptsetup \
-        $systemdsystemunitdir/systemd-ask-password-console.path \
-        $systemdsystemunitdir/systemd-ask-password-console.service \
-        $systemdsystemunitdir/cryptsetup.target \
-        $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
-        systemd-ask-password systemd-tty-ask-password-agent
-    inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
+    
+    
     dracut_need_initqueue
 }
diff -Naur 90crypt.backup/parse-crypt.sh 90crypt/parse-crypt.sh
--- 90crypt.backup/parse-crypt.sh	2016-06-07 04:36:56.059789343 +0000
+++ 90crypt/parse-crypt.sh	2016-06-07 04:37:57.213233266 +0000
@@ -1,6 +1,7 @@
 #!/bin/sh
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
+DRACUT_SYSTEMD=0
 
 type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
 
@@ -21,18 +22,18 @@
 
             luksid=${luksid##luks-}
 
-            if [ -z "$DRACUT_SYSTEMD" ]; then
+            if [ 1 ]; then
                 {
-                    printf -- 'ENV{DEVNAME}=="/dev/sda2", ' $luksid
+                    printf -- 'KERNEL=="sda2", ' $luksid
                     printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
                     printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
-                    printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
+                    printf -- '$env{DEVNAME} osencrypt %s"\n' $tout
                 } >> /etc/udev/rules.d/70-luks.rules.new
             else
                 if ! crypttab_contains "$luksid"; then
                     {
-                        printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
-                        printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
+                        printf -- 'KERNEL=="sda2", '
+                        
                         printf -- 'RUN+="%s --settled --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'
@@ -42,26 +43,26 @@
 
             uuid=$luksid
             while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
-            printf -- '[ -e /dev/disk/by-id/dm-uuid-CRYPT-LUKS?-*%s*-* ] || exit 1\n' $uuid \
+            printf -- '[ -e /dev/mapper/osencrypt ] || exit 1\n' $uuid \
                 >> $hookdir/initqueue/finished/90-crypt.sh
 
             {
-                printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
{'fraction_non_alphanumeric': 0.1812030870070832, 'fraction_numerical': 0.054339782217993446, 'mean_word_length': 1.9233621755253398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3521270', 'n_tokens_mistral': 3807, 'n_tokens_neox': 3293, 'n_words': 592}