From: Ricardo Simoes Date: Thu, 18 Jul 2024 06:46:34 +0000 (+0200) Subject: volatile-binds: Remove workdir if OverlayFS fails X-Git-Tag: yocto-5.2~2350 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7872edbb33024fc710ac683eaef5635b89a1b994;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git volatile-binds: Remove workdir if OverlayFS fails To fulfill OverlayFS workdir requirements, the mount-copybind script creates a workdir. But if the mount operation fails for any reason, the workdir is left there. Then, subsequent runs of mount-copybind will again try to create the directory and pollute system logs with failed mkdir error messages. This commit mitigates the problem by unconditionally removing workdir if the OverlayFS is not used or fails to run. 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 da88d160ee0..4f373412be6 100755 --- a/meta/recipes-core/volatile-binds/files/mount-copybind +++ b/meta/recipes-core/volatile-binds/files/mount-copybind @@ -57,6 +57,7 @@ if [ -d "$mountpoint" ]; then fi fi if [ "$MOUNT_COPYBIND_AVOID_OVERLAYFS" = 1 ] || ! mount -t overlay overlay -olowerdir="$mountpoint",upperdir="$spec",workdir="$overlay_workdir""$mountcontext" "$mountpoint" > /dev/null 2>&1; then + rm -rf "$overlay_workdir" if [ "$specdir_existed" != "yes" ]; then cp -aPR "$mountpoint"/. "$spec/"