GenericReplicant60Build » History » Version 4
Denis 'GNUtoo' Carikli, 10/20/2019 06:07 PM
| 1 | 2 | Denis 'GNUtoo' Carikli | h1. Build Replicant 6.0 |
|---|---|---|---|
| 2 | 1 | Denis 'GNUtoo' Carikli | |
| 3 | 2 | Denis 'GNUtoo' Carikli | This page explains how to build Replicant 6.0 for supported devices. |
| 4 | 1 | Denis 'GNUtoo' Carikli | |
| 5 | h2. Prerequisites |
||
| 6 | |||
| 7 | Before building, you must make sure that: |
||
| 8 | * You have installed the build dependencies: [[BuildDependenciesInstallation]] |
||
| 9 | * You have downloaded Replicant 6.0 sources: [[ReplicantSourceCode]] |
||
| 10 | * Your sources are up to date: [[ReplicantSourceCode#DownloadingUpdating-the-source-code|Downloading/Updating the source from the repos]] |
||
| 11 | * 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 | See the [[BuildTips|build tips]] if you are facing issues. |
||
| 18 | |||
| 19 | 4 | Denis 'GNUtoo' Carikli | h2. Before building |
| 20 | |||
| 21 | * 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. |
||
| 22 | |||
| 23 | 1 | Denis 'GNUtoo' Carikli | h2. Building |
| 24 | |||
| 25 | All of the following build commands need to be run in the source tree root folder. |
||
| 26 | |||
| 27 | First, the toolchain needs to be built for replicant 6: |
||
| 28 | <pre> |
||
| 29 | ./vendor/replicant/build-toolchain |
||
| 30 | </pre> |
||
| 31 | |||
| 32 | *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.* |
||
| 33 | |||
| 34 | Then, prepare the shell environment for the Replicant build: |
||
| 35 | |||
| 36 | <pre> |
||
| 37 | . build/envsetup.sh |
||
| 38 | </pre> |
||
| 39 | |||
| 40 | |||
| 41 | 2 | Denis 'GNUtoo' Carikli | You will then need select the device you want to build for. |
| 42 | |||
| 43 | 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: |
||
| 44 | |||
| 45 | |_. Command |_. Device(s) | |
||
| 46 | | lunch replicant_i9100-userdebug | Galaxy S 2 (I9100) | |
||
| 47 | | lunch replicant_i9300-userdebug | Galaxy S 3 (I9300) | |
||
| 48 | | lunch replicant_i9305-userdebug | Galaxy S 3 4G (I9305) | |
||
| 49 | | lunch replicant_n7000-userdebug | Galaxy Note (N7000) | |
||
| 50 | | lunch replicant_n7100-userdebug | Galaxy Note 2 (N7100) | |
||
| 51 | | lunch replicant_maguro-userdebug | Galaxy Nexus (I9250) | |
||
| 52 | |/2. lunch replicant_espresso3g-userdebug | Galaxy Tab 2 7.0 (P3100) | |
||
| 53 | | Galaxy Tab 2 10.1 (P5100) | |
||
| 54 | |/2. lunch replicant_espressowifi-userdebug | Galaxy Tab 2 7.0 Wi-Fi (P3110) | |
||
| 55 | | Galaxy Tab 2 10.1 Wi-Fi (P5110) | |
||
| 56 | | lunch replicant_n5100-userdebug | Galaxy Note 8.0 (N5100) | |
||
| 57 | | lunch replicant_n5110-userdebug | Galaxy Note 8.0 Wi-Fi (N5110) | |
||
| 58 | |||
| 59 | For instance to build for the Galaxy S3 (I9300) you need to type the following command: |
||
| 60 | 1 | Denis 'GNUtoo' Carikli | <pre> |
| 61 | 2 | Denis 'GNUtoo' Carikli | lunch replicant_i9300-userdebug |
| 62 | </pre> |
||
| 63 | |||
| 64 | When this is done you can start the build: |
||
| 65 | <pre> |
||
| 66 | 1 | Denis 'GNUtoo' Carikli | parallel_tasks=$(echo "$(grep 'processor' /proc/cpuinfo | wc -l ) + 1" | bc) |
| 67 | make -j$parallel_tasks bacon |
||
| 68 | </pre> |
||
| 69 | |||
| 70 | 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. |
||
| 71 | @$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. |
||
| 72 | |||
| 73 | 2 | Denis 'GNUtoo' Carikli | Finally, you will need to sign the resulting images for replicant 6. |
| 74 | 1 | Denis 'GNUtoo' Carikli | |
| 75 | 2 | Denis 'GNUtoo' Carikli | 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: |
| 76 | |||
| 77 | |_. Command |_. Device(s) | |
||
| 78 | | ./vendor/replicant/sign-build i9100 | Galaxy S 2 (I9100) | |
||
| 79 | | ./vendor/replicant/sign-build i9300 | Galaxy S 3 (I9300) | |
||
| 80 | | ./vendor/replicant/sign-build i9305 | Galaxy S 3 4G (I9305) | |
||
| 81 | | ./vendor/replicant/sign-build n7000 | Galaxy Note (N7000) | |
||
| 82 | | ./vendor/replicant/sign-build n7100 | Galaxy Note 2 (N7100) | |
||
| 83 | | ./vendor/replicant/sign-build maguro | Galaxy Nexus (I9250) | |
||
| 84 | |/2. ./vendor/replicant/sign-build espresso3g | Galaxy Tab 2 7.0 (P3100) | |
||
| 85 | | Galaxy Tab 2 10.1 (P5100) | |
||
| 86 | |/2. ./vendor/replicant/sign-build espressowifi | Galaxy Tab 2 7.0 Wi-Fi (P3110) | |
||
| 87 | | Galaxy Tab 2 10.1 Wi-Fi (P5110) | |
||
| 88 | | ./vendor/replicant/sign-build n5100 | Galaxy Note 8.0 (N5100) | |
||
| 89 | | ./vendor/replicant/sign-build n5110 | Galaxy Note 8.0 Wi-Fi (N5110) | |
||
| 90 | |||
| 91 | For instance for the Galaxy S 3 (I9300) you need to type the following command: |
||
| 92 | 1 | Denis 'GNUtoo' Carikli | <pre> |
| 93 | 2 | Denis 'GNUtoo' Carikli | ./vendor/replicant/sign-build i9300 |
| 94 | 1 | Denis 'GNUtoo' Carikli | </pre> |
| 95 | |||
| 96 | The first time you run the script, it will ask you a few questions that are needed to generate the necessary signing keys. |
||
| 97 | |||
| 98 | h2. Output files |
||
| 99 | |||
| 100 | 3 | Denis 'GNUtoo' Carikli | For the built host tools, the produced files are at: @out/host/linux-x86/bin/@ |
| 101 | |||
| 102 | For the built target images, you can use the following table to find the directory that has the produced files: |
||
| 103 | |||
| 104 | |_. Output directory |_. Device(s) | |
||
| 105 | | out/dist/i9100/ | Galaxy S 2 (I9100) | |
||
| 106 | | out/dist/i9300/ | Galaxy S 3 (I9300) | |
||
| 107 | | out/dist/i9305/ | Galaxy S 3 4G (I9305) | |
||
| 108 | | out/dist/n7000/ | Galaxy Note (N7000) | |
||
| 109 | | out/dist/n7100/ | Galaxy Note 2 (N7100) | |
||
| 110 | | out/dist/maguro/ | Galaxy Nexus (I9250) | |
||
| 111 | |/2. out/dist/espresso3g/ | Galaxy Tab 2 7.0 (P3100) | |
||
| 112 | | Galaxy Tab 2 10.1 (P5100) | |
||
| 113 | |/2. out/dist/espressowifi/ | Galaxy Tab 2 7.0 Wi-Fi (P3110) | |
||
| 114 | | Galaxy Tab 2 10.1 Wi-Fi (P5110) | |
||
| 115 | | out/dist/n5100/ | Galaxy Note 8.0 (N5100) | |
||
| 116 | | out/dist/n5110/ | Galaxy Note 8.0 Wi-Fi (N5110) | |
||
| 117 | |||
| 118 | For instance, for the Galaxy S 3 (I9300), the built target images are in @out/dist/i9300/@ |