Changing persistent-encryption to accept a list TYPE... instead.
[live-boot-grml.git] / scripts / live
index 688c0a7..c28314f 100755 (executable)
@@ -262,6 +262,10 @@ Arguments ()
                                PERSISTENT_PATH="${ARGUMENT#persistent-path=}"
                                export PERSISTENT_PATH
                                ;;
+                       persistent-read-only)
+                               PERSISTENT_READONLY="Yes"
+                               export PERSISTENT_READONLY
+                               ;;
 
                        persistent-storage=*)
                                PERSISTENT_STORAGE="${ARGUMENT#persistent-storage=}"
@@ -391,19 +395,23 @@ Arguments ()
                export UNIONTYPE
        fi
 
-       if [ "${PERSISTENT_ENCRYPTION}" = "luks" ]
+       if [ -z "${PERSISTENT_ENCRYPTION}" ]
+       then
+               PERSISTENT_ENCRYPTION="none"
+               export PERSISTENT_ENCRYPTION
+       elif echo ${PERSISTENT_ENCRYPTION} | grep -qw luks
        then
                if ! modprobe dm-crypt
                then
                        log_warning_msg "Unable to load module dm-crypt"
-                       PERSISTENT_ENCRYPTION="none"
+                       PERSISTENT_ENCRYPTION=$(echo ${PERSISTENT_ENCRYPTION} | sed -e 's/\<luks,\|,\?luks$//g')
                        export PERSISTENT_ENCRYPTION
                fi
 
                if [ ! -x /lib/cryptsetup/askpass ] || [ ! -x /sbin/cryptsetup ]
                then
                        log_warning_msg "cryptsetup in unavailable"
-                       PERSISTENT_ENCRYPTION="none"
+                       PERSISTENT_ENCRYPTION=$(echo ${PERSISTENT_ENCRYPTION} | sed -e 's/\<luks,\|,\?luks$//g')
                        export PERSISTENT_ENCRYPTION
                fi
        fi
@@ -1186,7 +1194,10 @@ try_snap ()
                return 1
        fi
 
-       echo "export ${snap_type}SNAP=${snap_relpath}:${snapdev}:${snapfile}" >> snapshot.conf # for resync on reboot/halt
+       if [ -z ${PERSISTENT_READONLY} ]
+       then
+               echo "export ${snap_type}SNAP=${snap_relpath}:${snapdev}:${snapfile}" >> snapshot.conf # for resync on reboot/halt
+       fi
        return 0
 }