Skip to content
Open
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
4 changes: 4 additions & 0 deletions mock/etc/mock/hermetic-build.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ config_opts['description'] = 'Configuration file for Hermetic Builds'
# with creating caches.
config_opts['plugin_conf']['root_cache_enable'] = False

# Normal bootstrapping needs networking to be ON, but hermetic builds don't.
bootstrap_buildroot_config['rpmbuild_networking'] = False
bootstrap_buildroot_config['use_host_resolv'] = False

config_opts['dnf.conf'] = """
[main]
keepcache=1
Expand Down
3 changes: 2 additions & 1 deletion mock/py/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,6 @@ def main():
# allow bootstrap buildroot to access the network for getting packages
bootstrap_buildroot_config['rpmbuild_networking'] = True
bootstrap_buildroot_config['use_host_resolv'] = True
util.setup_host_resolv(bootstrap_buildroot_config)

# disable updating bootstrap chroot
bootstrap_buildroot_config['update_before_build'] = False
Expand Down Expand Up @@ -812,6 +811,8 @@ def main():
mount_point = BindMountPoint(srcpath=key_dir, bindpath=chroot_dir)
bootstrap_buildroot.mounts.add(mount_point)

util.setup_host_resolv(bootstrap_buildroot_config)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. But plugins and bindmountpoint will not have a functional resolv.conf.


# this changes config_opts['nspawn_args'], so do it after initializing
# bootstrap chroot to not inherit the changes there
util.setup_host_resolv(config_opts)
Expand Down
2 changes: 1 addition & 1 deletion mock/py/mockbuild/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def setup_host_resolv(config_opts):
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
''')

if config_opts['isolation'] == 'simple':
if not USE_NSPAWN:
# Not using nspawn -> don't touch /etc/resolv.conf; we already have
# a valid file prepared by Buildroot._init() (if user requested).
return
Expand Down
Loading