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 | |
| 22 | The only supported device is Nexus S, a.k.a. "crespo". Nexus S is the recommended |
| 23 | device to use with the Android Open-Source Project. Nexus One a.k.a. "passion" is |
| 24 | experimentatal and unsupported. Android Developer Phones (ADP1 and ADP2, a.k.a. "dream" |
| 25 | and "sapphire") are obsolete, were experimental and unsupported in froyo, and can't |
| 26 | be used with gingerbread. |
| 27 | |
| 28 | ## Building fastboot and adb ## |
| 29 | |
| 30 | If you don't already have those tools, fastboot and adb can be built with |
| 31 | the regular build system. Follow the instructions on the page about |
| 32 | [building](building.html), and replace the main `make` command with |
| 33 | |
| 34 | $ make fastboot adb |
| 35 | |
| 36 | ## Booting into fastboot mode ## |
| 37 | |
| 38 | During a cold boot, the following key combinations can be used to boot into fastboot mode, |
| 39 | which is a mode in the bootloader that can be used to flash the devices: |
| 40 | |
| 41 | Device | Keys |
| 42 | ---------|------ |
| 43 | crespo | Press and hold *Volume Up*, then press and hold *Power* |
| 44 | passion | Press and hold the trackball, then press *Power* |
| 45 | sapphire | Press and hold *Back*, then press *Power* |
| 46 | dream | Press and hold *Back*, then press *Power* |
| 47 | |
| 48 | Also, on devices running froyo or later where adb is enabled, |
| 49 | the command `adb reboot bootloader` can be used to reboot from |
| 50 | Android directly into the bootloader with no key combinations. |
| 51 | |
| 52 | ## Unlocking the bootloader ## |
| 53 | |
| 54 | It's only possible to flash a custom system if the bootloader allows it. |
| 55 | |
| 56 | This is the default setup on ADP1 and ADP2. |
| 57 | |
| 58 | On Nexus One and Nexus S, the bootloader is locked by default. With the |
| 59 | device in fastboot mode, the bootloader is unlocked with |
| 60 | |
| 61 | $ fastboot oem unlock |
| 62 | |
| 63 | The procedure must be confirmed on-screen, and deletes the user data for |
| 64 | privacy reasons. It only needs to be run once. |
| 65 | |
| 66 | On Nexus One, the operation voids the warranty and is irreversible. |
| 67 | |
| 68 | On Nexus S, the bootloader can be locked back with |
| 69 | |
| 70 | $ fastboot oem lock |
| 71 | |
| 72 | ## Obtaining proprietary drivers ## |
| 73 | |
| 74 | While it's possible to build and run a system using exclusively source code |
| 75 | from Android Open-Source Project, such a system can only use the devices' |
| 76 | hardware capabilities for which Open-Source drivers exist. |
| 77 | |
| 78 | Official drivers for Nexus S can be downloaded from |
| 79 | [Google's Nexus driver page](http://code.google.com/android/nexus/), which |
| 80 | add access to additional hardware capabilities with non-Open-Source drivers. |
| 81 | |
| 82 | There are no official drivers for Nexus One, ADP2 or ADP1. |
| 83 | |
| 84 | Each driver comes as a self-extracting script in a compressed archive. |
| 85 | After uncompressing each archive, run the included self-extracting script |
| 86 | from the root of the source tree, confirm that you agree to the terms of the |
| 87 | enclosed license agreement, and the drivers and their matching makefiles |
| 88 | will get installed in the `vendor/` hierarchy of the source tree. |
| 89 | |
| 90 | In order to make sure that the newly installed drivers are properly |
| 91 | taken into account after being extracted, the existing output of any previous |
| 92 | build needs to be deleted with |
| 93 | |
| 94 | $ make clobber |
| 95 | |
| 96 | ## Picking and building the configuration that matches a device ## |
| 97 | |
| 98 | The steps to configure and build the Android Open-Source Project |
| 99 | are described in the page about [Building](building.html). |
| 100 | |
| 101 | The recommended builds for the various devices are available through |
| 102 | the lunch menu, accesed when running the `lunch` command with no arguments: |
| 103 | |
| 104 | Device | Build configuration |
| 105 | ---------|--------------------- |
| 106 | crespo | full_crespo-userdebug |
| 107 | passion | full_passion-userdebug |
| 108 | sapphire | full_sapphire-userdebug |
| 109 | dream | full_dream-userdebug |
| 110 | |
| 111 | ## Flashing a device ## |
| 112 | |
| 113 | Set the device in fastboot mode if necessary (see above). |
| 114 | |
| 115 | Because user data is typically incompatible between builds of Android, |
| 116 | it's typically better to delete it when flashing a new system. |
| 117 | |
| 118 | $ fastboot erase cache |
| 119 | $ fastboot erase userdata |
| 120 | |
| 121 | An entire Android system can be flashed in a single command: this writes |
| 122 | teh boot, recovery and system partitions together after verifying that the |
| 123 | system bring flashed is compatible with the installed bootloader and radio, |
| 124 | and reboots the system. |
| 125 | |
| 126 | $ fastboot flashall |
| 127 | |
| 128 | On crespo, sapphire and dream (but not on passion), the commands above can |
| 129 | be replaced with a single command |
| 130 | |
| 131 | $ fastboot -w flashall |
| 132 | |
| 133 | ### Nexus S Bootloader and Cell Radio compatibility ### |
| 134 | |
| 135 | On Nexus S, each version of Android has only been thoroughly tested with |
| 136 | on specific version of the underlying bootloader and cell radio software. |
| 137 | However, no compatibility issues are expected when running newer systems |
| 138 | with older bootloaders and radio images according to the following table: |
| 139 | |
| 140 | Android Version | Preferred Bootloader | Preferred Radio | Also possible |
| 141 | ----------------|----------------------|-----------------|-------------- |
| 142 | 2.3 to 2.3.2 | I9020XXJK1 | I9020XXJK8 |
| 143 | 2.3.3 | I9020XXKA3 | I9020XXKB1 | versions from 2.3 |
| 144 | |
| 145 | If you're building a new version of Android, if your Nexus S has an older |
| 146 | bootloader and radio image that is marked as being also possible in the |
| 147 | table above but is not recognized by the build system, you can locally |
| 148 | delete the version-bootloader and version-baseband lines in |
| 149 | device/samsung/crespo/board-info.txt |