NexusSI902xBuild » History » Version 7
  Paul Kocialkowski, 11/13/2012 09:23 AM 
  
| 1 | 5 | Paul Kocialkowski | h1. Nexus S Build | 
|---|---|---|---|
| 2 | 1 | Matt Kraai | |
| 3 | 5 | Paul Kocialkowski | This explains how to build Replicant for the Nexus S. | 
| 4 | 1 | Matt Kraai | |
| 5 | 5 | Paul Kocialkowski | h2. Prerequisites | 
| 6 | 1 | Matt Kraai | |
| 7 | 5 | Paul Kocialkowski | Before building, you must make sure: | 
| 8 | * You have installed the [[BuildDependencies]] | ||
| 9 | 6 | Paul Kocialkowski | * You have downloaded Replicant 2.3 or 4.0 sources: [[GettingReplicantSources]] | 
| 10 | 5 | Paul Kocialkowski | * Your sources are up to date: [[GettingReplicantSources#DownloadingUpdating-the-source-from-the-repos|Downloading/Updating the source from the repos]] | 
| 11 | * You are in the directory where the sources were downloaded | ||
| 12 | |||
| 13 | 1 | Matt Kraai | h2. Warning | 
| 14 | |||
| 15 | 4 | Paul Kocialkowski | *Do not build as root, always build as user.* | 
| 16 | 1 | Matt Kraai | |
| 17 | 5 | Paul Kocialkowski | h2. Building | 
| 18 | 1 | Matt Kraai | |
| 19 | 5 | Paul Kocialkowski | Setup the build environment: | 
| 20 | 1 | Matt Kraai | <pre> | 
| 21 | 5 | Paul Kocialkowski | source build/envsetup.sh | 
| 22 | lunch replicant_crespo-eng | ||
| 23 | export ANDROID_JAVA_HOME=$JAVA_HOME | ||
| 24 | 4 | Paul Kocialkowski | </pre> | 
| 25 | 1 | Matt Kraai | |
| 26 | 5 | Paul Kocialkowski | Start the build: | 
| 27 | 1 | Matt Kraai | <pre> | 
| 28 | 5 | Paul Kocialkowski | parallel_tasks=$(echo "$(grep 'processor' /proc/cpuinfo | wc -l ) + 1" | bc) | 
| 29 | 7 | Paul Kocialkowski | make -j$parallel_tasks bootimage | 
| 30 | make -j$parallel_tasks recoveryimage | ||
| 31 | make -j$parallel_tasks systemimage | ||
| 32 | make -j$parallel_tasks userdataimage | ||
| 33 | 1 | Matt Kraai | </pre> | 
| 34 | 4 | Paul Kocialkowski | |
| 35 | 5 | Paul Kocialkowski | The -jn argument is to indicate the number of parallel tasks during the build. | 
| 36 | 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@. | ||
| 37 | 1 | Matt Kraai | |
| 38 | 5 | Paul Kocialkowski | h2. Output files | 
| 39 | 1 | Matt Kraai | |
| 40 | 5 | Paul Kocialkowski | Find the produced files: | 
| 41 | * built target images: @out/target/product/crespo/@ | ||
| 42 | * built host tools: @out/host/linux-x86/bin/@ |