public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: <mark.jonas@de.bosch.com>
To: <openembedded-core@lists.openembedded.org>
Cc: <bluca@debian.org>, <luca.boccassi@microsoft.com>,
	<matt.hoosier@garmin.com>, <richard.purdie@linuxfoundation.org>,
	<mark.jonas@de.bosch.com>,
	Ricardo Simoes <ricardo.simoes@pt.bosch.com>
Subject: [PATCH 1/2] volatile-binds: Do not create workdir if OverlayFS is disabled
Date: Thu, 18 Jul 2024 08:46:33 +0200	[thread overview]
Message-ID: <20240718064634.7276-2-mark.jonas@de.bosch.com> (raw)
In-Reply-To: <20240718064634.7276-1-mark.jonas@de.bosch.com>

From: Ricardo Simoes <ricardo.simoes@pt.bosch.com>

When the mountpoint parameter is a directory, the mount-copybind will
first try to use OverlayFS. Because of that, it needs to create the
OverlayFS workdir (determined by the overlay_workdir).

But if the environment variable MOUNT_COPYBIND_AVOID_OVERLAYFS is set
to "1", the script uses bind mount. In that case, the overlay_workdir
is useless, leaving the spec parent directory in a dirty state.

This commit changes mount-copybind so that the overlay_workdir is only
created when MOUNT_COPYBIND_AVOID_OVERLAYFS is not set to 1.

Signed-off-by: Ricardo Simoes <ricardo.simoes@pt.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
---
 meta/recipes-core/volatile-binds/files/mount-copybind | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/volatile-binds/files/mount-copybind b/meta/recipes-core/volatile-binds/files/mount-copybind
index ddc4357615..da88d160ee 100755
--- a/meta/recipes-core/volatile-binds/files/mount-copybind
+++ b/meta/recipes-core/volatile-binds/files/mount-copybind
@@ -45,7 +45,9 @@ if [ -d "$mountpoint" ]; then
 
     # Fast version of calculating `dirname ${spec}`/.`basename ${spec}`-work
     overlay_workdir="${spec%/*}/.${spec##*/}-work"
-    mkdir "${overlay_workdir}"
+    if [ "$MOUNT_COPYBIND_AVOID_OVERLAYFS" != 1 ]; then
+        mkdir "${overlay_workdir}"
+    fi
 
     # Try to mount using overlay, which is must faster than copying files.
     # If that fails, fall back to slower copy.
-- 
2.25.1



  reply	other threads:[~2024-07-18  6:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-18  6:46 [PATCH 0/2] volatile-binds: Mitigate workdir cleanup issues mark.jonas
2024-07-18  6:46 ` mark.jonas [this message]
2024-07-18  6:46 ` [PATCH 2/2] volatile-binds: Remove workdir if OverlayFS fails mark.jonas

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=20240718064634.7276-2-mark.jonas@de.bosch.com \
    --to=mark.jonas@de.bosch.com \
    --cc=bluca@debian.org \
    --cc=luca.boccassi@microsoft.com \
    --cc=matt.hoosier@garmin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ricardo.simoes@pt.bosch.com \
    --cc=richard.purdie@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox