【发布时间】:2011-09-27 17:17:36
【问题描述】:
我很久以前下载了Android 2.2 源代码,但它没有内核源代码。我在网上看了看,似乎应该下载一个单独的 Android 内核源代码。
有人给了我这个地址
git clone https://android.googlesource.com/kernel/common
但我认为我应该指定版本和分支。 那么下载Android 2.2 froyo内核源代码的完整命令是什么?
【问题讨论】:
我很久以前下载了Android 2.2 源代码,但它没有内核源代码。我在网上看了看,似乎应该下载一个单独的 Android 内核源代码。
有人给了我这个地址
git clone https://android.googlesource.com/kernel/common
但我认为我应该指定版本和分支。 那么下载Android 2.2 froyo内核源代码的完整命令是什么?
【问题讨论】:
对于其他内核,您可以使用以下任何一种:
git clone https://android.googlesource.com/kernel/common.git
git clone https://android.googlesource.com/kernel/goldfish.git
git clone https://android.googlesource.com/kernel/msm.git
git clone https://android.googlesource.com/kernel/omap.git
git clone https://android.googlesource.com/kernel/samsung.git
git clone https://android.googlesource.com/kernel/tegra.git
【讨论】:
git clone https://android.googlesource.com/kernel/common.git 还不够!
cd common
列出所有分支:
git branch -a
签出其中一个:
git checkout android-2.6.39
【讨论】:
获取工具:
$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
获取repo工具:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
获取源代码:
$ repo init -u https://android.googlesource.com/platform/manifest
或
$ repo init -u https://android.googlesource.com/platform/manifest -b release-1.0
或
$ repo init -u https://android.googlesource.com/platform/manifest -b android-sdk-1.5_r2
$ repo sync`
同步单个项目:
$ repo sync {project_name}
获取通用内核:
$ git clone https://android.googlesource.com/kernel/common
【讨论】:
添加到@Aloongs 答案->
使用 Git 获取源代码:
git checkout -b android-2.6.35 origin/android-2.6.35
其中-b = 分支名称和起点是 android-2.6.35
要列出远程分支,请使用以下命令:
git branch -r
【讨论】: