Skip to content

Commit 2aee4d2

Browse files
committed
Merge pull request #6626
f4b9132 Update gitian build guide for Debian 8.1 (fanquake)
2 parents bbc2b39 + f4b9132 commit 2aee4d2

36 files changed

+81
-58
lines changed

doc/gitian-building.md

Lines changed: 81 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ Gitian building
55

66
Gitian is the deterministic build process that is used to build the Bitcoin
77
Core executables. It provides a way to be reasonably sure that the
8-
executables are really built from source on GitHub. It also makes sure that
8+
executables are really built from the source on GitHub. It also makes sure that
99
the same, tested dependencies are used and statically built into the executable.
1010

1111
Multiple developers build the source code by following a specific descriptor
1212
("recipe"), cryptographically sign the result, and upload the resulting signature.
1313
These results are compared and only if they match, the build is accepted and uploaded
1414
to bitcoin.org.
1515

16-
More independent gitian builders are needed, which is why I wrote this
17-
guide. It is preferred to follow these steps yourself instead of using someone else's
16+
More independent gitian builders are needed, which is why this guide exists.
17+
It is preferred you follow these steps yourself instead of using someone else's
1818
VM image to avoid 'contaminating' the build.
1919

2020
Table of Contents
@@ -39,46 +39,46 @@ This guide explains how to set up the environment, and how to start the builds.
3939

