From: Harald Hoyer Date: Mon, 2 Aug 2010 07:40:55 +0000 (+0200) Subject: crypt: loop until all non-busy crypt devs closed X-Git-Tag: 007~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=606852a4a68b4aa9528d484e341520c4496b8a7a;p=thirdparty%2Fdracut.git crypt: loop until all non-busy crypt devs closed --- diff --git a/modules.d/90crypt/crypt-cleanup.sh b/modules.d/90crypt/crypt-cleanup.sh index a9c976a7b..1242b1cad 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 7a7418d57..0a1a8e066 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