Merge pull request #279 from eduardosm/external-sources-without-net

Pass `--unshare-net` to bwrap when building with `--external-sources`
This commit is contained in:
fosslinux 2023-04-14 02:05:48 +00:00 committed by GitHub
commit b0a2747ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,7 @@ import sys
def run(*args, **kwargs):
"""A small wrapper around subprocess.run"""
arguments = [str(arg) for arg in args]
arguments = [str(arg) for arg in args if arg is not None]
if kwargs.pop('verbose', False):
print(arguments)

View File

@ -181,6 +181,7 @@ print(shutil.which('chroot'))
run('bwrap', '--unshare-user',
'--uid', '0',
'--gid', '0',
'--unshare-net',
'--clearenv',
'--setenv', 'PATH', '/usr/bin',
'--bind', system_a.tmp_dir, '/',
@ -194,6 +195,7 @@ print(shutil.which('chroot'))
run('bwrap', '--unshare-user',
'--uid', '0',
'--gid', '0',
'--unshare-net' if args.external_sources else None,
'--clearenv',
'--setenv', 'PATH', '/usr/bin',
'--bind', system_a.tmp_dir + "/sysc_image", '/',