RedHat Enterprise Linux 6中获取Android内核代码:
1.在/root下添加bin目录
mkdir bin
2.将bin目录添加到环境变量中
export PATH=/root/bin/:$PATH
3.通过cURL来下载Repo脚本,保存到/root/bin/repo文件中
curl http://android.git.kernel.org/repo > /root/bin/repo
4.给repo加上执行权限
chmod a+x /root/bin/repo
5.将下载的内核源码存放到/usr/local/src/project-android中
cd /usr/local/src/
mkdir project-android
cd project-android
6.获取内核源码
git clone git://android.git.kernel.org/kernel/common.git
这里需要等待上一段时间,时长取决于你的网速
7.下载完之后进入到内核目录中
cd /usr/local/src/project-android/common
git branch -a 该命令列出所有的内核版本,当前版本为最新的想要更改则
[root@localhost common]# git branch -a
* (no branch)
android-2.6.36
remotes/origin/HEAD -> origin/android-2.6.36
remotes/origin/android-2.6.35
remotes/origin/android-2.6.36
remotes/origin/android-2.6.37
remotes/origin/android-2.6.38
remotes/origin/android-2.6.39
remotes/origin/android-3.0
remotes/origin/archive/android-2.6.25
remotes/origin/archive/android-2.6.27
remotes/origin/archive/android-2.6.29
remotes/origin/archive/android-2.6.32
remotes/origin/archive/android-gldfish-2.6.29
remotes/origin/archive/android-goldfish-2.6.27
remotes/origin/linux-bcm43xx-2.6.39
remotes/origin/linux-wl12xx-2.6.39
执行git checkout origin/android-2.6.36则为获取2.6.36的内核
8.当你更改了common中的Makefile后,你又想换一个内核版本,此时执行git checkout origin/android-2.6.35
会报错,在此之前你应该先git checkout Makefile,之后才执行git checkout origin/android-2.6.35