From: Ricardo Simoes Date: Thu, 18 Jul 2024 06:46:33 +0000 (+0200) Subject: volatile-binds: Do not create workdir if OverlayFS is disabled X-Git-Tag: yocto-5.2~2351 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=323765607f262b5fea0f19e8a05aeffe5076235a;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git volatile-binds: Do not create workdir if OverlayFS is disabled 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 Signed-off-by: Mark Jonas Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/volatile-binds/files/mount-copybind b/meta/recipes-core/volatile-binds/files/mount-copybind index ddc43576159..da88d160ee0 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.