Skip to content

Commit

Permalink
mock: use 'private' mount option, not 'rprivate' (el7 fix)
Browse files Browse the repository at this point in the history
The 'mount --rbind -o rprivate' on EL7 does not work as we expected [1];
it looks like it actually reverses the '--rbind' option and does only
'--bind' (filled rhbz#1815534).  Using just 'private' seems to do the
same (good) thing on both EL7 and modern Fedora.

This fixes local baseurl=file:// repositories with bootstrap, and
yum_chache plugin on EL7.

Fixes: #381, #536
Relates: https://bugzilla.redhat.com/show_bug.cgi?id=1815534
  • Loading branch information
praiskup committed Mar 20, 2020
1 parent b4c728d commit 34fe0d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mock/py/mock.py
Expand Up @@ -747,15 +747,15 @@ def main():
# add the extra bind mount to the outer chroot
inner_mount = bootstrap_buildroot.make_chroot_path(buildroot.make_chroot_path())

# Hide re-mounted chroot from host by rprivate tmpfs.
# Hide re-mounted chroot from host by private tmpfs.
buildroot.mounts.managed_mounts.append(
FileSystemMountPoint(filetype='tmpfs',
device='hide_root_in_bootstrap',
path=inner_mount,
options="rprivate"))
options="private"))
buildroot.mounts.managed_mounts.append(
BindMountPoint(buildroot.make_chroot_path(), inner_mount,
recursive=True, options="rprivate"))
recursive=True, options="private"))

signal.signal(signal.SIGTERM, partial(handle_signals, buildroot))
signal.signal(signal.SIGPIPE, partial(handle_signals, buildroot))
Expand Down

0 comments on commit 34fe0d5

Please sign in to comment.