|
8 years ago | |
---|---|---|
bin | 8 years ago | |
doc | 9 years ago | |
etc | 8 years ago | |
libexec | 8 years ago | |
share | 8 years ago | |
target-bin | 8 years ago | |
.gitignore | 9 years ago | |
README.md | 8 years ago |
Read about the project goals at the “project home page”:https://gitian.org/ .
This package can do a deterministic build of a package inside a VM.
This performs a build inside a VM, with deterministic inputs and outputs. If the build script takes care of all sources of non-determinism (mostly caused by timestamps), the result will always be the same. This allows multiple independent verifiers to sign a binary with the assurance that it really came from the source they reviewed.
Linux:
sudo apt-get install git apache2 apt-cacher-ng python-vm-builder ruby
OSX with MacPorts:
sudo port install ruby coreutils
export PATH=$PATH:/opt/local/libexec/gnubin # Needed for sha256sum
sudo apt-get install qemu-kvm
sudo apt-get install debootstrap lxc
Install virtualbox from virtualbox.org, and make sure VBoxManage is in your $PATH.
bin/make-base-vm
bin/make-base-vm --arch i386
bin/make-base-vm --lxc
bin/make-base-vm --lxc --arch i386
Set the USE_LXC environment variable to use LXC instead of KVM:
export USE_LXC=1
Command-line VBoxManage must be in your PATH
Setup:
make-base-vm cannot yet make VirtualBox virtual machines (patches welcome-- it should be possible to use VBoxManage, boot-from-network Linux images and PXE booting to do it). So you must either get or manually create VirtualBox machines that:
The final setup needed is to create an ssh key that will be used to login to the virtual machine:
ssh-keygen -t dsa -f var/id_dsa -N ""
ssh -p 2223 ubuntu@localhost 'mkdir -p .ssh && chmod 700 .ssh && cat >> .ssh/authorized_keys' < var/id_dsa.pub
ssh -p 2223 ubuntu@localhost
On VM: sudo bash
On VM: mkdir -p .ssh && chmod 700 .ssh && cat ~ubuntu/.ssh/authorized_keys >> .ssh/authorized_keys
Set the USE_VBOX environment variable to use LXC instead of KVM:
export USE_VBOX=1
If you have everything set-up properly, you should be able to:
PATH=$PATH:$(pwd)/libexec make-clean-vm --suite lucid --arch i386 start-target 32 lucid-i386 on-target ls -la stop-target
Copy any additional build inputs into a directory named inputs.
Then execute the build using a YAML description file (can be run as non-root):
export USE_LXC=1 # LXC only
bin/gbuild <package>.yml
or if you need to specify a commit for one of the git remotes:
bin/gbuild --commit <dir>=<hash> <package>.yml
The resulting report will appear in result/<package>-res.yml
To sign the result, perform:
bin/gsign --signer <signer> --release <release-name> <package>.yml
Where is your signing PGP key ID and is the name for the current release. This will put the result and signature in the sigs//. The sigs/ directory can be managed through git to coordinate multiple signers.
After you’ve merged everybody’s signatures, verify them:
bin/gverify --release <release-name> <package>.yml
PATH="libexec:$PATH"
start-target 32 lucid-i386
or start-target 64 lucid-amd64
on-target
or on-target -u root
TODO:
bin/gbuild
runs lxc-start
, which may require root. If you are in the admin group, you can add the following sudoers line to prevent asking for the password every time:
%admin ALL=NOPASSWD: /usr/bin/lxc-start
Recent distributions allow lxc-start to be run by non-priviledged users, so you might be able to rip-out the sudo
calls in libexec/*
.
If you have a runaway lxc-start
command, just use kill -9
on it.
The machine configuration requires access to br0 and assumes that the host address is 10.0.2.2:
sudo brctl addbr br0
sudo ifconfig br0 10.0.2.2/24 up
Not very extensive, currently.
python -m unittest discover test