gitian-builder/README.md

56 lines
2.2 KiB
Markdown
Raw Normal View History

2011-01-30 21:12:02 +00:00
# Gitian
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.
## Deterministic build 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.
2011-01-30 23:31:33 +00:00
## Synopsis:
2011-01-30 21:12:02 +00:00
2011-01-30 23:31:33 +00:00
Install prereqs:
2011-01-30 21:12:02 +00:00
2011-01-30 23:31:33 +00:00
sudo apt-get install python-vm-builder qemu-kvm apt-cacher
sudo service apt-cacher start
2011-01-30 21:12:02 +00:00
2011-01-30 23:31:33 +00:00
Create the base VM for use in further builds (requires sudo, please review the script):
2011-01-30 21:12:02 +00:00
bin/make-base-vm
2011-01-30 23:31:33 +00:00
Copy any additional build inputs into a directory named _inputs_.
2011-01-30 21:12:02 +00:00
2011-01-30 23:31:33 +00:00
Then execute the build using a YAML description file (can be run as non-root):
2011-01-30 21:12:02 +00:00
2011-03-27 19:24:22 +00:00
bin/gbuild <package>.yml
2011-01-30 23:31:33 +00:00
or if you need to specify a commit for one of the git remotes:
2011-03-27 19:24:22 +00:00
bin/gbuild --commit <dir>=<hash> <package>.yml
2011-01-30 23:31:33 +00:00
The resulting report will appear in result/\<package\>-res.yml
2011-02-01 07:50:59 +00:00
2011-03-27 19:24:22 +00:00
To sign the result, perform:
bin/gsign --signer <signer> --release <release-name> <package>.yml
Where <signer> is your signing PGP key ID and <release-name> is the name for the current release. This will put the result and signature in the sigs/<package>/<release-name>. The sigs/<package> 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
2011-02-01 07:50:59 +00:00
## Poking around
* Log files are captured to the _var_ directory
* You can run the utilities in libexec by running `PATH="libexec:$PATH"`
* To start the target VM run `start-target 32 lucid-i386` or `start-target 64 lucid-amd64`
2011-02-01 07:50:59 +00:00
* To ssh into the target run `on-target` or `on-target -u root`
* On the target, the _build_ directory contains the code as it is compiled and _install_ contains intermediate libraries
2011-03-27 19:24:22 +00:00
* By convention, the script in \<package\>.yml starts with any environment setup you would need to manually compile things on the target
2011-02-01 07:50:59 +00:00
TODO:
- disable sudo in target, just in case of a hypervisor exploit
- tar and other archive timestamp setter