stolenmoment
stolenmoment

Reputation: 443

How to fix mock doing bind mounts late?

We're using mock to build RPMs and related things, and later builds require access to a yum repo on the local disk, built in earlier stages. This repo includes enough of a subset of stock RPMs adequate for operating (long story). We would like to bind-mount this repo so we can initialize the chroot from this repo, but mock only performs mounts after the initial yum setup is done.

In other words, file:/// repo URLs, pointing to bind-mounted repos, cannot be accessed during initial setup.

We want the initial setup to use our local repo to initialize the chroot/container, but since the bind mounts happen after that, we can't initialize the chroot the way we want.

Anybody have an idea on how to do this? I'm considering leaving the stock repo config in place, and replacing the entire yum config in the script that mock invokes in the chroot, but that seems fragile and overly complex. We already have the locally-built portion of this repo in the configuration, but disabled, and we enable it in that same script before we install anything from it.

When we set up the bind-mounts and repos the way we want, yum reports that the repomd.xml files cannot be opened; reasonable if the bind-mounts have not been done.

Upvotes: 0

Views: 18

Answers (0)

Related Questions