Seems that dmsetup table is broken in recent lvm2, let's support "x: table" as well.
authorMilan Broz <gmazyland@gmail.com>
Mon, 13 Jun 2011 16:45:09 +0000 (16:45 +0000)
committerMilan Broz <gmazyland@gmail.com>
Mon, 13 Jun 2011 16:45:09 +0000 (16:45 +0000)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@551 36d66b0a-2a48-0410-832c-cd162a569da5

tests/mode-test
tests/password-hash-test

index ba6ac0a..9a2ad8b 100755 (executable)
@@ -51,7 +51,7 @@ add_device() {
 
 dmcrypt_check() # device outstring
 {
-       X=$(dmsetup table $1 2>/dev/null | cut -d' '  -f 4)
+       X=$(dmsetup table $1 2>/dev/null | sed 's/.*: //' | cut -d' '  -f 4)
        if [ $X = $2 ] ; then
                echo -n "[table OK]"
        else
index e45f559..5e3a3d8 100755 (executable)
@@ -63,7 +63,7 @@ crypt_key() # hash keysize pwd/file name outkey [limit]
                fi
        fi
 
-       VKEY=$(dmsetup table $DEV2 --showkeys 2>/dev/null | cut -d' '  -f 5)
+       VKEY=$(dmsetup table $DEV2 --showkeys 2>/dev/null | sed 's/.*: //' | cut -d' '  -f 5)
        if [ "$VKEY" != "$5" ] ; then
                echo " [FAILED]"
                echo "expected: $5"