Skip to content

Instantly share code, notes, and snippets.

@langerhans
Created March 28, 2014 22:26
Show Gist options
  • Save langerhans/9844274 to your computer and use it in GitHub Desktop.
Save langerhans/9844274 to your computer and use it in GitHub Desktop.

Steps for getting LXC-based gitian build to work on Ubuntu 12.04.

Preparing the system

First, install lxc

apt-get install lxc

To stop sudo from asking for your password all the time while building, edit /etc/sudoers, and add

%admin ALL=NOPASSWD: /usr/bin/lxc-start

Setting up gitian

Edit etc/lxc.config.in in the gitian repository. This is necessary because Ubuntu uses an alternative name for the bridge interface.

lxc.network.link = lxcbr0

Create images for i386 and amd64 build:

bin/make-base-vm --lxc --suite precise --arch i386
bin/make-base-vm --lxc --suite precise --arch amd64

Building

Make sure that the br0 interface exists so that the guest has network access to the host at 10.0.2.2:

sudo brctl addbr br0
sudo ifconfig br0 10.0.2.2/24 up

Before buliding always export the USE_LXC variable to make sure that gbuild will use LXC and not KVM:

export USE_LXC=1
COMMIT=v0.9.0rc1
# Build as normally
bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-win32.yml && cp build/out/* inputs
bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-win32.yml && cp build/out/* inputs
bin/gbuild ../bitcoin/contrib/gitian-descriptors/qt-win32.yml && cp build/out/* inputs
bin/gbuild ../bitcoin/contrib/gitian-descriptors/protobuf-win32.yml && cp build/out/* inputs
bin/gbuild --commit bitcoin=${COMMIT} ../bitcoin/contrib/gitian-descriptors/gitian-win32.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment