Skip to content

Commit

Permalink
Don't try to remove cache entries of custom distro default initrd
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanDeMeyer authored and behrmann committed Jan 3, 2025
1 parent a34d34f commit 4a160d4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4607,7 +4607,7 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
for config in images:
run_clean(args, config)

if args.force > 0:
if args.force > 0 and last.distribution != Distribution.custom:
remove_cache_entries(finalize_default_initrd(last, tools=False, resources=resources))

rmtree(Path(".mkosi-private"))
Expand Down Expand Up @@ -4688,10 +4688,11 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
for config in images:
run_clean(args, config)

initrd = finalize_default_initrd(last, tools=False, resources=resources)
if last.distribution != Distribution.custom:
initrd = finalize_default_initrd(last, tools=False, resources=resources)

if args.force > 1 or not have_cache(initrd):
remove_cache_entries(initrd)
if args.force > 1 or not have_cache(initrd):
remove_cache_entries(initrd)

if tools and not (tools.output_dir_or_cwd() / tools.output).exists():
check_tools(tools, Verb.build)
Expand Down

0 comments on commit 4a160d4

Please sign in to comment.