From c143e651540baa89010fb7f8dd2486c9f26c2af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Thu, 13 Apr 2023 18:52:37 +0200 Subject: [PATCH] Pass `--unshare-net` to bwrap when building with `--external-sources` Ensures that when `--external-sources` is used, the build does not require a working internet connection. `--unshare-net` is always passed for the sysa phase. --- lib/utils.py | 2 +- rootfs.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils.py b/lib/utils.py index 12ba2cb..7d5ed61 100755 --- a/lib/utils.py +++ b/lib/utils.py @@ -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) diff --git a/rootfs.py b/rootfs.py index 1321c34..0bce0d3 100755 --- a/rootfs.py +++ b/rootfs.py @@ -174,6 +174,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, '/', @@ -187,6 +188,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", '/',