blob: 87e81211933e19399bad826a91c7e33f8a4c3ce5 [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
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070022The only supported devices are Nexus S, a.k.a. "crespo", and Nexus S 4G, a.k.a.
23"crespo4g".
24Nexus S is the recommended device to use with the Android Open-Source Project.
25Nexus One a.k.a. "passion" is experimentatal and unsupported. Android Developer
26Phones (ADP1 and ADP2, a.k.a. "dream" and "sapphire") are obsolete, were
27experimental and unsupported in froyo, and can't be used with gingerbread.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070028
29## Building fastboot and adb ##
30
31If you don't already have those tools, fastboot and adb can be built with
32the 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
39During a cold boot, the following key combinations can be used to boot into fastboot mode,
40which is a mode in the bootloader that can be used to flash the devices:
41
42Device | Keys
43---------|------
44crespo | Press and hold *Volume Up*, then press and hold *Power*
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070045crespo4g | Press and hold *Volume Up*, then press and hold *Power*
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070046passion | Press and hold the trackball, then press *Power*
47sapphire | Press and hold *Back*, then press *Power*
48dream | Press and hold *Back*, then press *Power*
49
50Also, on devices running froyo or later where adb is enabled,
51the command `adb reboot bootloader` can be used to reboot from
52Android directly into the bootloader with no key combinations.
53
54## Unlocking the bootloader ##
55
56It's only possible to flash a custom system if the bootloader allows it.
57
58This is the default setup on ADP1 and ADP2.
59
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070060On Nexus One, Nexus S, and Nexus S 4G, the bootloader is locked by default.
61With the device in fastboot mode, the bootloader is unlocked with
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070062
63 $ fastboot oem unlock
64
65The procedure must be confirmed on-screen, and deletes the user data for
66privacy reasons. It only needs to be run once.
67
68On Nexus One, the operation voids the warranty and is irreversible.
69
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070070On Nexus S and Nexus S 4G, the bootloader can be locked back with
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070071
72 $ fastboot oem lock
73
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070074## Obtaining proprietary binaries ##
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070075
76While it's possible to build and run a system using exclusively source code
77from Android Open-Source Project, such a system can only use the devices'
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070078hardware capabilities for which Open-Source support exists.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070079
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070080Official 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),
82which add access to additional hardware capabilities with non-Open-Source code.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070083
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070084There are no official binaries for Nexus One, ADP2 or ADP1.
85
86### Extracting the proprietary binaries ###
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070087
88Each driver comes as a self-extracting script in a compressed archive.
89After uncompressing each archive, run the included self-extracting script
90from the root of the source tree, confirm that you agree to the terms of the
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070091enclosed license agreement, and the binaries and their matching makefiles
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070092will get installed in the `vendor/` hierarchy of the source tree.
93
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -070094There's an additional step on Nexus S 4G. Build the signapk tool with
95
96 $ make signapk
97
98Then reassemble the proprietary applicatons with
99
100 $ vendor/samsung/crespo4g/reassemble-apks.sh
101
102### Cleaning up when adding proprietary binaries ###
103
104In order to make sure that the newly installed binaries are properly
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700105taken into account after being extracted, the existing output of any previous
106build needs to be deleted with
107
108 $ make clobber
109
110## Picking and building the configuration that matches a device ##
111
112The steps to configure and build the Android Open-Source Project
113are described in the page about [Building](building.html).
114
115The recommended builds for the various devices are available through
116the lunch menu, accesed when running the `lunch` command with no arguments:
117
118Device | Build configuration
119---------|---------------------
120crespo | full_crespo-userdebug
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700121crespo4g | full_crespo4g-userdebug
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700122passion | full_passion-userdebug
123sapphire | full_sapphire-userdebug
124dream | full_dream-userdebug
125
126## Flashing a device ##
127
128Set the device in fastboot mode if necessary (see above).
129
130Because user data is typically incompatible between builds of Android,
131it's typically better to delete it when flashing a new system.
132
133 $ fastboot erase cache
134 $ fastboot erase userdata
135
136An entire Android system can be flashed in a single command: this writes
Jean-Baptiste Queruccdda522011-05-19 10:47:27 -0700137the boot, recovery and system partitions together after verifying that the
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700138system bring flashed is compatible with the installed bootloader and radio,
139and reboots the system.
140
141 $ fastboot flashall
142
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700143On crespo, crespo4g, sapphire and dream (but not on passion), the commands above can
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700144be replaced with a single command
145
146 $ fastboot -w flashall
147
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700148### Nexus S and Nexus S 4G Bootloader and Cell Radio compatibility ###
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700149
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700150On Nexus S and Nexus S 4G, each version of Android has only been thoroughly
151tested with on specific version of the underlying bootloader and cell radio
152software.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700153However, no compatibility issues are expected when running newer systems
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700154with older bootloaders and radio images according to the following tables.
155
156Nexus S:
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700157
158Android Version | Preferred Bootloader | Preferred Radio | Also possible
159----------------|----------------------|-----------------|--------------
1602.3 to 2.3.2 | I9020XXJK1 | I9020XXJK8
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -07001612.3.3 | I9020XXKA3 | I9020XXKB1 | All previous versions
1622.3.4 | I9020XXKA3 | I9020XXKD1 | All previous versions
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700163
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700164Nexus S 4G:
165
166Android Version | Preferred Bootloader | Preferred Radio | Also possible
167----------------|----------------------|-----------------|--------------
1682.3.4 (GRJ06D) | D720SPRKC5 | D720SPRKC9
1692.3.4 (GRJ22) | D720SPRKC5 | D720SPRKD8 | All previous versions
170
171If you're building a new version of Android, if your Nexus S or Nexus S 4G has
172an older bootloader and radio image that is marked as being also possible in
173the table above but is not recognized by the build system, you can locally
174delete the `version-bootloader` and `version-baseband` lines in
175`device/samsung/crespo/board-info.txt` or `device/samsung/crespo4g/board-info.txt`.