Skip to contentSkip to conversation

init-live.sh: fix overlay fs

PATCH New Robert Yang 1 participant 3 messages Mar 29, 2016

lore
Share & tools
lore
#0 lore raw

cover init-live.sh: fix overlay fs

The following changes since commit a3e254992444b0cc92e182151fefba7e3324ad55:

build-appliance-image: Update to master head revision (2016-03-28 17:02:04 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/iso
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=930680769815c85878081c7d850dc6b06e62f28c

Robert Yang (2):
init-live.sh: fix ROOT_MOUNT
init-live.sh: fix overlay fs

 meta/recipes-core/initrdscripts/files/init-live.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 init-live.sh: fix ROOT_MOUNT

The '/' in the end is not needed, which caused '//' in the path.

---
 meta/recipes-core/initrdscripts/files/init-live.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/initrdscripts/files/init-live.sh +1 -1
index f698535..04e58d5 100644
@@ -2,7 +2,7 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-ROOT_MOUNT="/rootfs/"
+ROOT_MOUNT="/rootfs"
 ROOT_IMAGE="rootfs.img"
 MOUNT="/bin/mount"
 UMOUNT="/bin/umount"
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 init-live.sh: fix overlay fs

In reply to Robert Yang

* 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

---
 meta/recipes-core/initrdscripts/files/init-live.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
meta/recipes-core/initrdscripts/files/init-live.sh +5 -4
index 04e58d5..09fb479 100644
@@ -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
Signature · 1 line
2.7.4