Adding persistent-method=METHOD...
[live-boot-grml.git] / scripts / live-helpers
index 950bbda..f67e421 100644 (file)
@@ -324,12 +324,24 @@ find_cow_device ()
                        if echo "${black_listed_devices}" | grep -q -w "${devname}"
                        then
                                # skip this subdevice
-                               break
+                               continue
                        fi
 
                        # Checking for a luks device
-                       if [ "${PERSISTENT_ENCRYPTION}" = "luks" ] && [ -e /sbin/cryptsetup ] && /sbin/cryptsetup isLuks ${devname}
+                       if [ "${PERSISTENT_ENCRYPTION}" = "luks" ] && [ -e /sbin/cryptsetup ]
                        then
+                               if ! modprobe dm-crypt
+                               then
+                                       log_warning_msg "Unable to load module dm-crypt"
+                                       continue
+                               fi
+
+                               if ! /sbin/cryptsetup isLuks ${devname}
+                               then
+                                       # we only look for encrypted subdevices
+                                       continue
+                               fi
+
                                while true
                                do
                                        load_keymap
@@ -357,13 +369,13 @@ find_cow_device ()
                                done
                        fi
 
-                       if [ "$(/sbin/blkid -s LABEL -o value $devname 2>/dev/null)" = "${pers_label}" ]
+                       if echo ${PERSISTENT_STORAGE} | grep -qw filesystem && [ "$(/sbin/blkid -s LABEL -o value $devname 2>/dev/null)" = "${pers_label}" ]
                        then
                                echo "${devname}"
                                return 0
                        fi
 
-                       if [ "${PERSISTENT}" = "nofiles" ]
+                       if ! echo ${PERSISTENT_STORAGE} | grep -qw file
                        then
                                # do not mount the device to find for image files
                                # just skip this