135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lypage.title=Downloading the Source
235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly@jd:body
335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<!--
535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    Copyright 2010 The Android Open Source Project
635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    Licensed under the Apache License, Version 2.0 (the "License");
835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    you may not use this file except in compliance with the License.
935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    You may obtain a copy of the License at
1035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
1135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly        http://www.apache.org/licenses/LICENSE-2.0
1235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
1335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    Unless required by applicable law or agreed to in writing, software
1435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    distributed under the License is distributed on an "AS IS" BASIS,
1535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    See the License for the specific language governing permissions and
1735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    limitations under the License.
1835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly-->
1935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<div id="qv-wrapper">
2035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <div id="qv">
2135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <h2>In this document</h2>
2235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <ol id="auto-toc">
2335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </ol>
2435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  </div>
2535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</div>
2635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
2735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
2835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  The Android source tree is located in a Git repository hosted by Google. This document
2935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  describes how to download the source tree for a specific Android code-line.
3035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
3135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="installing-repo">
3235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Installing Repo
3335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</h2>
3435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
3535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Repo is a tool that makes it easier to work with Git in the context of Android. For more
3635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  information about Repo, see the <a href="developing.html">Developing</a> section.
3735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
3835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
3935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  To install Repo:
4035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
4135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<ol>
4235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <li>
4335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <p>
4435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      Make sure you have a bin/ directory in your home directory and that it is included in
4535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      your path:
4635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </p>
4735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <pre>
4835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<code>$ mkdir ~/bin
4935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ PATH=~/bin:$PATH
5035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</code>
5135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
5235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  </li>
5335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <li>
5435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <p>
5535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      Download the Repo tool and ensure that it is executable:
5635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </p>
5735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <pre>
5835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo &gt; ~/bin/repo
5935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ chmod a+x ~/bin/repo
6035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
6135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  </li>
6235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</ol>
6335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
6435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  For version 1.17, the SHA-1 checksum for repo is ddd79b6d5a7807e911b524cb223bc3544b661c28
6535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
6640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<p>
6740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  For version 1.19, the SHA-1 checksum for repo is 92cbad8c880f697b58ed83e348d06619f8098e6c
6840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly</p>
6935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="initializing-a-repo-client">
7035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Initializing a Repo client
7135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</h2>
7235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
7335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  After installing Repo, set up your client to access the Android source repository:
7435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
7535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<ol>
7635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <li>
7735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <p>
7835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      Create an empty directory to hold your working files. If you're using MacOS, this has to
7935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      be on a case-sensitive filesystem. Give it any name you like:
8035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </p>
8135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
8235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ mkdir WORKING_DIRECTORY
8335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ cd WORKING_DIRECTORY
8435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
8535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  </li>
8635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <li>
8735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <p>
8835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      Run <code>repo init</code> to bring down the latest version of Repo with all its most
8935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      recent bug fixes. You must specify a URL for the manifest, which specifies where the
9035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      various repositories included in the Android source will be placed within your working
9135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      directory.
9235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </p>
9335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
9435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo init -u https://android.googlesource.com/platform/manifest
9535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
9635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <p>
9735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      To check out a branch other than "master", specify it with -b:
9835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </p>
9935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
10035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
10135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
10235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  </li>
10335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <li>
10435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <p>
10535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      When prompted, configure Repo with your real name and email address. To use the Gerrit
10635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      code-review tool, you will need an email address that is connected with a <a href= 
10735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      "https://www.google.com/accounts">registered Google account</a>. Make sure this is a live
10835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      address at which you can receive messages. The name that you provide here will show up in
10935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly      attributions for your code submissions.
11035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </p>
11135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  </li>
11235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</ol>
11335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
11435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  A successful initialization will end with a message stating that Repo is initialized in your
11535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  working directory. Your client directory should now contain a <code>.repo</code> directory
11635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  where files such as the manifest will be kept.
11735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
11835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="getting-the-files">
11935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Downloading the Android Source Tree
12035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</h2>
12135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
12235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  To pull down the Android source tree to your working directory from the repositories as
12335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  specified in the default manifest, run
12435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
12535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>$ repo sync</pre>
12635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
12735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  The Android source files will be located in your working directory under their project names.
12835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  The initial sync operation will take an hour or more to complete. For more about <code>repo
12935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  sync</code> and other Repo commands, see the <a href="developing.html">Developing</a> section.
13035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
13135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="using-authentication">
13235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Using Authentication
13335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</h2>
13435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
13535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  By default, access to the Android source code is anonymous. To protect the servers against
13635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  excessive usage, each IP address is associated with a quota.
13735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
13835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
13935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  When sharing an IP address with other users (e.g. when accessing the source repositories from
14035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  beyond a NAT firewall), the quotas can trigger even for regular usage patterns (e.g. if many
14135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  users sync new clients from the same IP address within a short period).
14235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
14335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
14435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  In that case, it is possible to use authenticated access, which then uses a separate quota
14535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  for each user, regardless of the IP address.
14635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
14735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
14835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  The first step is to create a password from <a href= 
14935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  "https://android.googlesource.com/new-password">the password generator</a> and to save it in
15035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <code>~/.netrc</code> according to the instructions on that page.
15135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
15235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
15335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  The second step is to force authenticated access, by using the following manifest URI:
15435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <code>https://android.googlesource.com/a/platform/manifest</code>. Notice how the
15535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <code>/a/</code> directory prefix triggers mandatory authentication. You can convert an
15635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  existing client to use mandatory authentication with the following command:
15735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
15835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
15935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo init -u https://android.googlesource.com/a/platform/manifest
16035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
16135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="troubleshooting-network-issues">
16235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Troubleshooting network issues
16335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</h2>
16435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
16535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  When downloading from behind a proxy (which is common in some corporate environments), it
16635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  might be necessary to explicitly specify the proxy that is then used by repo:
16735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
16835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
16935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>;
17035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>;
17135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
17235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
17335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  More rarely, Linux clients experience connectivity issues, getting stuck in the middle of
17435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  downloads (typically during "Receiving objects"). It has been reported that tweaking the
17535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  settings of the TCP/IP stack and using non-parallel commands can improve the situation. You
17635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  need root access to modify the TCP setting:
17735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
17835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
17935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ sudo sysctl -w net.ipv4.tcp_window_scaling=0
18035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo sync -j1
18135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
18235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="using-a-local-mirror">
18335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Using a local mirror
18435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</h2>
18535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
18635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  When using several clients, especially in situations where bandwidth is scarce, it is better
18735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  to create a local mirror of the entire server content, and to sync clients from that mirror
18835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  (which requires no network access). The download for a full mirror is smaller than the
18935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  download of two clients, while containing more information.
19035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
19135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
19235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  These instructions assume that the mirror is created in <code>/usr/local/aosp/mirror</code>.
19335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  The first step is to create and sync the mirror itself, which uses close to 13GB of network
19435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  bandwidth and a similar amount of disk space. Notice the <code>--mirror</code> flag, which
19535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  can only be specified when creating a new client:
19635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
19735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
19835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ mkdir -p /usr/local/aosp/mirror
19935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ cd /usr/local/aosp/mirror
20035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo init -u https://android.googlesource.com/mirror/manifest --mirror
20135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo sync
20235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
20335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
20435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Once the mirror is synced, new clients can be created from it. Note that it's important to
20535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  specify an absolute path:
20635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
20735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>$ mkdir -p /usr/local/aosp/master
20835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ cd /usr/local/aosp/master
20935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo init -u /usr/local/aosp/mirror/platform/manifest.git
21035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo sync
21135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
21235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
21335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Finally, to sync a client against the server, the mirror needs to be synced against the
21435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  server, then the client against the mirror:
21535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
21635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
21735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ cd /usr/local/aosp/mirror
21835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo sync
21935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ cd /usr/local/aosp/master
22035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ repo sync
22135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
22235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
22335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  It's possible to store the mirror on a LAN server and to access it over NFS, SSH or Git. It's
22435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  also possible to store it on a removable drive and to pass that drive around between users or
22535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  between machines.
22635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
22735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="verifying-git-tags">
22835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Verifying Git Tags
22935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</h2>
23035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
23135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Load the following public key into your GnuPG key database. The key is used to sign annotated
23235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  tags that represent releases.
23335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
23435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
23535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ gpg --import
23635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
23735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
23835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  Copy and paste the key(s) below, then enter EOF (Ctrl-D) to end the input and process the
23935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  keys.
24035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
24135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
24235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly-----BEGIN PGP PUBLIC KEY BLOCK-----
24335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyVersion: GnuPG v1.4.2.2 (GNU/Linux)
24435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
24535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LymQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
24635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LylFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
24735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
24835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyu4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
24935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LywNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
25035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly/HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
25135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyjU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
25235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyMGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
25335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyb/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
25435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyaWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
25535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lycm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
25635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LygAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
25735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
25835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyQN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
25935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyhisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
26035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyC2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
26135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyLWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
26235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyOgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
26335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LypK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
26435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyKZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
26535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyN8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
26635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyvUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
26735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyG1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
26835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyhN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
26935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert LyEXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
27035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly=Wi5D
27135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly-----END PGP PUBLIC KEY BLOCK-----
27235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
27335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
27435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  After importing the keys, you can verify any tag with
27535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>
27635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre>
27735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git tag -v TAG_NAME
27835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</pre>
27935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>
28035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  If you haven't <a href="initializing.html#ccache">set up ccache</a> yet, now would be a good
28135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  time to do it.
28235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</p>