Blame 0017-90crypt-parse-crypt.sh-simplify-rd.luks.uuid-testing.patch

Harald Hoyer ada75c
From 8d021e4b8a5aaaa129ae53358cd108f589881182 Mon Sep 17 00:00:00 2001
Harald Hoyer ada75c
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer ada75c
Date: Wed, 29 Feb 2012 16:20:02 +0100
Harald Hoyer ada75c
Subject: [PATCH] 90crypt/parse-crypt.sh: simplify rd.luks.uuid testing
Harald Hoyer ada75c
Harald Hoyer ada75c
---
Harald Hoyer ada75c
 modules.d/90crypt/parse-crypt.sh |   15 ++-------------
Harald Hoyer ada75c
 1 files changed, 2 insertions(+), 13 deletions(-)
Harald Hoyer ada75c
Harald Hoyer ada75c
diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh
Harald Hoyer ada75c
index 2ab3a9f..f96b59a 100755
Harald Hoyer ada75c
--- a/modules.d/90crypt/parse-crypt.sh
Harald Hoyer ada75c
+++ b/modules.d/90crypt/parse-crypt.sh
Harald Hoyer ada75c
@@ -24,21 +24,10 @@ else
Harald Hoyer ada75c
                 printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
Harald Hoyer ada75c
             } >> /etc/udev/rules.d/70-luks.rules.new
Harald Hoyer ada75c
 
Harald Hoyer ada75c
-
Harald Hoyer ada75c
-            [ -e $hookdir/initqueue/finished/90-crypt.sh ] || \
Harald Hoyer ada75c
-            {
Harald Hoyer ada75c
-                printf -- 'UUIDS=:\n'
Harald Hoyer ada75c
-                printf -- 'for dm in /dev/dm-*; do\n'
Harald Hoyer ada75c
-                printf -- '[ -e "$dm" ] || exit 1\n'
Harald Hoyer ada75c
-                printf -- 'dmid=`/sbin/dmsetup info -c -o uuid --noheadings "$dm"`\n'
Harald Hoyer ada75c
-                printf -- 'uuid=${dmid#CRYPT-LUKS*-}\n'
Harald Hoyer ada75c
-                printf -- '[ "x$uuid" = "x$dmid" ] && continue\n'
Harald Hoyer ada75c
-                printf -- 'UUIDS="${UUIDS}${uuid%%%%-*}:"\n'
Harald Hoyer ada75c
-                printf -- 'done\n'
Harald Hoyer ada75c
-            } > $hookdir/initqueue/finished/90-crypt.sh
Harald Hoyer ada75c
             uuid=$luksid
Harald Hoyer ada75c
             while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
Harald Hoyer ada75c
-            printf -- '[ "x${UUIDS#*:%s*:}" != "x$UUIDS" ] || exit 1\n' $uuid >> $hookdir/initqueue/finished/90-crypt.sh
Harald Hoyer ada75c
+            printf -- '[ -e /dev/disk/by-id/dm-uuid-CRYPT-LUKS?-*%s*-* ] || exit 1\n' $uuid \
Harald Hoyer ada75c
+                >> $hookdir/initqueue/finished/90-crypt.sh
Harald Hoyer ada75c
 
Harald Hoyer ada75c
             {
Harald Hoyer ada75c
                 printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid