All of lore.kernel.org
 help / color / mirror / Atom feed
* poky: added overlay file
@ 2016-03-30 12:32 Dr. Arno Baumfalk
  2016-03-30 12:54 ` Gary Thomas
  0 siblings, 1 reply; 2+ messages in thread
From: Dr. Arno Baumfalk @ 2016-03-30 12:32 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

Hello,

I have found, that the init-live.sh script does not consider, that the 
overlay filesystem in the linux kernel has been renamed from "overlayfs" 
to "overlay" (and the mount API has changed, too).
Currently the script will not detect "overlay" and use "aufs" as a 
fallback, if present.

In order not to break anything for users of elder kernel versions I have 
simply added the "overlay" case to the script, see attached patch.


Best regards,
Arno Baumfalk



[-- Attachment #2: 0001-added-overlay-filesystem-to-init-live.sh.patch --]
[-- Type: text/x-patch, Size: 1948 bytes --]

From 860a4f3f038f362094c7bd20e6abef08767a44bd Mon Sep 17 00:00:00 2001
From: Arno Baumfalk <a.baumfalk@astro-kom.de>
Date: Tue, 22 Mar 2016 16:03:17 +0100
Subject: [PATCH] added overlay filesystem to init-live.sh (overlayfs was
 renamed and the mount api was changed)

---
 meta/recipes-core/initrdscripts/files/init-live.sh | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index d852c57..fa9d9c6 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -169,7 +169,9 @@ mount_and_boot() {
 
     # determine which unification filesystem to use
     union_fs_type=""
-    if grep -q -w "overlayfs" /proc/filesystems; then
+    if grep -q -w "overlay" /proc/filesystems; then
+	union_fs_type="overlay"
+    elif grep -q -w "overlayfs" /proc/filesystems; then
 	union_fs_type="overlayfs"
     elif grep -q -w "aufs" /proc/filesystems; then
 	union_fs_type="aufs"
@@ -179,6 +181,21 @@ mount_and_boot() {
 
     # make a union mount if possible
     case $union_fs_type in
+	"overlay")
+	    mkdir -p /rootfs.ro /tmpfs
+	    if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
+		rm -rf /rootfs.ro /tmpfs
+		fatal "Could not move rootfs mount point"
+	    else
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /tmpfs
+		mkdir /tmpfs/rootfs.rw /tmpfs/work
+		mount -t overlay -o "lowerdir=/rootfs.ro,upperdir=/tmpfs/rootfs.rw,workdir=/tmpfs/work" overlay $ROOT_MOUNT
+		mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/tempfs
+		mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+		mount --move /tmpfs $ROOT_MOUNT/tempfs
+		ln -s /tempfs/rootfs.rw $ROOT_MOUNT/rootfs.rw
+	    fi
+	    ;;
 	"overlayfs")
 	    mkdir -p /rootfs.ro /rootfs.rw
 	    if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-30 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30 12:32 poky: added overlay file Dr. Arno Baumfalk
2016-03-30 12:54 ` Gary Thomas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.