summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2010-08-02 09:40:55 +0200
committerHarald Hoyer <harald@redhat.com>2010-08-02 09:59:10 +0200
commit606852a4a68b4aa9528d484e341520c4496b8a7a (patch)
treed40120e330cf6c22835d8b5477920a03dc3e5b06
parent8220945b2cb9aa4e47a16536f73af1c7b14b05e6 (diff)
downloaddracut-606852a4a68b4aa9528d484e341520c4496b8a7a.tar.gz
dracut-606852a4a68b4aa9528d484e341520c4496b8a7a.tar.bz2
dracut-606852a4a68b4aa9528d484e341520c4496b8a7a.zip
crypt: loop until all non-busy crypt devs closed
-rwxr-xr-xmodules.d/90crypt/crypt-cleanup.sh8
-rwxr-xr-xmodules.d/90crypt/install1
2 files changed, 6 insertions, 3 deletions
diff --git a/modules.d/90crypt/crypt-cleanup.sh b/modules.d/90crypt/crypt-cleanup.sh
index a9c976a7..1242b1ca 100755
--- a/modules.d/90crypt/crypt-cleanup.sh
+++ b/modules.d/90crypt/crypt-cleanup.sh
@@ -2,6 +2,10 @@
# close everything which is not busy
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
-for i in /dev/mapper/luks-*; do
- cryptsetup luksClose $i >/dev/null 2>&1
+while true; do
+ local do_break="y"
+ for i in /dev/mapper/luks-*; do
+ cryptsetup luksClose $i >/dev/null 2>&1 && do_break=n
+ done
+ [ "$do_break" = "y" ] && break
done
diff --git a/modules.d/90crypt/install b/modules.d/90crypt/install
index 7a7418d5..0a1a8e06 100755
--- a/modules.d/90crypt/install
+++ b/modules.d/90crypt/install
@@ -3,5 +3,4 @@ inst cryptsetup
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
-inst_hook pre-pivot 31 "$moddir/crypt-cleanup.sh"
inst /etc/crypttab