All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypt: Fix device detection.
@ 2013-02-13  0:25 Colin Guthrie
       [not found] ` <1360715138-19755-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Guthrie @ 2013-02-13  0:25 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Colin Guthrie

The host device/fs rework led to a regression in crypt detection.
It was only checking the host filesystems, not it's slaves and thus
never detected if crypt support was needed.

Code now mirrors the lvm module's check

https://bugs.mageia.org/show_bug.cgi?id=9040
---

I've not specifically checked, but other modules might also have been affected by this change in behaviour.


 modules.d/90crypt/module-setup.sh | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 5c1c71b..9980f3f 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -8,15 +8,9 @@ check() {
     type -P cryptsetup >/dev/null || return 1
 
     check_crypt() {
-        local dev=$1 fs=$2
-        [[ $fs = "crypto_LUKS" ]] || return 1
-        ID_FS_UUID=$(udevadm info --query=property --name=$dev \
-            | while read line; do
-                [[ ${line#ID_FS_UUID} = $line ]] && continue
-                eval "$line"
-                echo $ID_FS_UUID
-                break
-                done)
+        local ID_FS_TYPE ID_FS_UUID
+        eval $(udevadm info --query=property --name=/dev/block/$1|egrep '(ID_FS_TYPE|ID_FS_UUID)=')
+        [[ ${ID_FS_TYPE} = "crypto_LUKS" ]] || return 1
         [[ ${ID_FS_UUID} ]] || return 1
         if ! [[ $kernel_only ]]; then
             echo " rd.luks.uuid=luks-${ID_FS_UUID} " >> "${initdir}/etc/cmdline.d/90crypt.conf"
@@ -25,7 +19,7 @@ check() {
     }
 
     [[ $hostonly ]] || [[ $mount_needs ]] && {
-        for_each_host_dev_fs check_crypt || return 1
+        for_each_host_dev_and_slaves check_crypt || return 1
     }
 
     return 0
-- 
1.8.1.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypt: Fix device detection.
       [not found] ` <1360715138-19755-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
@ 2013-02-13 10:52   ` Harald Hoyer
       [not found]     ` <511B708A.60106-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Harald Hoyer @ 2013-02-13 10:52 UTC (permalink / raw)
  To: Colin Guthrie; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Am 13.02.2013 01:25, schrieb Colin Guthrie:
> The host device/fs rework led to a regression in crypt detection.
> It was only checking the host filesystems, not it's slaves and thus
> never detected if crypt support was needed.
> 
> Code now mirrors the lvm module's check
> 
> https://bugs.mageia.org/show_bug.cgi?id=9040
> ---

Does this commit fix the issue instead?

http://git.kernel.org/?p=boot/dracut/dracut.git;a=commitdiff;h=19bab59c48ba6edbdf9d6d9f339baef250bdd4a6


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypt: Fix device detection.
       [not found]     ` <511B708A.60106-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2013-02-13 11:19       ` Colin Guthrie
  2013-02-13 22:25       ` Colin Guthrie
  1 sibling, 0 replies; 4+ messages in thread
From: Colin Guthrie @ 2013-02-13 11:19 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

'Twas brillig, and Harald Hoyer at 13/02/13 10:52 did gyre and gimble:
> Am 13.02.2013 01:25, schrieb Colin Guthrie:
>> The host device/fs rework led to a regression in crypt detection.
>> It was only checking the host filesystems, not it's slaves and thus
>> never detected if crypt support was needed.
>>
>> Code now mirrors the lvm module's check
>>
>> https://bugs.mageia.org/show_bug.cgi?id=9040
>> ---
> 
> Does this commit fix the issue instead?
> 
> http://git.kernel.org/?p=boot/dracut/dracut.git;a=commitdiff;h=19bab59c48ba6edbdf9d6d9f339baef250bdd4a6

I'll test tonight in my VM.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypt: Fix device detection.
       [not found]     ` <511B708A.60106-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2013-02-13 11:19       ` Colin Guthrie
@ 2013-02-13 22:25       ` Colin Guthrie
  1 sibling, 0 replies; 4+ messages in thread
From: Colin Guthrie @ 2013-02-13 22:25 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

'Twas brillig, and Harald Hoyer at 13/02/13 10:52 did gyre and gimble:
> Am 13.02.2013 01:25, schrieb Colin Guthrie:
>> The host device/fs rework led to a regression in crypt detection.
>> It was only checking the host filesystems, not it's slaves and thus
>> never detected if crypt support was needed.
>>
>> Code now mirrors the lvm module's check
>>
>> https://bugs.mageia.org/show_bug.cgi?id=9040
>> ---
> 
> Does this commit fix the issue instead?
> 
> http://git.kernel.org/?p=boot/dracut/dracut.git;a=commitdiff;h=19bab59c48ba6edbdf9d6d9f339baef250bdd4a6

ACK, that commit also fixes the issue on my test system.

Thanks :)

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-13 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-13  0:25 [PATCH] crypt: Fix device detection Colin Guthrie
     [not found] ` <1360715138-19755-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2013-02-13 10:52   ` Harald Hoyer
     [not found]     ` <511B708A.60106-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-02-13 11:19       ` Colin Guthrie
2013-02-13 22:25       ` Colin Guthrie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.