From: Daan De Meyer Date: Wed, 3 Jan 2024 13:46:16 +0000 (+0100) Subject: Only mount cache overlay if base trees are specified and Overlay= is not enabled X-Git-Tag: v20~17^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2236%2Fhead;p=thirdparty%2Fmkosi.git Only mount cache overlay if base trees are specified and Overlay= is not enabled The setup() method of some distributions creates files in the root directory which means that checking if the root directory is empty doesn't work. Instead, let's check if any base trees were specified explicitly. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 4d1a69bfc..f3bae373c 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -312,7 +312,7 @@ def configure_autologin(context: Context) -> None: @contextlib.contextmanager def mount_cache_overlay(context: Context) -> Iterator[None]: - if not context.config.incremental or not any(context.root.iterdir()): + if not context.config.incremental or not context.config.base_trees or context.config.overlay: yield return