Disabling persistent-encryption=luks if dependencies are unavailable.
authorTails developers <amnesia@boum.org>
Thu, 10 Nov 2011 18:05:00 +0000 (19:05 +0100)
committerDaniel Baumann <daniel@debian.org>
Thu, 24 Nov 2011 08:42:08 +0000 (09:42 +0100)
Current dependencies are dm-crypt, cryptsetup and askpass.

scripts/live
scripts/live-helpers

index e0663b6..688c0a7 100755 (executable)
@@ -391,6 +391,23 @@ Arguments ()
                export UNIONTYPE
        fi
 
+       if [ "${PERSISTENT_ENCRYPTION}" = "luks" ]
+       then
+               if ! modprobe dm-crypt
+               then
+                       log_warning_msg "Unable to load module dm-crypt"
+                       PERSISTENT_ENCRYPTION="none"
+                       export PERSISTENT_ENCRYPTION
+               fi
+
+               if [ ! -x /lib/cryptsetup/askpass ] || [ ! -x /sbin/cryptsetup ]
+               then
+                       log_warning_msg "cryptsetup in unavailable"
+                       PERSISTENT_ENCRYPTION="none"
+                       export PERSISTENT_ENCRYPTION
+               fi
+       fi
+
        if [ -n "${PERSISTENT}" ] && [ -z "${PERSISTENT_METHOD}" ]
        then
                PERSISTENT_METHOD="snapshot,overlay"
index bbed909..33d2ee7 100644 (file)
@@ -344,20 +344,8 @@ find_persistent_media ()
                luks_device=""
 
                # Checking for a luks device
-               if [ "${PERSISTENT_ENCRYPTION}" = "luks" ] && [ -e /sbin/cryptsetup ]
+               if [ "${PERSISTENT_ENCRYPTION}" = "luks" ]
                then
-                       if ! modprobe dm-crypt
-                       then
-                               log_warning_msg "Unable to load module dm-crypt"
-                               continue
-                       fi
-
-                       if [ ! -x /lib/cryptsetup/askpass ] || [ ! -x /sbin/cryptsetup ]
-                       then
-                               log_warning_msg "cryptsetup in unavailable"
-                               continue
-                       fi
-
                        if ! /sbin/cryptsetup isLuks ${dev}
                        then
                                # skip device since we strictly want luks devices