]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
98usrmount: force mounting /usr read-only option (rd.usrmount.ro)
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Fri, 29 Jun 2012 11:58:18 +0000 (13:58 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 2 Jul 2012 16:52:49 +0000 (18:52 +0200)
dracut.cmdline.7.asc
modules.d/98usrmount/mount-usr.sh

index 883223c323b42b3ee889eee0f42eaaea352d0e8e..5669700e8e3a7e2f2656b19270e3e692e4884670 100644 (file)
@@ -76,6 +76,11 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
 ----
 
 
+**rd.usrmount.ro**:
+    force mounting _/usr_ read-only.  Use this option if your init system
+    performs remount of _/usr_ the same as it does with rootfs.
+
+
 Misc
 ~~~~
 **rd.driver.blacklist=**_<drivername>[,<drivername>,...]_::
index 92638d1db977bc82c5edd897ce4c1b55f12a5248..748ac0121dc9c5bba3bc3e6c19a6053998bf8fc1 100755 (executable)
@@ -68,8 +68,13 @@ mount_usr()
         _ret=$?
         echo $_ret >/run/initramfs/usr-fsck
         if [ $_ret -ne 255 ]; then
-            info "Mounting /usr"
-            mount "$NEWROOT/usr" 2>&1 | vinfo
+            if getargbool 0 rd.usrmount.ro; then
+                info "Mounting /usr (read-only forced)"
+                mount -r "$NEWROOT/usr" 2>&1 | vinfo
+            else
+                info "Mounting /usr"
+                mount "$NEWROOT/usr" 2>&1 | vinfo
+            fi
         fi
     fi
 }