crypt: Fix device detection.
PATCH 1/1 crypt: Fix device detection.
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(-)
modules.d/90crypt/module-setup.sh +4 -10
@@ -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
Signature · 1 line
1.8.1.3
A message that is not in the archive (sent off-list or not yet received): 1360715138-19755-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org
Am 13.02.2013 01:25, schrieb Colin Guthrie:
Quoted 8 lines
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
Does this commit fix the issue instead?
A message that is not in the archive (sent off-list or not yet received): [email protected]
'Twas brillig, and Harald Hoyer at 13/02/13 10:52 did gyre and gimble:
Quoted 5 lines
Am 13.02.2013 01:25, schrieb Colin Guthrie:
Quoted 4 lines
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.
Quoted 8 lines
Quoted 4 lines
Code now mirrors the lvm module's check
Does this commit fix the issue instead?
I'll test tonight in my VM.
Col
Signature · 10 lines
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/
'Twas brillig, and Harald Hoyer at 13/02/13 10:52 did gyre and gimble:
Quoted 5 lines
Am 13.02.2013 01:25, schrieb Colin Guthrie:
Quoted 4 lines
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.
Quoted 8 lines
Quoted 4 lines
Code now mirrors the lvm module's check
Does this commit fix the issue instead?
ACK, that commit also fixes the issue on my test system.
Thanks :)
Col
Signature · 10 lines
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/