Patchwork [V2,01/10] init-live.sh: make $ROOT_MOUNT/media writable when necessary

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date July 29, 2013, 2:33 a.m.
Message ID <bab9f2d5e700cc6862fe566a0202f53050ae8326.1375065009.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/54633/
State Accepted
Commit 7ab93ec66424282693be45e1e4a222c8bf3b3726
Headers show

Comments

Qi.Chen@windriver.com - July 29, 2013, 2:33 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

If the live image is mounted as read-only, we cannot make necessary
directories under $ROOT_MOUNT/media, so trying to move the mount points
lead to errors.

So in case that no unification filesystem mechanism is available in kernel
and the rootfs is mounted as read-only, we mount tmpfs on $ROOT_MOUNT/media
so that it's possible to make necessary directories under it.

[YOCTO #4881]
[YOCTO #4103]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index 86ecebf..0e0cf8a 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -200,6 +200,8 @@  mount_and_boot() {
 	"")
 	    if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
 		fatal "Could not mount rootfs image"
+	    else
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media
 	    fi
 	    ;;
     esac