page.title=Getting Source Code pdk.version=1.0 doc.type=porting @jd:body
Android relies on Git, a version control system, to install the Android platform. You will need to install Git 1.5.2 or greater in order to access the source tree. Please visit http://git.or.cz/ for more information regarding Git.
Git permits you to control access to working directories, and we recommend that you use it to limit Android repository access to only a few people within your organization (please refer to your Google NDA for potential contractual restraints on sharing Android source access).
You may clone Google's repository to a local copy for sharing internally (see Git documentation for details).
To install the Git package, execute:
% sudo apt-get install git-core
Once Git is cleanly installed, you need to establish a connection with Google's Git server, a connection that requires an RSA key in order to authenticate requests.
Each developer must have a unique RSA key in order to access Android source code. To generate an RSA key:
% ssh-keygen -t rsa -C email@domain.com
id_rsa
in this example).id_rsa
: This file contains the private half of your RSA key. You shouldn't share this file with anyone. id_rsa.pub
: This is the public half or your RSA key and you should send it to your Google technical account manager.Send your Google Account Manager your public key file in order to establish Git server access.
Once you have generated an RSA key and shared the public file with Google, you can test your connection with the Git server with the following command:
% ssh android-git.ext.google.com
You should receive one of the following results:
Result | Cause | Action |
---|---|---|
fatal: What do you think I am? A shell?
|
Success | None. You successfully connected to the Git server. (You should not have shell access and it's expected to receive this error.) |
ssh hangs and eventually times out. | Your setup is failing to locate and establish a basic connection. | Google needs to debug network settings. |
Error: Permission denied <public key> | Either you are not using the matching username or the RSA private key does not match the public key. | Try executing:
% ssh $USER@android-
git.ext.google.com
|
Android source code is maintained in two repositories: device
and kernel
. The device
repository includes the Android framework (things like the Activity Manager, Window Manager, Telephony Manager, View System, etc.). The kernel
repository includes the core code necessary to run the operating system (things like the Display Driver, Camera Driver, Keypad Driver, Power Management, etc.). (Please see What is Android? for details.)
Save device and kernel code at the same directory level, for example:
/home/joe/android/device
/home/joe/android/kernel
Device Code
To download device code, you need your username and a unique <path>
string supplied by Google to execute the following:
% git-clone $USER@android-git.ext.google.com:<path>/device.git
Kernel Code
To download kernel code, you need your username and a unique <path>
string supplied by Google to execute the following:
% git-clone $USER@android-git.ext.google.com:<path>/kernel.git
You likely already have Linux running on your platform and only need to integrate Android-specific changes. The following directions describe how to extract an Android patch.
diff
on the two kernel packages to get Android-specific changes.