[1/9] init-live.sh: make $ROOT_MOUNT/media writable when necessary

Submitted by Qi.Chen@windriver.com on July 26, 2013, 7:39 a.m. | Patch ID: 54547


Message ID 7f9527323b7b45083c91a990d7e3957006ebcfbf.1374642547.git.Qi.Chen@windriver.com
State New
Headers show

Commit Message

Qi.Chen@windriver.com July 26, 2013, 7:39 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 hide | download patch | download mbox

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index ade7279..063a0f1 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 ro,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