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