From: Daan De Meyer Date: Fri, 26 Jan 2024 10:50:02 +0000 (+0100) Subject: Make sure we remove cached default initrd entries if needed X-Git-Tag: v21~80^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d182769a97b5869b29604d8f8ba0e536b951736;p=thirdparty%2Fmkosi.git Make sure we remove cached default initrd entries if needed --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index acfd47421..8cc0a48eb 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1538,6 +1538,10 @@ def build_initrd(context: Context) -> Path: if (config.output_dir / config.output).exists(): return config.output_dir / config.output + if args.force > 1 and config.cache_dir: + with complete_step(f"Removing cache entries of {config.name()} image…"): + rmtree(*(p for p in cache_tree_paths(config) if p.exists())) + with complete_step("Building default initrd"): build_image(args, config, resources=context.resources)