1. 安装JDK

jdk1.6

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"$ sudo add-apt-repository "deb-src http://archive.canonical.com/ubuntu lucid partner"$ sudo apt-get update$ sudo apt-get install sun-java6-jdk
 jdk1.5
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"$ sudo apt-get update$ sudo apt-get install sun-java5-jdk
安装必要的工具
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \  zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \  x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \  libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \  libxml2-utils

下载android2.2的源代码

安装 Repo

  • Make sure you have a bin/ directory in your home directory, and that it is included in your path:

    $ mkdir ~/bin$ PATH=~/bin:$PATH
  • Download the Repo script and ensure it is executable:

    $ curl https://android.git.kernel.org/repo > ~/bin/repo$ chmod a+x ~/bin/repo
  • The MD5 checksum for repo is bbf05a064c4d184550d71595a662e098

  • 下载android2.2 源代码
  • Create an empty directory to hold your working files:

    $ mkdir WORKING_DIRECTORY$ cd WORKING_DIRECTORY
  • 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.

    $ repo init -u git://android.git.kernel.org/platform/manifest.git

    To check out a branch other than "master", specify it with -b:

    $ repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo

可能被黑了,替代方案

curl"http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo">~/bin/repo

chmoda+x~/bin/repo

PATH=~/bin:$PATH

cdyour_download_folder

repoinit-ugit://codeaurora.org/platform/manifest.git-bgingerbread

同步代码

reposync

下载android2.2 的linux内核代码

mkdir android_kernel
2. cd android_kernel
3. git clone git://android.git.kernel.org/kernel/common.git (下载默认版本内核源码)

下面是git常用的命令示例:
4. cd common
5. git branch(查看当前分支,结果为android-2.6.27)
6. git branch -r(显示远程branch列表)
origin/HEAD
origin/android-2.6.25
origin/android-2.6.27
origin/android-2.6.29
origin/android-2.6.32
origin/android-goldfish-2.6.27
origin/android-goldfish-2.6.29

7. git tag (显示tag列表,下面截取一部分结果)

8. git checkout -b android-2.6.29 v2.6.29 (检出一个新branch android-2.6.29)
git checkout -b android-2.6.25 v2.6.25 (检出一个新branch android-2.6.25)
9. git branch -d android-2.6.27 (删除branch android-2.6.27)
10. git checkout android-2.6.29 (切换至brach android-2.6.29)
11. git format-patch android-2.6.25..android-2.6.29 (会生成4万个patch)

更多相关文章

  1. 安装时提示:INSTALL_FAILED_INSUFFICIENT_STORAGE
  2. android更新应用程序
  3. Android(安卓)代码监控apk安装,卸载,替换
  4. 下载管理器类的封装(观察者模式)
  5. 使用AnsyncTask异步类从网络上下载图片
  6. the android development environment
  7. 手机安全卫士开发系列(5)——自动更新
  8. ubuntu 16.04 编译Android(安卓)5.1
  9. 下载好自动安装

随机推荐

  1. 2010.10.26———Android(安卓)01
  2. android 3G pppd 调试记录
  3. Android指定调用系统自带浏览器打开链接
  4. Android自定义ProgressBar
  5. [Android各版本特性]Android(安卓)8.0 Or
  6. Android(安卓)SDK更新失败对策
  7. ProgressBar用法
  8. android:broadcast_01
  9. Android(安卓)Bluetooth初始化流程
  10. PullToRefreshLayout +RecyclerView 实现