Project

General

Profile

BuildEnvironments » History » Version 1

Beuc Beuc, 07/25/2015 12:29 PM
Initial version

1 1 Beuc Beuc
h1. BuildEnvironments
2
3
h2. Rationale
4
5
Each revision of Android is meant to be compiled with a specific set of dependencies. No effort is made upstream to support multiple build environments.
6
Building with different environments often yields build errors due to untested dependencies versions.
7
So we document here how to recreate these recommended build environments.
8
9
h2. Recommended environment history
10
11
Ubuntu support:
12
<pre>
13
          ,2013-10-15 - Lucid   (10.04)
14
2013-10-15,2015-03-16 - Precise (12.04), probably with 4.4 KitKat - https://web.archive.org/web/20131015123913/http://source.android.com/source/initializing.html
15
2015-03-16,           - Trusty  (14.04) https://web.archive.org/web/20150316053136/https://source.android.com/source/initializing.html
16
</pre>
17
18
Java support:
19
<pre>
20
          ,2014-03-31 - Sun JDK 5/6
21
2014-03-31,           - OpenJDK 7 - https://web.archive.org/web/20140331004436/https://source.android.com/source/initializing.html
22
</pre>
23
24
h2. Ubuntu 14.04 with LXC
25
26
<pre>
27
lxc-create -n android -t download -- -d ubuntu -r trusty -a amd64
28
29
lxc-start -n replicant -d
30
lxc-attach -n replicant
31
32
# clean-up non-free sources
33
sed -i -e 's/ restricted//' -e 's/ multiverse//' /etc/apt/sources.list
34
apt-get update
35
</pre>
36
37
h2. Ubuntu 12.04 Precise with LXC
38
39
<pre>
40
lxc-create -n replicant -t download -- -d ubuntu -r precise -a amd64
41
42
lxc-start -n replicant -d
43
lxc-attach -n replicant
44
45
# clean-up non-free sources
46
sed -i -e 's/ restricted//' -e 's/ multiverse//' /etc/apt/sources.list
47
apt-get update
48
</pre>
49
50
h2. Trisquel 4.1 Taranis (based on Ubuntu 10.04 Lucid) with LXC
51
52
<pre>
53
wget http://archive.trisquel.info/trisquel/pool/main/d/debootstrap/debootstrap_1.0.59ubuntu0.3+7.0trisquel1.tar.gz
54
tar xzf debootstrap_1.0.59ubuntu0.3+7.0trisquel1.tar.gz 
55
cp -a debootstrap-1.0.59ubuntu0.3+7.0trisquel1/scripts/{taranis,trisquel} /usr/share/debootstrap/scripts/
56
cp -a /usr/share/lxc/templates/lxc-ubuntu /usr/share/lxc/templates/lxc-trisquel
57
sed -i -e 's/main restricted universe multiverse/main/' \
58
       -e 's/.*lxcguest/#&/' /usr/share/lxc/templates/lxc-trisquel
59
lxc-create -n test -t trisquel --  -r taranis -a amd64 --mirror http://archive.trisquel.info/trisquel/ \
60
  --security-mirror http://archive.trisquel.info/trisquel/
61
</pre>
62
63
h2. Ubuntu 10.04 Lucid with LXC
64
65
<pre>
66
apt-get install ubuntu-archive-keyring
67
lxc-create -n replicant -t ubuntu -- -r lucid -a amd64
68
69
lxc-start -n replicant -d
70
lxc-attach -n replicant
71
72
# clean-up non-free sources
73
sed -i -e 's/ restricted//' -e 's/ multiverse//' /etc/apt/sources.list
74
apt-get update
75
</pre>
76
77
h2. LXC host environment
78
79
The simplest way to configure LXC is to combine it with libvirt.
80
81
Here are instructions tested on a Debian 8 host:
82
83
<pre>
84
apt-get install lxc debootstrap
85
86
apt-get install libvirt-bin dnsmasq ebtables
87
service dnsmasq stop
88
update-rc.d dnsmasq remove
89
virsh net-autostart default
90
service libvirtd restart
91
cat > /etc/lxc/default.conf <<'EOF'
92
lxc.network.type = veth
93
lxc.network.flags = up
94
lxc.network.link = virbr0
95
EOF
96
</pre>
97
98
You now can run the LXC containers instructions above.
99
100
h2. Non-privileged user setup
101
102
This can be used in any environment to prepare a non-root user dedicated to builds.
103
<pre>
104
# prepare build user
105
apt-get install openssh-server
106
useradd replicant --shell /bin/bash --create-home
107
mkdir -p -m 700 ~replicant/.ssh
108
cat <<EOF >> ~replicant/.ssh/authorized_keys
109
your public key
110
EOF
111
chown -R replicant: ~replicant
112
</pre>