@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
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 = {
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]