Project

General

Profile

GenericReplicant60Build » History » Version 3

Denis 'GNUtoo' Carikli, 08/02/2019 11:49 AM
Fix resulting target image path

1 2 Denis 'GNUtoo' Carikli
h1. Build Replicant 6.0
2 1 Denis 'GNUtoo' Carikli
3 2 Denis 'GNUtoo' Carikli
This page explains how to build Replicant 6.0 for supported devices.
4 1 Denis 'GNUtoo' Carikli
5
h2. Prerequisites
6
7
Before building, you must make sure that:
8
* You have installed the build dependencies: [[BuildDependenciesInstallation]]
9
* You have downloaded Replicant 6.0 sources: [[ReplicantSourceCode]]
10
* Your sources are up to date: [[ReplicantSourceCode#DownloadingUpdating-the-source-code|Downloading/Updating the source from the repos]]
11
* Your terminal is running in the directory where the sources were downloaded
12
 
13
h2. Warning
14
15
*Do not build as root, always build as user.*
16
17
See the [[BuildTips|build tips]] if you are facing issues.
18
19
h2. Building
20
21
All of the following build commands need to be run in the source tree root folder.
22
23
First, the toolchain needs to be built for replicant 6:
24
<pre>
25
./vendor/replicant/build-toolchain
26
</pre>
27
28
*If you have executed any of the commands below and you want to run the toolchain build again, you will need to open a new shell.*
29
30
Then, prepare the shell environment for the Replicant build:
31
32
<pre>
33
. build/envsetup.sh
34
</pre>
35
36
37 2 Denis 'GNUtoo' Carikli
You will then need select the device you want to build for.
38
39
To do that, you can use the following table to find the command you need to type to select the device you want to build for:
40
41
|_. Command |_. Device(s) |
42
| lunch replicant_i9100-userdebug |  Galaxy S 2 (I9100) |
43
| lunch replicant_i9300-userdebug | Galaxy S 3 (I9300) |
44
| lunch replicant_i9305-userdebug | Galaxy S 3 4G (I9305) |
45
| lunch replicant_n7000-userdebug | Galaxy Note (N7000) |
46
| lunch replicant_n7100-userdebug | Galaxy Note 2 (N7100) |
47
| lunch replicant_maguro-userdebug | Galaxy Nexus (I9250) |
48
|/2. lunch replicant_espresso3g-userdebug | Galaxy Tab 2 7.0 (P3100) | 
49
| Galaxy Tab 2 10.1 (P5100) |
50
|/2. lunch replicant_espressowifi-userdebug | Galaxy Tab 2 7.0 Wi-Fi (P3110) | 
51
| Galaxy Tab 2 10.1 Wi-Fi (P5110) |
52
| lunch replicant_n5100-userdebug | Galaxy Note 8.0 (N5100) |
53
| lunch replicant_n5110-userdebug | Galaxy Note 8.0 Wi-Fi (N5110) |
54
55
For instance to build for the Galaxy S3 (I9300) you need to type the following command:
56 1 Denis 'GNUtoo' Carikli
<pre>
57 2 Denis 'GNUtoo' Carikli
lunch replicant_i9300-userdebug
58
</pre>
59
60
When this is done you can start the build:
61
<pre>
62 1 Denis 'GNUtoo' Carikli
parallel_tasks=$(echo "$(grep 'processor' /proc/cpuinfo | wc -l ) + 1" | bc)
63
make -j$parallel_tasks bacon
64
</pre>
65
66
The @-jn@ argument indicates the number of parallel tasks during the build. You can remove it from the command line to have only one task at a time.
67
@$parallel_tasks@ holds an optimized number of parallel tasks for your hardware. You may want to reduce this number if e.g. the computer runs out of RAM during the build.
68
69 2 Denis 'GNUtoo' Carikli
Finally, you will need to sign the resulting images for replicant 6.
70 1 Denis 'GNUtoo' Carikli
71 2 Denis 'GNUtoo' Carikli
To do that, you can use the following table to find the command you need to type sign the images for the device you are building for:
72
73
|_. Command |_. Device(s) |
74
| ./vendor/replicant/sign-build i9100 |  Galaxy S 2 (I9100) |
75
| ./vendor/replicant/sign-build i9300 | Galaxy S 3 (I9300) |
76
| ./vendor/replicant/sign-build i9305 | Galaxy S 3 4G (I9305) |
77
| ./vendor/replicant/sign-build n7000 | Galaxy Note (N7000) |
78
| ./vendor/replicant/sign-build n7100 | Galaxy Note 2 (N7100) |
79
| ./vendor/replicant/sign-build maguro | Galaxy Nexus (I9250) |
80
|/2. ./vendor/replicant/sign-build espresso3g | Galaxy Tab 2 7.0 (P3100) | 
81
| Galaxy Tab 2 10.1 (P5100) |
82
|/2. ./vendor/replicant/sign-build espressowifi | Galaxy Tab 2 7.0 Wi-Fi (P3110) | 
83
| Galaxy Tab 2 10.1 Wi-Fi (P5110) |
84
| ./vendor/replicant/sign-build n5100 | Galaxy Note 8.0 (N5100) |
85
| ./vendor/replicant/sign-build n5110 | Galaxy Note 8.0 Wi-Fi (N5110) |
86
87
For instance for the Galaxy S 3 (I9300) you need to type the following command:
88 1 Denis 'GNUtoo' Carikli
<pre>
89 2 Denis 'GNUtoo' Carikli
./vendor/replicant/sign-build i9300
90 1 Denis 'GNUtoo' Carikli
</pre>
91
92
The first time you run the script, it will ask you a few questions that are needed to generate the necessary signing keys.
93
94
h2. Output files
95
96 3 Denis 'GNUtoo' Carikli
For the built host tools, the produced files are at: @out/host/linux-x86/bin/@
97
98
For the built target images, you can use the following table to find the directory that has the produced files:
99
100
|_. Output directory |_. Device(s) |
101
| out/dist/i9100/ |  Galaxy S 2 (I9100) |
102
| out/dist/i9300/ | Galaxy S 3 (I9300) |
103
| out/dist/i9305/ | Galaxy S 3 4G (I9305) |
104
| out/dist/n7000/ | Galaxy Note (N7000) |
105
| out/dist/n7100/ | Galaxy Note 2 (N7100) |
106
| out/dist/maguro/ | Galaxy Nexus (I9250) |
107
|/2. out/dist/espresso3g/ | Galaxy Tab 2 7.0 (P3100) | 
108
| Galaxy Tab 2 10.1 (P5100) |
109
|/2. out/dist/espressowifi/ | Galaxy Tab 2 7.0 Wi-Fi (P3110) | 
110
| Galaxy Tab 2 10.1 Wi-Fi (P5110) |
111
| out/dist/n5100/ | Galaxy Note 8.0 (N5100) |
112
| out/dist/n5110/ | Galaxy Note 8.0 Wi-Fi (N5110) |
113
114
For instance, for the Galaxy S 3 (I9300), the built target images are in @out/dist/i9300/@