4040
Debian Linux was chosen as the host distribution because it has a lightweight install (in contrast to Ubuntu) and is readily available.
4141
Any kind of virtualization can be used, for example:
42-
- [VirtualBox](https://www.virtualbox.org/), covered by this guide
42+
- [VirtualBox](https://www.virtualbox.org/) (covered by this guide)
4343
- [KVM](http://www.linux-kvm.org/page/Main_Page)
4444
- [LXC](https://linuxcontainers.org/), see also [Gitian host docker container](https://github.com/gdm85/tenku/tree/master/docker/gitian-bitcoin-host/README.md).
4545

46-
You can also install on actual hardware instead of using virtualization.
46+
You can also install gitian on actual hardware instead of using virtualization.
4747

4848
Create a new VirtualBox VM
4949
---------------------------
5050
In the VirtualBox GUI click "Create" and choose the following parameters in the wizard:
5151

52-
![](gitian-building/create_vm_page1.png)
52+
![](gitian-building/create_new_vm.png)
5353

54-
- Type: Linux, Debian (64 bit)
54+
- Type: Linux, Debian (64-bit)
5555

5656
![](gitian-building/create_vm_memsize.png)
5757

58-
- Memory Size: at least 1024MB, anything lower will really slow the build down
58+
- Memory Size: at least 1024MB, anything less will really slow down the build.
5959

60-
![](gitian-building/create_vm_hard_drive.png)
60+
![](gitian-building/create_vm_hard_disk.png)
6161

62-
- Hard Drive: Create a virtual hard drive now
62+
- Hard Disk: Create a virtual hard disk now
6363

64-
![](gitian-building/create_vm_hard_drive_file_type.png)
64+
![](gitian-building/create_vm_hard_disk_file_type.png)
6565

66-
- Hard Drive file type: Use the default, VDI (VirtualBox Disk Image)
66+
- Hard Disk file type: Use the default, VDI (VirtualBox Disk Image)
6767

68-
![](gitian-building/create_vm_storage_physical_hard_drive.png)
68+
![](gitian-building/create_vm_storage_physical_hard_disk.png)
6969

70-
- Storage on Physical hard drive: Dynamically Allocated
70+
- Storage on physical hard disk: Dynamically Allocated
7171

7272
![](gitian-building/create_vm_file_location_size.png)
7373

74-
- Disk size: at least 40GB; as low as 20GB *may* be possible, but better to err on the safe side
75-
- Push the `Create` button
74+
- File location and size: at least 40GB; as low as 20GB *may* be possible, but better to err on the safe side
75+
- Click `Create`
7676

77-
Get the [Debian 7.8 net installer](http://cdimage.debian.org/cdimage/archive/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-netinst.iso) (a more recent minor version should also work, see also [Debian Network installation](https://www.debian.org/CD/netinst/)).
77+
Get the [Debian 8.1 net installer](http://cdimage.debian.org/debian-cd/8.1.0/amd64/iso-cd/debian-8.1.0-amd64-netinst.iso) (a more recent minor version should also work, see also [Debian Network installation](https://www.debian.org/CD/netinst/)).
7878
This DVD image can be validated using a SHA256 hashing tool, for example on
7979
Unixy OSes by entering the following in a terminal:
8080

81-
echo "e39c36d6adc0fd86c6edb0e03e22919086c883b37ca194d063b8e3e8f6ff6a3a debian-7.8.0-amd64-netinst.iso" | sha256sum -c
81+
echo "5d0a1f804d73aee73eee7efbb38456390558094fd19894a573f1514ca44347e0 debian-8.1.0-amd64-netinst.iso" | sha256sum -c
8282
# (must return OK)
8383

8484
After creating the VM, we need to configure it.
@@ -115,8 +115,9 @@ This section will explain how to install Debian on the newly created VM.
115115

116116
![](gitian-building/debian_install_1_boot_menu.png)
117117

118-
**Note**: Navigation in the Debian installer: To keep a setting at the default
119-
and proceed, just press `Enter`. To select a different button, press `Tab`.
118+
**Note**: Navigating in the Debian installer:
119+
To keep a setting at the default and proceed, just press `Enter`.
120+
To select a different button, press `Tab`.
120121

121122
- Choose locale and keyboard settings (doesn't matter, you can just go with the defaults or select your own information)
122123

@@ -126,7 +127,7 @@ and proceed, just press `Enter`. To select a different button, press `Tab`.
126127

127128
- The VM will detect network settings using DHCP, this should all proceed automatically
128129
- Configure the network:
129-
- System name `debian`.
130+
- Hostname `debian`.
130131
- Leave domain name empty.
131132

132133
![](gitian-building/debian_install_5_configure_the_network.png)
@@ -136,6 +137,7 @@ and proceed, just press `Enter`. To select a different button, press `Tab`.
136137
![](gitian-building/debian_install_6a_set_up_root_password.png)
137138

138139
- Name the new user `debian` (the full name doesn't matter, you can leave it empty)
140+
- Set the account username as `debian`
139141

140142
![](gitian-building/debian_install_7_set_up_user_fullname.png)
141143
![](gitian-building/debian_install_8_set_up_username.png)
@@ -158,65 +160,89 @@ and proceed, just press `Enter`. To select a different button, press `Tab`.
158160

159161
![](gitian-building/debian_install_12_choose_disk.png)
160162

161-
- Partitioning scheme: All files in one partition
162-
163-
![](gitian-building/debian_install_13_partition_scheme.png)
164-
165163
- Finish partitioning and write changes to disk -> *Yes* (`Tab`, `Enter` to select the `Yes` button)
166164

167-
![](gitian-building/debian_install_14_finish.png)
165+
![](gitian-building/debian_install_14_finish.png)
168166
![](gitian-building/debian_install_15_write_changes.png)
169167

170168
- The base system will be installed, this will take a minute or so
171169
- Choose a mirror (any will do)
172170

173171
![](gitian-building/debian_install_16_choose_a_mirror.png)
174172

175-
- Enter proxy information (unless you are on an intranet, you can leave this empty)
173+
- Enter proxy information (unless you are on an intranet, leave this empty)
176174

177175
![](gitian-building/debian_install_18_proxy_settings.png)
178176

179177
- Wait a bit while 'Select and install software' runs
180178
- Participate in popularity contest -> *No*
181-
- Choose software to install. We need just the base system.
179+
- Choose software to install. We need just the base system.
180+
- Make sure only 'SSH server' and 'Standard System Utilities' are checked
181+
- Uncheck 'Debian Desktop Environment' and 'Print Server'
182182

183183
![](gitian-building/debian_install_19_software_selection.png)
184184

185-
- Make sure only 'SSH server' and 'Standard System Utilities' are checked
186-
- Uncheck 'Debian Desktop Environment' and 'Print Server'
185+
- Install the GRUB boot loader to the master boot record? -> Yes
187186

188187
![](gitian-building/debian_install_20_install_grub.png)
189188

190-
- Install the GRUB boot loader to the master boot record? -> Yes
189+
- Device for boot loader installation -> ata-VBOX_HARDDISK
191190

192-
![](gitian-building/debian_install_21_finish_installation.png)
191+
![](gitian-building/debian_install_21_install_grub_bootloader.png)
193192

194193
- Installation Complete -> *Continue*
195194
- After installation, the VM will reboot and you will have a working Debian VM. Congratulations!
196195

196+
![](gitian-building/debian_install_22_finish_installation.png)
197+
198+
199+
After Installation
200+
-------------------
201+
The next step in the guide involves logging in as root via SSH.
202+
SSH login for root users is disabled by default, so we'll enable that now.
203+
204+
Login to the VM using username `root` and the root password you choose earlier.
205+
You'll be presented with a screen similar to this.
206+
207+
![](gitian-building/debian_root_login.png)
208+
209+
Type:
210+
211+
```
212+
sed -i 's/^PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
213+
```
214+
and press enter. Then,
215+
```
216+
/etc/init.d/ssh restart
217+
```
218+
and enter to restart SSH. Logout by typing 'logout' and pressing 'enter'.
219+
197220
Connecting to the VM
198221
----------------------
199222

200223
After the VM has booted you can connect to it using SSH, and files can be copied from and to the VM using a SFTP utility.
201224
Connect to `localhost`, port `22222` (or the port configured when installing the VM).
202-
On Windows you can use putty[1] and WinSCP[2].
225+
On Windows you can use [putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) and [WinSCP](http://winscp.net/eng/index.php).
203226

204-
For example to connect as `root` from a Linux command prompt use
227+
For example, to connect as `root` from a Linux command prompt use
205228

206229
$ ssh root@localhost -p 22222
207230
The authenticity of host '[localhost]:22222 ([127.0.0.1]:22222)' can't be established.
208-
ECDSA key fingerprint is 8e:71:f9:5b:62:46:de:44:01:da:fb:5f:34:b5:f2:18.
231+
RSA key fingerprint is ae:f5:c8:9f:17:c6:c7:1b:c2:1b:12:31:1d:bb:d0:c7.
209232
Are you sure you want to continue connecting (yes/no)? yes
210-
Warning: Permanently added '[localhost]:22222' (ECDSA) to the list of known hosts.
233+
Warning: Permanently added '[localhost]:22222' (RSA) to the list of known hosts.
211234
root@localhost's password: (enter root password configured during install)
212-
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
235+
236+
The programs included with the Debian GNU/Linux system are free software;
237+
the exact distribution terms for each program are described in the
238+
individual files in /usr/share/doc/*/copyright.
239+
240+
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
241+
permitted by applicable law.
213242
root@debian:~#
214243

215244
Replace `root` with `debian` to log in as user.
216245

217-
[1] http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
218-
[2] http://winscp.net/eng/index.php
219-
220246
Setting up Debian for gitian building
221247
--------------------------------------
222248

@@ -226,13 +252,10 @@ First we need to log in as `root` to set up dependencies and make sure that our
226252
user can use the sudo command. Type/paste the following in the terminal:
227253

228254
```bash
229-
apt-get install git ruby sudo apt-cacher-ng qemu-utils debootstrap lxc python-cheetah parted kpartx bridge-utils
255+
apt-get install git ruby sudo apt-cacher-ng qemu-utils debootstrap lxc python-cheetah parted kpartx bridge-utils make ubuntu-archive-keyring
230256
adduser debian sudo
231257
```
232258

233-
When you get a colorful screen with a question about the 'LXC directory', just
234-
go with the default (`/var/lib/lxc`).
235-
236259
Then set up LXC and the rest with the following, which is a complex jumble of settings and workarounds:
237260

238261
```bash
@@ -255,7 +278,7 @@ reboot
255278
```
256279

257280
At the end the VM is rebooted to make sure that the changes take effect. The steps in this
258-
section need only to be performed once.
281+
section only need to be performed once.
259282

260283
Installing gitian
261284
------------------
@@ -300,26 +323,26 @@ cd gitian-builder
300323
bin/make-base-vm --lxc --arch amd64 --suite precise
301324
```
302325

303-
There will be a lot of warnings printed during build of the image. These can be ignored.
326+
There will be a lot of warnings printed during the build of the image. These can be ignored.
304327

305328
**Note**: When sudo asks for a password, enter the password for the user *debian* not for *root*.
306329

307330
Getting and building the inputs
308331
--------------------------------
309332

310-
Follow the instructions in [doc/release-process.md](release-process.md) in the bitcoin repository
311-
under 'Fetch and build inputs' to install sources which require manual intervention. Also follow
312-
the next step: 'Seed the Gitian sources cache', which will fetch all necessary source files allowing
313-
for gitian to work offline.
333+
Follow the instructions in [doc/release-process.md](release-process.md#fetch-and-build-inputs-first-time-or-when-dependency-versions-change)
334+
in the bitcoin repository to install sources which require manual intervention. Also follow
335+
the next step: 'Seed the Gitian sources cache', which will fetch all the necessary source
336+
files to allow gitian to work offline.
314337

315338
Building Bitcoin
316339
----------------
317340

318341
To build Bitcoin (for Linux, OSX and Windows) just follow the steps under 'perform
319-
gitian builds' in [doc/release-process.md](release-process.md) in the bitcoin repository.
342+
gitian builds' in [doc/release-process.md](release-process.md#perform-gitian-builds) in the bitcoin repository.
320343

321-
This may take a long time as it also builds the dependencies needed for each descriptor.
322-
These dependencies will be cached after a successful build to avoid rebuilding them where possible.
344+
This may take some time as it will build all the dependencies needed for each descriptor.
345+
These dependencies will be cached after a successful build to avoid rebuilding them when possible.
323346

324347
At any time you can check the package installation and build progress with
325348

@@ -331,13 +354,13 @@ tail -f var/build.log
331354
Output from `gbuild` will look something like
332355

333356
Initialized empty Git repository in /home/debian/gitian-builder/inputs/bitcoin/.git/
334-
remote: Reusing existing pack: 35606, done.
335-
remote: Total 35606 (delta 0), reused 0 (delta 0)
336-
Receiving objects: 100% (35606/35606), 26.52 MiB | 4.28 MiB/s, done.
337-
Resolving deltas: 100% (25724/25724), done.
357+
remote: Counting objects: 57959, done.
358+
remote: Total 57959 (delta 0), reused 0 (delta 0), pack-reused 57958
359+
Receiving objects: 100% (57959/57959), 53.76 MiB | 484.00 KiB/s, done.
360+
Resolving deltas: 100% (41590/41590), done.
338361
From https://github.com/bitcoin/bitcoin
339362
... (new tags, new branch etc)
340-
--- Building for precise x86_64 ---
363+
--- Building for precise amd64 ---
341364
Stopping target if it is up
342365
Making a new image copy
343366
stdin: is not a tty

doc/gitian-building/create_new_vm.png

117 KB
Loading
121 KB
Loading
167 KB
Loading
-77.9 KB
Binary file not shown.
Binary file not shown.
34.9 KB
Loading
-129 KB
Binary file not shown.
177 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)