Project

General

Profile

DeprecatedReplicant60GalaxyS3I9300Build » History » Version 5

Wolfgang Wiedmeyer, 03/18/2017 06:54 PM
add toolchain build

1 1 Wolfgang Wiedmeyer
h1. Galaxy S 3 (I9300) Build
2
3
This explains how to build Replicant for the Galaxy S 3 (I9300).
4
5
h2. Prerequisites
6
7
Before building, you must make sure that:
8
* You have installed the build dependencies: [[BuildDependenciesInstallation]]
9 4 Wolfgang Wiedmeyer
* You have downloaded Replicant 6.0 sources: [[Replicant60ReplicantSourceCode]]
10
* Your sources are up to date: [[Replicant60ReplicantSourceCode#DownloadingUpdating-the-source-code|Downloading/Updating the source from the repos]]
11 1 Wolfgang Wiedmeyer
* 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
h2. Building
18
19 5 Wolfgang Wiedmeyer
All of the following build commands need to be run in the source tree root folder.
20
21
First, the toolchain needs to be built:
22
<pre>
23
./vendor/replicant/build-toolchain
24
</pre>
25
26
*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.*
27
28
Then, prepare the shell environment for the Replicant build:
29 2 Wolfgang Wiedmeyer
30 1 Wolfgang Wiedmeyer
<pre>
31 2 Wolfgang Wiedmeyer
. build/envsetup.sh
32 1 Wolfgang Wiedmeyer
lunch replicant_i9300-userdebug
33
export ANDROID_JAVA_HOME=$JAVA_HOME
34
</pre>
35
36
Start the build:
37 2 Wolfgang Wiedmeyer
38 1 Wolfgang Wiedmeyer
<pre>
39
parallel_tasks=$(echo "$(grep 'processor' /proc/cpuinfo | wc -l ) + 1" | bc)
40
make -j$parallel_tasks bacon
41
</pre>
42
43
The -jn argument is to indicate the number of parallel tasks during the build. 
44
You can remove it from the command line to have only one task at a time. With fast hardware, best results will come with @-j9@, @-j16@ and @-j32@.
45
46 2 Wolfgang Wiedmeyer
Finally, sign the resulting images:
47
48
<pre>
49 3 Wolfgang Wiedmeyer
./vendor/replicant/sign-build i9300
50 2 Wolfgang Wiedmeyer
</pre>
51
52
The first time you run the script, it will ask you a few questions that are needed to generate the necessary signing keys. 
53
54 1 Wolfgang Wiedmeyer
h2. Output files
55
56
The produced files are located at:
57 2 Wolfgang Wiedmeyer
* built target images: @out/dist/@
58 1 Wolfgang Wiedmeyer
* built host tools: @out/host/linux-x86/bin/@