Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap_image and the local repositories #1167

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mock/py/mockbuild/buildroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,18 @@ def _init(self, prebuild):
self._setup_devices()

self._setup_files()
self.mounts.mountall_managed()

# write out config details
self.root_log.debug('rootdir = %s', self.make_chroot_path())
self.root_log.debug('resultdir = %s', self.resultdir)

self.set_package_manager()

# this creates some managed mounts
self.pkg_manager.initialize()

self.mounts.mountall_managed()

self._setup_resolver_config()
self._setup_katello_ca()

Expand Down
16 changes: 13 additions & 3 deletions mock/py/mockbuild/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,19 @@ def _bind_mount_repos_to_bootstrap(self):
bind_mount_point = BindMountPoint(srcpath=srcpath,
bindpath=bindpath)

# we need to use user mounts as essential mounts are used
# only for installing into bootstrap chroot
self.buildroot.mounts.add_user_mount(bind_mount_point)
# This is a very tricky hack. Note we configure the
# package_manager for the "bootstrap" chroot here, but these
# "local repo" mountpoints are actually needed by both
# "bootstrap" and "build" chroots. The "bootstrap" chroot
# needs this with the 'bootstrap_image' feature (we use
# package manager _in bootstrap_, not on host, to install
# into the bootstrap) and the "build" chroot package manager
# always needs this (but also mounted in bootstrap). That's
# why we are not using "essential mounts"; these are only
# automatically mounted by the corresponding package manager
# (we wouldn't mount bootstrap's mountpoints when installing
# into the "build" chroot).
self.buildroot.mounts.add(bind_mount_point)

def initialize_config(self):
# there may be configs we get from container image
Expand Down
2 changes: 1 addition & 1 deletion mock/tests/test_package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_user_bind_mounts_from_config(self, config):
pm.pkg_manager_config = config
pm.initialize_config()
pm._bind_mount_repos_to_bootstrap()
return self.bootstrap_buildroot.mounts.user_mounts
return self.bootstrap_buildroot.mounts.managed_mounts

def test_absolute_path_name_in_baseurl(self):
repo_directory = os.path.join(self.workdir, 'repo')
Expand Down