chroot: change get_device_chroot() signature to use device, flavour instead of name

This commit is contained in:
InsanePrawn 2021-10-25 20:58:29 +02:00
parent efbecb3e40
commit 8867edf876

View file

@ -12,7 +12,7 @@ from shlex import quote as shell_quote
from utils import mount, umount
from distro import get_kupfer_local
from wrapper import enforce_wrap
from constants import Arch, GCC_HOSTSPECS, CROSSDIRECT_PKGS
from constants import Arch, GCC_HOSTSPECS, CROSSDIRECT_PKGS, BASE_PACKAGES
from generator import generate_makepkg_conf
BIND_BUILD_DIRS = 'BINDBUILDDIRS'
@ -118,8 +118,9 @@ def get_build_chroot(arch: Arch, extra_repos=None, **kwargs) -> Chroot:
return get_chroot(name, **kwargs, default=default)
def get_device_chroot(name: str, arch: Arch, **kwargs) -> Chroot:
default = Chroot(name, arch, initialize=False, copy_base=False)
def get_device_chroot(device: str, flavour: str, arch: Arch, packages: list[str] = BASE_PACKAGES, extra_repos={}, **kwargs) -> Chroot:
name = f'rootfs_{device}-{flavour}'
default = Chroot(name, arch, initialize=False, copy_base=False, base_packages=packages, extra_repos=extra_repos)
return get_chroot(name, **kwargs, default=default)