Making read-only function self contained.
authorDaniel Baumann <daniel@debian.org>
Wed, 25 Jul 2012 14:46:11 +0000 (16:46 +0200)
committerDaniel Baumann <daniel@debian.org>
Wed, 25 Jul 2012 15:25:04 +0000 (17:25 +0200)
scripts/boot/0110-cmdline
scripts/boot/0120-read-only
scripts/boot/9990-main.sh

index a959c73..6486515 100755 (executable)
@@ -7,10 +7,6 @@ Cmdline ()
        for _PARAMETER in ${_CMDLINE}
        do
                case "${_PARAMETER}" in
-                       live-boot.read-only|read-only)
-                               LIVE_READ_ONLY="true"
-                               ;;
-
                        live-boot.verify-checksums|verify-checksums)
                                LIVE_VERIFY_CHECKSUMS="true"
                                ;;
index 588d57b..948c2d5 100755 (executable)
@@ -4,6 +4,20 @@
 
 Read_only ()
 {
+       for _PARAMETER in ${_CMDLINE}
+       do
+               case "${_PARAMETER}" in
+                       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*"
index b1bdf42..5be1277 100755 (executable)
@@ -28,11 +28,7 @@ Main ()
                        ;;
        esac
 
-       case "${LIVE_READ_ONLY}" in
-               true)
-                       Read_only
-                       ;;
-       esac
+       Read_only
 
        Select_eth_device