From: Joerg Behrmann Date: Fri, 16 Sep 2022 16:33:33 +0000 (+0200) Subject: Hook up DistributionInstaller X-Git-Tag: v15~384^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edb0b89fcdfee27c79c47da187be0c39590be2f7;p=thirdparty%2Fmkosi.git Hook up DistributionInstaller --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index d52a310c0..99d164ab3 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1638,7 +1638,9 @@ def mount_api_vfs(root: Path) -> Iterator[None]: @contextlib.contextmanager def mount_cache(state: MkosiState) -> Iterator[None]: - if state.config.distribution in (Distribution.fedora, Distribution.mageia, Distribution.openmandriva): + if state.installer is not None: + cache_paths = state.installer.cache_path() + elif state.config.distribution in (Distribution.fedora, Distribution.mageia, Distribution.openmandriva): cache_paths = ["var/cache/dnf"] elif is_centos_variant(state.config.distribution): # We mount both the YUM and the DNF cache in this case, as YUM might @@ -2998,7 +3000,9 @@ def install_distribution(state: MkosiState, cached: bool) -> None: install: Callable[[MkosiState], None] - if is_centos_variant(state.config.distribution): + if state.installer is not None: + install = state.installer.install + elif is_centos_variant(state.config.distribution): install = install_centos_variant else: install = { @@ -3955,7 +3959,9 @@ def gen_kernel_images(state: MkosiState) -> Iterator[Tuple[str, Path]]: if not kver.is_dir(): continue - if state.config.distribution == Distribution.gentoo: + if state.installer is not None: + kimg = state.installer.kernel_image(kver.name, state.config.architecture) + elif state.config.distribution == Distribution.gentoo: from .gentoo import ARCHITECTURES _, kimg_path = ARCHITECTURES[state.config.architecture]