]> code.ossystems Code Review - openembedded-core.git/commitdiff
init-live.sh: fix overlay fs
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 29 Mar 2016 07:49:52 +0000 (00:49 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Mar 2016 11:59:27 +0000 (12:59 +0100)
* The name changes from overlayfs to overlayo
* The workdir is a must when mount
* The updir must be a subdir of rootfs.rw

This patch plus with another one which has been sent to linux-yocto can
fix the error when boot iso:
EXT4-fs (loop0): re-mounted. Opts: data=ordered
Populating dev cache
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/rcS.d/S36udev-cache: line 73: can't create /etc/udev-cache.tar.gz:
Read-only file system
udev-cache: update failed!
rm: can't remove '/etc/udev/cache.data': Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
rm: can't remove '/tmp': Read-only file system
ln: /tmp/tmp: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
ln: /etc/resolv.conf: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system
/etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create
/etc/volatile.cache.build: Read-only file system

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initrdscripts/files/init-live.sh

index 04e58d5f30f03fc5f5046d332dbffa9b60dab809..09fb47991533bf4e992e3ce7ae876734b6355dc9 100644 (file)
@@ -169,8 +169,8 @@ mount_and_boot() {
 
     # determine which unification filesystem to use
     union_fs_type=""
-    if grep -q -w "overlayfs" /proc/filesystems; then
-       union_fs_type="overlayfs"
+    if grep -q -w "overlay" /proc/filesystems; then
+       union_fs_type="overlay"
     elif grep -q -w "aufs" /proc/filesystems; then
        union_fs_type="aufs"
     else
@@ -179,14 +179,15 @@ mount_and_boot() {
 
     # make a union mount if possible
     case $union_fs_type in
-       "overlayfs")
+       "overlay")
            mkdir -p /rootfs.ro /rootfs.rw
            if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
                rm -rf /rootfs.ro /rootfs.rw
                fatal "Could not move rootfs mount point"
            else
                mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
-               mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw" overlayfs $ROOT_MOUNT
+               mkdir -p /rootfs.rw/upperdir /rootfs.rw/work
+               mount -t overlay overlay -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw/upperdir,workdir=/rootfs.rw/work" $ROOT_MOUNT
                mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
                mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
                mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw