]> TLD Linux GIT Repositories - rc-scripts.git/blobdiff - rc.d/init.d/cryptsetup
- version 0.5.3
[rc-scripts.git] / rc.d / init.d / cryptsetup
index 0e7f27222619bdf9750b0691e15aeddae5af12b8..d5ac2c315da0fe582c7bb5175f8fdb260d7ba12f 100755 (executable)
@@ -95,13 +95,17 @@ init_crypto() {
                        continue
                fi
 
+               if echo "$src" | grep -q -E "^UUID=" ; then
+                       src="/dev/disk/by-uuid/${src##UUID=}"
+               fi
+
                if [ ! -b "$src"  ]; then
                        nls "$src: No such device"
                        ret=1
                        continue
                fi
 
-               if /sbin/cryptsetup isLuks "$src" 2>/dev/null; then
+               if /sbin/cryptsetup --disable-locks isLuks "$src" 2>/dev/null; then
                        if key_is_random "$key"; then
                                nls "%s: LUKS requires non-random key, skipping" "$dst"
                                ret=1
@@ -110,9 +114,7 @@ init_crypto() {
                        if [ -n "$params" ]; then
                                nls "%s: options are invalid for LUKS partitions, ignoring them" "$dst"
                        fi
-                       /sbin/cryptsetup ${key:+-d $key} luksOpen "$src" "$dst" <&1
-               else
-                       /sbin/cryptsetup $params ${key:+-d $key} create "$dst" "$src" <&1 2>/dev/null
+                       /sbin/cryptsetup --disable-locks ${key:+-d $key} luksOpen "$src" "$dst" <&1
                fi
                rc=$?
                if [ $rc -ne 0 ]; then
@@ -142,7 +144,7 @@ halt_crypto() {
        [ -z "$dst" -o "${dst#\#}" != "$dst" ] && continue
         if [ -b "/dev/mapper/$dst" ]; then
             if LC_ALL=C /sbin/dmsetup info "$dst" | grep -q '^Open count: *0$'; then
-                /sbin/cryptsetup remove "$dst"
+                /sbin/cryptsetup --disable-locks remove "$dst"
             else
                 fnval=1
             fi