Project

General

Profile

GenericReplicant60Build » History » Revision 7

Revision 6 (Denis 'GNUtoo' Carikli, 10/20/2019 08:56 PM) → Revision 7/10 (Denis 'GNUtoo' Carikli, 12/13/2019 05:29 PM)

h1. Build Replicant 6.0 

 This page explains how to build Replicant 6.0 for supported devices. 

 h2. Prerequisites 

 Before building, you must make sure that: 
 * You have installed the build dependencies: [[Replicant60BuildDependenciesInstallation|Replicant 6.0 build dependencies installation]] 
 * You have downloaded Replicant 6.0 sources: [[ReplicantSourceCode]] 
 * Your sources are up to date: [[ReplicantSourceCode#DownloadingUpdating-the-source-code|Downloading/Updating the source from the repos]] 
 * Your terminal is running in the directory where the sources were downloaded 
 
 h2. Warning 

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

 See the [[BuildTips|build tips]] if you are facing issues. 

 h2. Before building 

 * On Debian stretch, building the toolchain will fail. See [[Replicant60BuildTips#usrbinsed-usrbinmkdir-usrbinmkdir-No-such-file-or-directory]] for how to workaround that and make the build succeed. 

 h2. Building 

 All of the following build commands need to be run in the source tree root folder. 

 h3. Building the toolchain 

 First, the toolchain needs to be built for replicant 6. To do that *open a new shell* and run the following command: 
 <pre> 
 ./vendor/replicant/build-toolchain 
 </pre> 

 h2. Building a Replicant image for a device 

 Once the toolchain has been built, you we can then start now *open a new shell* and prepare it for building an a Replicant image for a specific device. To prepare the current shell, run the following command: 

 Use <pre> 
 . build/envsetup.sh 
 </pre> 


 You will then need select the device you want to build for. 

 To do that, you can use the following table to find the command corresponding you need to your type to select the device in this table you want to do that: build for: 

 |_. Command |_. Device(s) |_. Command | 
 | lunch replicant_i9100-userdebug |    Galaxy S 2 (I9100) | ./vendor/replicant/build.sh i9100 | 
 | lunch replicant_i9300-userdebug | Galaxy S 3 (I9300) | ./vendor/replicant/build.sh i9300 | 
 | lunch replicant_i9305-userdebug | Galaxy S 3 4G (I9305) | ./vendor/replicant/build.sh i9305 | 
 | lunch replicant_n7000-userdebug | Galaxy Note (N7000) | ./vendor/replicant/build.sh n7000 | 
 | lunch replicant_n7100-userdebug | Galaxy Note 2 (N7100) | ./vendor/replicant/build.sh n7100 | 
 | lunch replicant_maguro-userdebug | Galaxy Nexus (I9250) | ./vendor/replicant/build.sh maguro | 
 |/2. lunch replicant_espresso3g-userdebug | Galaxy Tab 2 7.0 (P3100) |/2. ./vendor/replicant/build.sh espresso3g | 
  
 | Galaxy Tab 2 10.1 (P5100) | 
 |/2. lunch replicant_espressowifi-userdebug | Galaxy Tab 2 7.0 Wi-Fi (P3110) |/2. ./vendor/replicant/build.sh espressowifi | 
  
 | Galaxy Tab 2 10.1 Wi-Fi (P5110) | 
 | lunch replicant_n5100-userdebug | Galaxy Note 8.0 (N5100) | ./vendor/replicant/build.sh n5100 | 
 | lunch replicant_n5110-userdebug | Galaxy Note 8.0 Wi-Fi (N5110) | ./vendor/replicant/build.sh n5110 | 

 For instance to build for the Galaxy S3 (I9300) you need to type the following command: 
 <pre> 
 ./vendor/replicant/build.sh lunch replicant_i9300-userdebug 
 </pre> 

 When this is done you can start the build: 
 <pre> 
 parallel_tasks=$(echo "$(grep 'processor' /proc/cpuinfo | wc -l ) + 1" | bc) 
 make -j$parallel_tasks bacon 
 </pre> 

 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. 
 @$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. 

 Finally, you will need to sign the resulting images for replicant 6. 

 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: 

 |_. Command |_. Device(s) | 
 | ./vendor/replicant/sign-build i9100 |    Galaxy S 2 (I9100) | 
 | ./vendor/replicant/sign-build i9300 | Galaxy S 3 (I9300) | 
 | ./vendor/replicant/sign-build i9305 | Galaxy S 3 4G (I9305) | 
 | ./vendor/replicant/sign-build n7000 | Galaxy Note (N7000) | 
 | ./vendor/replicant/sign-build n7100 | Galaxy Note 2 (N7100) | 
 | ./vendor/replicant/sign-build maguro | Galaxy Nexus (I9250) | 
 |/2. ./vendor/replicant/sign-build espresso3g | Galaxy Tab 2 7.0 (P3100) |  
 | Galaxy Tab 2 10.1 (P5100) | 
 |/2. ./vendor/replicant/sign-build espressowifi | Galaxy Tab 2 7.0 Wi-Fi (P3110) |  
 | Galaxy Tab 2 10.1 Wi-Fi (P5110) | 
 | ./vendor/replicant/sign-build n5100 | Galaxy Note 8.0 (N5100) | 
 | ./vendor/replicant/sign-build n5110 | Galaxy Note 8.0 Wi-Fi (N5110) | 

 For instance for the Galaxy S 3 (I9300) you need to type the following command: 
 <pre> 
 ./vendor/replicant/sign-build i9300 
 </pre> 

 The first time you build an image run the script, it might will ask you a few questions at various points during the build process as it needs then that are needed to build the images and generate the necessary signing keys near the end of the building process. keys. 

 h2. Output files 

 For the built host tools, the produced files are at: @out/host/linux-x86/bin/@ 

 For the built target images, you can use the following table to find the directory that has the produced files: 

 |_. Output directory |_. Device(s) | 
 | out/dist/i9100/ |    Galaxy S 2 (I9100) | 
 | out/dist/i9300/ | Galaxy S 3 (I9300) | 
 | out/dist/i9305/ | Galaxy S 3 4G (I9305) | 
 | out/dist/n7000/ | Galaxy Note (N7000) | 
 | out/dist/n7100/ | Galaxy Note 2 (N7100) | 
 | out/dist/maguro/ | Galaxy Nexus (I9250) | 
 |/2. out/dist/espresso3g/ | Galaxy Tab 2 7.0 (P3100) |  
 | Galaxy Tab 2 10.1 (P5100) | 
 |/2. out/dist/espressowifi/ | Galaxy Tab 2 7.0 Wi-Fi (P3110) |  
 | Galaxy Tab 2 10.1 Wi-Fi (P5110) | 
 | out/dist/n5100/ | Galaxy Note 8.0 (N5100) | 
 | out/dist/n5110/ | Galaxy Note 8.0 Wi-Fi (N5110) | 

 For instance, for the Galaxy S 3 (I9300), the built target images are in @out/dist/i9300/@