安卓系统源码、内核下载
一、下載源碼
以下載源碼2.3.7版本為例
環(huán)境ubuntu14.04
1、安裝git
? ? ?sudo apt-get install git
? ? ?git --version? //查看版本
? ? ?git config --global user.name "zhangsan"? //設(shè)置用戶名
? ? ?git config --global user.email "zhangsan@163.com" //設(shè)置郵箱
? ? ?git config --list? //查看配置是否成功
2、在用戶目錄下面新建文件夾bin
3、PATH=~/bin:$PATH
? ? ?也就是讓環(huán)境變量包含用戶目錄下的bin文件夾
4、curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repo
? ? ? 到~/bin下可以看到有個(gè)文件repo,輸入file repo可以看到文件的屬性是個(gè)python腳本
5、chmod a+x ~/bin/repo
6、vi ~/bin/repo
? ? 將里面的 REPO_URL 值改為?'https://gerrit-googlesource.lug.ustc.edu.cn/git-repo'
7、repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-2.3.1_r1
? ? ? 初始化repo,用的是清華源,可以將android-2.3.1改成自己想要的版本如android-x.x.x
8、repo sync
? ? ?網(wǎng)絡(luò)斷了或者卡住了可以中斷然后用這句可以恢復(fù)下載
結(jié)果:
?
二、下載內(nèi)核
? ? ?mkdir kernel //文件夾用來(lái)存放內(nèi)核
? ? ?cd kernel?
? ? ?git init //初始化代碼庫(kù)
? ? ?git clone https://aosp.tuna.tsinghua.edu.cn/android/kernel/goldfish.git
? ? ?cd goldfish
? ? ?git branch -a
? ? ?git checkout remotes/origin/android-goldfish-2.6.29//git庫(kù)可根據(jù)需求進(jìn)行替換,這里下載了模擬器內(nèi)核
? ? 如果git clone卡住很久不動(dòng),解決辦法端口修改為443,如下:
? ? cd ~/.ssh/
? ??vim config //新建config文件
? ? 在config文件中添加如下代碼:
? ? Host github.com? ?
? ?User "zhangsan@163.com"? ? //github上的注冊(cè)郵箱
? ?Hostname ssh.github.com??
? ?PreferredAuthentications publickey ?//采用公匙
? ?IdentityFile ~/.ssh/id_rsa ???//公匙文件路徑
? ?Port 443 ???????????//修改端口為443
? 保存退出再重新git clone
?
? ??
? ?
?
總結(jié)
以上是生活随笔為你收集整理的安卓系统源码、内核下载的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 2010年6月16日最新NOD32激活码
- 下一篇: pe系统怎么加服务器raid驱动,在PE