All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. Arno Baumfalk" <a.baumfalk@astro-kom.de>
To: <poky@yoctoproject.org>
Subject: poky: added overlay file
Date: Wed, 30 Mar 2016 14:32:12 +0200	[thread overview]
Message-ID: <56FBC74C.4070204@astro-kom.de> (raw)

[-- 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


             reply	other threads:[~2016-03-30 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 12:32 Dr. Arno Baumfalk [this message]
2016-03-30 12:54 ` poky: added overlay file Gary Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56FBC74C.4070204@astro-kom.de \
    --to=a.baumfalk@astro-kom.de \
    --cc=poky@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.