GenericReplicant60Build » History » Revision 3
Revision 2 (Denis 'GNUtoo' Carikli, 08/02/2019 11:37 AM) → Revision 3/10 (Denis 'GNUtoo' Carikli, 08/02/2019 11:49 AM)
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: [[BuildDependenciesInstallation]] * 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. Building All of the following build commands need to be run in the source tree root folder. First, the toolchain needs to be built for replicant 6: <pre> ./vendor/replicant/build-toolchain </pre> *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.* Then, prepare the shell environment for the Replicant build: <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 you need to type to select the device you want to build for: |_. Command |_. Device(s) | | lunch replicant_i9100-userdebug | Galaxy S 2 (I9100) | | lunch replicant_i9300-userdebug | Galaxy S 3 (I9300) | | lunch replicant_i9305-userdebug | Galaxy S 3 4G (I9305) | | lunch replicant_n7000-userdebug | Galaxy Note (N7000) | | lunch replicant_n7100-userdebug | Galaxy Note 2 (N7100) | | lunch replicant_maguro-userdebug | Galaxy Nexus (I9250) | |/2. lunch replicant_espresso3g-userdebug | Galaxy Tab 2 7.0 (P3100) | | Galaxy Tab 2 10.1 (P5100) | |/2. lunch replicant_espressowifi-userdebug | Galaxy Tab 2 7.0 Wi-Fi (P3110) | | Galaxy Tab 2 10.1 Wi-Fi (P5110) | | lunch replicant_n5100-userdebug | Galaxy Note 8.0 (N5100) | | lunch replicant_n5110-userdebug | Galaxy Note 8.0 Wi-Fi (N5110) | For instance to build for the Galaxy S3 (I9300) you need to type the following command: <pre> 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 run the script, it will ask you a few questions that are needed to generate the necessary signing keys. h2. Output files For the built host tools, the The produced files are located 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) | images: @out/dist/i9100/@ | out/dist/i9100/ | Galaxy S 2 (I9100) | * built host tools: @out/host/linux-x86/bin/@ | 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/@