diff --git a/mkosi/__init__.py b/mkosi/__init__.py index cc8482c43d..2c996571a1 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -4829,7 +4829,10 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None: with prepend_to_environ_path(config): check_tools(config, args.verb) images[i] = config = run_configure_scripts(config) - run_sync_scripts(config) + + # Only run sync scripts if we're going to build the image. + if not (last.output_dir_or_cwd() / last.output).exists() or last.output_format == OutputFormat.none: + run_sync_scripts(config) # The images array has been modified so we need to reevaluate last again. last = images[-1]