blob: 43d2b555713f26aa84409999254a9d8fb6152a30 [file] [log] [blame] [view]
Skyler Kaufman44436912011-04-07 15:11:52 -07001<!--
Conley Owens68ef9842011-04-22 13:51:20 -07002 Copyright 2010 The Android Open Source Project
Skyler Kaufman44436912011-04-07 15:11:52 -07003
Conley Owens68ef9842011-04-22 13:51:20 -07004 Licensed under the Apache License, Version 2.0 (the "License");
Skyler Kaufman44436912011-04-07 15:11:52 -07005 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
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070017# Downloading the Source Tree #
18
19## Installing Repo ##
20
Skyler Kaufman44436912011-04-07 15:11:52 -070021Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, see [Version Control](version-control.html).
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070022
23To install, initialize, and configure Repo, follow these steps:
24
25 - Make sure you have a bin/ directory in your home directory, and that it is included in your path:
26
27 $ mkdir ~/bin
28 $ PATH=~/bin:$PATH
29
30 - Download the Repo script and ensure it is executable:
31
Jean-Baptiste Querube48f612011-10-06 14:20:51 -070032 $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070033 $ chmod a+x ~/bin/repo
34
Jean-Baptiste Queru5f2afb12011-12-05 17:19:47 -080035 - The SHA-1 checksum for repo is 29ba4221d4fccdfa8d87931cd73466fdc24040b5
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070036
Jean-Baptiste Queru57a79102012-01-05 08:52:23 -080037
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070038## Initializing a Repo client ##
39
40After installing Repo, set up your client to access the android source repository:
41
Jean-Baptiste Querube48f612011-10-06 14:20:51 -070042 - Create an empty directory to hold your working files.
Jean-Baptiste Queru64175aa2011-11-08 17:25:08 -080043 If you're using MacOS, this has to be on a case-sensitive filesystem.
Jean-Baptiste Querube48f612011-10-06 14:20:51 -070044 Give it any name you like:
45
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070046
47 $ mkdir WORKING_DIRECTORY
48 $ cd WORKING_DIRECTORY
49
50 - Run `repo init` to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
51
Jean-Baptiste Querube48f612011-10-06 14:20:51 -070052 $ repo init -u https://android.googlesource.com/platform/manifest
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070053
54 To check out a branch other than "master", specify it with -b:
55
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -070056 $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070057
58 - When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a [registered Google account](http://www.google.com/accounts). Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
59
60A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a `.repo` directory where files such as the manifest will be kept.
61
62
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070063## Getting the files ##
64
65To pull down files to your working directory from the repositories as specified in the default manifest, run
66
67 $ repo sync
68
Jean-Baptiste Querube48f612011-10-06 14:20:51 -070069The Android source files will be located in your working directory
70under their project names. The initial sync operation will take
71an hour or more to complete. For more about `repo sync` and other
72Repo commands, see [Version Control](version-control.html).
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070073
74
Jean-Baptiste Queru57a79102012-01-05 08:52:23 -080075## Troubleshooting network issues ##
76
77When downloading from behind a proxy (which is common in some
78corporate environments), it might be necessary to explicitly
79specify the proxy that is then used by repo:
80
81 $ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
82 $ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
83
84More rarely, Linux clients experience connectivity issues, getting
85stuck in the middle of downloads (typically during "Receiving objects").
86It has been reported that tweaking the settings of the TCP/IP stack and
87using non-parallel commands can improve the situation. You need root
88access to modify the TCP setting:
89
90 $ sudo sysctl -w net.ipv4.tcp_window_scaling=0
91 $ repo sync -j1
92
93
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070094## Verifying Git Tags ##
95
96Load the following public key into your GnuPG key database. The key is used to sign annotated tags that represent releases.
97
98 $ gpg --import
99
100Copy and paste the key(s) below, then enter EOF (Ctrl-D) to end the input and process the keys.
101
Conley Owens68ef9842011-04-22 13:51:20 -0700102 -----BEGIN PGP PUBLIC KEY BLOCK-----
103 Version: GnuPG v1.4.2.2 (GNU/Linux)
Jean-Baptiste Queru6a64a5b2011-05-25 09:07:50 -0700104
Conley Owens68ef9842011-04-22 13:51:20 -0700105 mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
106 lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
107 8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
108 u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
109 wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
110 /HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
111 jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
112 MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
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eoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
130 =Wi5D
131 -----END PGP PUBLIC KEY BLOCK-----
Skyler Kaufman991ae4d2011-04-07 12:30:41 -0700132
Conley Owens68ef9842011-04-22 13:51:20 -0700133After importing the keys, you can verify any tag with
134
Skyler Kaufman991ae4d2011-04-07 12:30:41 -0700135 $ git tag -v TAG_NAME
136
Conley Owens34e98122011-12-09 16:11:30 -0800137If you haven't [set up ccache](initializing.html#ccache) yet,
138now would be a good time to do it.
Skyler Kaufman991ae4d2011-04-07 12:30:41 -0700139
Conley Owens91b9bab2011-12-12 14:30:13 -0800140## Downloading kernels ##
141
142If you are only interested in kernel sources,
143you can get the kernel you are interested in through one of the following
144commands:
145
146 $ git clone https://android.googlesource.com/kernel/common.git
147 $ git clone https://android.googlesource.com/kernel/goldfish.git
148 $ git clone https://android.googlesource.com/kernel/msm.git
149 $ git clone https://android.googlesource.com/kernel/omap.git
150 $ git clone https://android.googlesource.com/kernel/samsung.git
151 $ git clone https://android.googlesource.com/kernel/tegra.git
152
Skyler Kaufman991ae4d2011-04-07 12:30:41 -0700153# Next: Build the code #
154
155You now have a complete local copy of the Android codebase. Continue on to [building](building.html)....