more mounts in mock

Michael E Brown Michael_E_Brown at dell.com
Fri May 26 05:03:16 UTC 2006


Just wanted to run this idea past, while we are discussing mount points.

I have noticed that mock mounts directories when they are not strictly
necessary. It also mounts the directories before some operations where
it is necessary, but does not unmount them afterwards. The result of
this is that it is pretty easy to interrupt mock and leave behind
mounted dirs.

I believe that the only times that mount points are strictly needed are
in the do_chroot() code path, as well as (possibly) during yum commands.

Currently, there are many calls to _mount() scattered throughout the
code. What I would propose is to place _mount() and _umount() calls in
do_chroot(), place _mount() and _umount() calls in yum(), and then
remove these calls from the various other places where they are
currently.

The effect of this would be that it would be relatively easy to
encapsulate this behaviour in a try/except block that would ensure that
mountpoints are always unmounted on exit.
--
Michael


On Thu, 2006-05-25 at 21:43 -0400, Mike McLean wrote:
> Attached are a couple of patches that expand the mounts created in the 
> chroot by mock. These are mounts that we've used for builds within Red 
> Hat for years and some packages need them to compile properly.
> 
> more_mounts.patch is the larger patch, it refactors _mount() so that the 
> mounts to be created are specified in a list and looped over.  I've also 
> changed to the unmounting code to make it more paranoid. In order to 
> allow these mounts, I had to make some changes to mock-helper.
> 
> bind_dev.patch builds on the the previous patch and provides an option 
> to have /dev bind mounted in the chroot (instead of the skeletal /dev 
> that mock sets up). The patch makes this an option with the original 
> behavior as the default.
> 
> --
> Fedora-buildsys-list mailing list
> Fedora-buildsys-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-buildsys-list




More information about the Fedora-buildsys-list mailing list