]> code.ossystems Code Review - openembedded-core.git/commitdiff
initrdscripts: mount / as read-only when live-booting
authorRoss Burton <ross.burton@intel.com>
Thu, 18 Jul 2013 13:59:42 +0000 (14:59 +0100)
committerSaul Wold <sgw@linux.intel.com>
Mon, 22 Jul 2013 16:44:10 +0000 (09:44 -0700)
So that the root filesystem can be fsck'd properly, mount it read only.  Either
initscripts or systemd will re-mount as read-write in early boot.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-core/initrdscripts/files/init-live.sh

index 890c56280adfdb25abecdd48ff5345b1227729ea..c56c79abc23503932b4e82a7ff6d2ea9bf0a1daf 100644 (file)
@@ -157,7 +157,7 @@ mount_and_boot() {
     case $union_fs_type in
        "overlayfs")
            mkdir -p /rootfs.ro /rootfs.rw
-           if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
+           if ! mount -o ro,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
                rm -rf /rootfs.ro /rootfs.rw
                fatal "Could not mount rootfs image"
            else
@@ -170,7 +170,7 @@ mount_and_boot() {
            ;;
        "aufs")
            mkdir -p /rootfs.ro /rootfs.rw
-           if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
+           if ! mount -o ro,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
                rm -rf /rootfs.ro /rootfs.rw
                fatal "Could not mount rootfs image"
            else
@@ -182,7 +182,7 @@ mount_and_boot() {
            fi
            ;;
        "")
-           if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+           if ! mount -o ro,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
                fatal "Could not mount rootfs image"
            fi
            ;;