Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 1 | <!-- |
| 2 | Copyright 2010 The Android Open Source Project |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | --> |
| 16 | |
| 17 | # Building for devices # |
| 18 | |
| 19 | This page complements the main page about [Building](building.html) with information |
| 20 | that is specific to individual devices. |
| 21 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 22 | The only supported devices are Nexus S, a.k.a. "crespo", and Nexus S 4G, a.k.a. |
| 23 | "crespo4g". |
| 24 | Nexus S is the recommended device to use with the Android Open-Source Project. |
| 25 | Nexus One a.k.a. "passion" is experimentatal and unsupported. Android Developer |
| 26 | Phones (ADP1 and ADP2, a.k.a. "dream" and "sapphire") are obsolete, were |
| 27 | experimental and unsupported in froyo, and can't be used with gingerbread. |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 28 | |
| 29 | ## Building fastboot and adb ## |
| 30 | |
| 31 | If you don't already have those tools, fastboot and adb can be built with |
| 32 | the regular build system. Follow the instructions on the page about |
| 33 | [building](building.html), and replace the main `make` command with |
| 34 | |
| 35 | $ make fastboot adb |
| 36 | |
| 37 | ## Booting into fastboot mode ## |
| 38 | |
| 39 | During a cold boot, the following key combinations can be used to boot into fastboot mode, |
| 40 | which is a mode in the bootloader that can be used to flash the devices: |
| 41 | |
| 42 | Device | Keys |
| 43 | ---------|------ |
| 44 | crespo | Press and hold *Volume Up*, then press and hold *Power* |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 45 | crespo4g | Press and hold *Volume Up*, then press and hold *Power* |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 46 | passion | Press and hold the trackball, then press *Power* |
| 47 | sapphire | Press and hold *Back*, then press *Power* |
| 48 | dream | Press and hold *Back*, then press *Power* |
| 49 | |
| 50 | Also, on devices running froyo or later where adb is enabled, |
| 51 | the command `adb reboot bootloader` can be used to reboot from |
| 52 | Android directly into the bootloader with no key combinations. |
| 53 | |
| 54 | ## Unlocking the bootloader ## |
| 55 | |
| 56 | It's only possible to flash a custom system if the bootloader allows it. |
| 57 | |
| 58 | This is the default setup on ADP1 and ADP2. |
| 59 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 60 | On Nexus One, Nexus S, and Nexus S 4G, the bootloader is locked by default. |
| 61 | With the device in fastboot mode, the bootloader is unlocked with |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 62 | |
| 63 | $ fastboot oem unlock |
| 64 | |
| 65 | The procedure must be confirmed on-screen, and deletes the user data for |
| 66 | privacy reasons. It only needs to be run once. |
| 67 | |
| 68 | On Nexus One, the operation voids the warranty and is irreversible. |
| 69 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 70 | On Nexus S and Nexus S 4G, the bootloader can be locked back with |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 71 | |
| 72 | $ fastboot oem lock |
| 73 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 74 | ## Obtaining proprietary binaries ## |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 75 | |
| 76 | While it's possible to build and run a system using exclusively source code |
| 77 | from Android Open-Source Project, such a system can only use the devices' |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 78 | hardware capabilities for which Open-Source support exists. |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 79 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 80 | Official binaries for Nexus S and Nexus S 4G can be downloaded from |
| 81 | [Google's Nexus driver page](http://code.google.com/android/nexus/drivers.html), |
| 82 | which add access to additional hardware capabilities with non-Open-Source code. |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 83 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 84 | There are no official binaries for Nexus One, ADP2 or ADP1. |
| 85 | |
| 86 | ### Extracting the proprietary binaries ### |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 87 | |
| 88 | Each driver comes as a self-extracting script in a compressed archive. |
| 89 | After uncompressing each archive, run the included self-extracting script |
| 90 | from the root of the source tree, confirm that you agree to the terms of the |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 91 | enclosed license agreement, and the binaries and their matching makefiles |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 92 | will get installed in the `vendor/` hierarchy of the source tree. |
| 93 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 94 | There's an additional step on Nexus S 4G. Build the signapk tool with |
| 95 | |
| 96 | $ make signapk |
| 97 | |
| 98 | Then reassemble the proprietary applicatons with |
| 99 | |
| 100 | $ vendor/samsung/crespo4g/reassemble-apks.sh |
| 101 | |
| 102 | ### Cleaning up when adding proprietary binaries ### |
| 103 | |
| 104 | In order to make sure that the newly installed binaries are properly |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 105 | taken into account after being extracted, the existing output of any previous |
| 106 | build needs to be deleted with |
| 107 | |
| 108 | $ make clobber |
| 109 | |
| 110 | ## Picking and building the configuration that matches a device ## |
| 111 | |
| 112 | The steps to configure and build the Android Open-Source Project |
| 113 | are described in the page about [Building](building.html). |
| 114 | |
| 115 | The recommended builds for the various devices are available through |
| 116 | the lunch menu, accesed when running the `lunch` command with no arguments: |
| 117 | |
| 118 | Device | Build configuration |
| 119 | ---------|--------------------- |
| 120 | crespo | full_crespo-userdebug |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 121 | crespo4g | full_crespo4g-userdebug |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 122 | passion | full_passion-userdebug |
| 123 | sapphire | full_sapphire-userdebug |
| 124 | dream | full_dream-userdebug |
| 125 | |
| 126 | ## Flashing a device ## |
| 127 | |
| 128 | Set the device in fastboot mode if necessary (see above). |
| 129 | |
| 130 | Because user data is typically incompatible between builds of Android, |
| 131 | it's typically better to delete it when flashing a new system. |
| 132 | |
| 133 | $ fastboot erase cache |
| 134 | $ fastboot erase userdata |
| 135 | |
| 136 | An entire Android system can be flashed in a single command: this writes |
Jean-Baptiste Queru | ccdda52 | 2011-05-19 10:47:27 -0700 | [diff] [blame^] | 137 | the boot, recovery and system partitions together after verifying that the |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 138 | system bring flashed is compatible with the installed bootloader and radio, |
| 139 | and reboots the system. |
| 140 | |
| 141 | $ fastboot flashall |
| 142 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 143 | On crespo, crespo4g, sapphire and dream (but not on passion), the commands above can |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 144 | be replaced with a single command |
| 145 | |
| 146 | $ fastboot -w flashall |
| 147 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 148 | ### Nexus S and Nexus S 4G Bootloader and Cell Radio compatibility ### |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 149 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 150 | On Nexus S and Nexus S 4G, each version of Android has only been thoroughly |
| 151 | tested with on specific version of the underlying bootloader and cell radio |
| 152 | software. |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 153 | However, no compatibility issues are expected when running newer systems |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 154 | with older bootloaders and radio images according to the following tables. |
| 155 | |
| 156 | Nexus S: |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 157 | |
| 158 | Android Version | Preferred Bootloader | Preferred Radio | Also possible |
| 159 | ----------------|----------------------|-----------------|-------------- |
| 160 | 2.3 to 2.3.2 | I9020XXJK1 | I9020XXJK8 |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 161 | 2.3.3 | I9020XXKA3 | I9020XXKB1 | All previous versions |
| 162 | 2.3.4 | I9020XXKA3 | I9020XXKD1 | All previous versions |
Jean-Baptiste Queru | b4d39b4 | 2011-04-11 13:53:58 -0700 | [diff] [blame] | 163 | |
Jean-Baptiste Queru | 5da7539 | 2011-05-17 14:32:56 -0700 | [diff] [blame] | 164 | Nexus S 4G: |
| 165 | |
| 166 | Android Version | Preferred Bootloader | Preferred Radio | Also possible |
| 167 | ----------------|----------------------|-----------------|-------------- |
| 168 | 2.3.4 (GRJ06D) | D720SPRKC5 | D720SPRKC9 |
| 169 | 2.3.4 (GRJ22) | D720SPRKC5 | D720SPRKD8 | All previous versions |
| 170 | |
| 171 | If you're building a new version of Android, if your Nexus S or Nexus S 4G has |
| 172 | an older bootloader and radio image that is marked as being also possible in |
| 173 | the table above but is not recognized by the build system, you can locally |
| 174 | delete the `version-bootloader` and `version-baseband` lines in |
| 175 | `device/samsung/crespo/board-info.txt` or `device/samsung/crespo4g/board-info.txt`. |