aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-07-25 09:57:06 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-07-25 09:57:08 -0400
commit29b4ee64695f79511912ae127e66e0fe82f7a0d1 (patch)
tree57d4fbafd53427707f2e750addf455bf67a8ec9a
parent2d41af17282ef00f20d44f8ba49eaa59b3f603a1 (diff)
parent60c3c23a63bd7f681e0db86251ae0a372cb6b279 (diff)
Merge #13714: contrib: Add lxc network setup for Bionic host
60c3c23a63 [contrib] Add automatic setup for Ubuntu Bionic (Chun Kuan Lee) Pull request description: Tree-SHA512: db7a67df34c143647098bd5cb499b5ebc8d6847bf5e20dc3b4d6093a1649dcf42007d02b40e95b1fa76c0aadecc1eb2374ca9ca247bdd6358a08a6c4358f4b9c
-rwxr-xr-xcontrib/gitian-build.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/contrib/gitian-build.py b/contrib/gitian-build.py
index 1da9e43896..5b8db1e73d 100755
--- a/contrib/gitian-build.py
+++ b/contrib/gitian-build.py
@@ -11,7 +11,14 @@ def setup():
if args.kvm:
programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
elif args.docker:
- programs += ['docker.io']
+ dockers = ['docker.io', 'docker-ce']
+ for i in dockers:
+ return_code = subprocess.call(['sudo', 'apt-get', 'install', '-qq', i])
+ if return_code == 0:
+ break
+ if return_code != 0:
+ print('Cannot find any way to install docker', file=sys.stderr)
+ exit(1)
else:
programs += ['lxc', 'debootstrap']
subprocess.check_call(['sudo', 'apt-get', 'install', '-qq'] + programs)
@@ -31,6 +38,10 @@ def setup():
make_image_prog += ['--lxc']
subprocess.check_call(make_image_prog)
os.chdir(workdir)
+ if args.is_bionic and not args.kvm and not args.docker:
+ subprocess.check_call(['sudo', 'sed', '-i', 's/lxcbr0/br0/', '/etc/default/lxc-net'])
+ print('Reboot is required')
+ exit(0)
def build():
global args, workdir
@@ -147,6 +158,8 @@ def main():
args.windows = 'w' in args.os
args.macos = 'm' in args.os
+ args.is_bionic = b'bionic' in subprocess.check_output(['lsb_release', '-cs'])
+
if args.buildsign:
args.build=True
args.sign=True
@@ -161,6 +174,10 @@ def main():
os.environ['USE_DOCKER'] = '1'
elif not args.kvm:
os.environ['USE_LXC'] = '1'
+ if not 'GITIAN_HOST_IP' in os.environ.keys():
+ os.environ['GITIAN_HOST_IP'] = '10.0.3.1'
+ if not 'LXC_GUEST_IP' in os.environ.keys():
+ os.environ['LXC_GUEST_IP'] = '10.0.3.5'
# Disable for MacOS if no SDK found
if args.macos and not os.path.isfile('gitian-builder/inputs/MacOSX10.11.sdk.tar.gz'):