From 930680769815c85878081c7d850dc6b06e62f28c Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Mon, 28 Mar 2016 23:18:51 -0700 Subject: init-live.sh: fix overlay fs * 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 --- meta/recipes-core/initrdscripts/files/init-live.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'meta') diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh index 04e58d5f30..09fb479915 100644 --- a/meta/recipes-core/initrdscripts/files/init-live.sh +++ b/meta/recipes-core/initrdscripts/files/init-live.sh @@ -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 -- cgit 1.2.3-korg