http://www.williamhua.com/2009/04/git-and-repo-for-dummies/
http://www.javaask.com/mobile/android/2011/0318/4026.html
android 源代码下载 — 基于ubuntu 10.04
1、安装Git
sudo apt-get install git-core curl
2、安装Repo
在当前用户的主目录下创建一个/bin目录,然后把它~/bin加到PATH环境变量中。
接下来通过cURL下载Repo脚本,保存到~/bin/repo文件中:curl http://android.git.kernel.org/repo >~/bin/repo
给repo可执行权限:chmod a+x ~/bin/repo
3、初始化版本库
建立~/android目录,进去以后用repo init -u git://android.git.kernel.org/platform/manifest.git 下载Android当前主线上最新版本的所有的sourcecode。
最后看到提示repo initialized in /android,说明本地的版本库已经初始化完毕,并且包含了当前最新的sourcecode。
4.同步主线源代码
$ repo sync 可能需要几天几夜
repo sync -jn(n为同时打开的链接数)开启多个网络连接来下载,可能速度有所提升。
5.编译源码
$ make
中间遇到的问题
/bin/bash: bison:找不到命令 用sudo apt-get install bison解决。
Your version is: /bin/bash: java: command not found 用sudo apt-get install openjdk-6-jdk解决。
external/clearsilver/cgi/cgi.c:885: error: ‘z_stream’ undeclared 用$ sudo apt-get install gperf解决。
编译过程停留在 target dex:Core 可能是内存分配的太小了,
/bin/bash: flex:找不到命令,用sudo apt-get install flex解决。
http://blog.jkey.lu/a-number-of-solutions-of-error-when-compile-android-in-ubuntu/