diff --git a/chroot/__init__.py b/chroot/__init__.py index 86925c0..ca54bf5 100644 --- a/chroot/__init__.py +++ b/chroot/__init__.py @@ -50,11 +50,14 @@ def cmd_chroot(type: str = 'build', arch: str = None, enable_crossdirect=True): build_chroot.initialize() build_chroot.initialized = True build_chroot.mount_pkgbuilds() - if config.file.build.crossdirect and enable_crossdirect: + build_chroot.mount_chroots() + assert arch and config.runtime.arch + if config.file.build.crossdirect and enable_crossdirect and arch != config.runtime.arch: build_chroot.mount_crossdirect() else: raise Exception('Really weird bug') + chroot.mount_packages() chroot.activate() logging.debug(f'Starting shell in {chroot.name}:') chroot.run_cmd('bash', attach_tty=True) diff --git a/chroot/abstract.py b/chroot/abstract.py index 45557b4..00b89be 100644 --- a/chroot/abstract.py +++ b/chroot/abstract.py @@ -273,6 +273,13 @@ class Chroot(AbstractChroot): fail_if_mounted=fail_if_mounted, ) + def mount_chroots(self, fail_if_mounted: bool = False) -> str: + return self.mount( + absolute_source=config.get_path('chroots'), + relative_destination=CHROOT_PATHS['chroots'].lstrip('/'), + fail_if_mounted=fail_if_mounted, + ) + def write_makepkg_conf(self, target_arch: Arch, cross_chroot_relative: Optional[str], cross: bool = True) -> str: """ Generate a `makepkg.conf` or `makepkg_cross_$arch.conf` file in /etc.