Project

General

Profile

NexusSI902xBuild » History » Revision 5

Revision 4 (Paul Kocialkowski, 10/08/2011 12:43 PM) → Revision 5/16 (Paul Kocialkowski, 02/05/2012 02:56 PM)

h1. Nexus S 
 h2. Build 

 This explains how to build Replicant for the Nexus S.  

 h2. Prerequisites 

 Before building, dependencies 

 
 Make sure you must make sure: 
 * You have installed the [[BuildDependencies]] 
 * You have downloaded Replicant 2.3 sources: [[GettingReplicantSources]] 
 * Your sources are up to date: [[GettingReplicantSources#DownloadingUpdating-the-source-from-the-repos|Downloading/Updating the source from the repos]] 
 * You are in the directory where the sources were downloaded 
 
 [[BuildDependencies]]. 


 h2. Warning 

 


 *Do not build as root, always build as user.* 

 


 h2. Building 

 Setup 

 Get and install the repo tool: 
 <pre> 
  mkdir bin 
  cd bin 
  wget http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo 
  chmod a+x repo 
  cd .. 
 </pre> 
 Once kernel.org is back up, repo should be downloaded from http://android.git.kernel.org/repo instead. 

 Get replicant 2.3: 
 <pre> 
  mkdir replicant-2.3 
  cd replicant-2.3 
  ../bin/repo init -u git://gitorious.org/replicant/manifest.git -b replicant-2.3 
  ../bin/repo sync 
 </pre> 


 h2. Each time you want to build environment:  
 replicant 2.3 

 <pre> 
 cd ~/replicant-2.3 
  ../bin/repo sync 
 source build/envsetup.sh 
 lunch replicant_crespo-eng 
 export ANDROID_JAVA_HOME=$JAVA_HOME 
 </pre> 

 Start the build: lunch replicant_crespo-eng 
 <pre> 
 parallel_tasks=$(echo make -j$(echo "$(grep 'processor' /proc/cpuinfo | wc -l ) + 1" | bc) 
 make -j$parallel_tasks distimages #uses arguments like -j9 to speed up build in case of multi-core cpu 
 </pre> 
 <pre> 
 <pre> 

 You will find your built images in ./out/target/product/crespo/. 

 The -jn argument is You will also find fastboot, needed to indicate install the number of parallel tasks during the build.  
 You can remove it from the command line images, in ./out/host/linux-x86/bin/. 

 Now you are ready to have only one task at a time. With fast hardware, best results will come with @-j9@, @-j16@ and @-j32@. 

 h2. Output files 

 Find the produced files: 
 * built target images: @out/target/product/crespo/@ 
 * built host tools: @out/host/linux-x86/bin/@ "install!":http://trac.osuosl.org/trac/replicant/wiki/Installation