]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Hook up DistributionInstaller
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 16 Sep 2022 16:33:33 +0000 (18:33 +0200)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 24 Nov 2022 13:55:33 +0000 (14:55 +0100)
mkosi/__init__.py

index d52a310c095102dae9138c158255b4d7419cd4e6..99d164ab324e5b7455c216e2458c37b10f072660 100644 (file)
@@ -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]