Adding upstream version 3.0~a37.
[live-boot-grml.git] / scripts / boot / 0120-read-only
index 588d57b..c05c162 100755 (executable)
@@ -4,11 +4,30 @@
 
 Read_only ()
 {
+       for _PARAMETER in ${_CMDLINE}
+       do
+               case "${_PARAMETER}" in
+                       live-boot.read-only=*|read-only=*)
+                               LIVE_READ_ONLY="true"
+                               LIVE_READ_ONLY_DEVICES="${_PARAMETER#*read-only=}"
+                               ;;
+
+                       live-boot.read-only|read-only)
+                               LIVE_READ_ONLY="true"
+                               ;;
+               esac
+       done
+
+       if [ "${LIVE_READ_ONLY}" != "true" ]
+       then
+               return 0
+       fi
+
        # Marking some block devices as read-only to ensure that nothing
        # gets written as linux still writes to 'only' read-only mounted filesystems.
-       _DEVICES="/dev/sd* /dev/vd*"
+       LIVE_READ_ONLY_DEVICES="${LIVE_READ_ONLY_DEVICES:-/dev/sd* /dev/vd*}"
 
-       for _DEVICE in ${_DEVICES}
+       for _DEVICE in $(echo ${LIVE_READ_ONLY_DEVICES} | sed -e 's|,| |g')
        do
                if [ ! -b "${_DEVICE}" ]
                then