標籤:
配置android原始碼下載環境
(1)建立一個用於存放下載指令檔(repo)的目錄(可將該指令檔一放到任何目錄中,在這裡使用~/bin)。#mkdir ~/bin #PATH=~/bin:¥PATH
(2)下載指令檔(用於下載Android原始碼)。#curl https://dl-ssl。Google.Com/dl/googlesource/git-repo/repo>~/bin/repo #chmod a+x ~/bin/repo
(3)建立用於存放Android原始碼的目錄(可放在其他目錄中)。#mkdir android-source #cd android-source
(4)初始化#rcpo init -u https://android.googlesource.com/platform/manifeet #repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1-rl
(5)開始下載Android原始碼 #repo sync
編譯Android原始碼
apt-get命令一般需要root許可權執行,所以一般跟著sudo命令。
sudo apt-get install git-core curl
這條命令會從互連網的軟體倉庫中安裝git-core和curl。
其中curl是一個利用URL文法在命令列方式下工作的檔案傳輸工具,它支援很多協議,包括FTP、FTPS、HTTP、HTTPS、TELENT等,我們需要安裝它從網路上擷取Repo指令檔。
curl http://android.git.kernel.org/repo >~/bin/repo
這句命令會下載repo指令檔到當前主目錄的/bin目錄下,並儲存在檔案repo中。
最後我們需要給repo檔案可執行許可權
chmod a+x ~/bin/repo
待續...
下載和編譯Linux核心原始碼
1. 使用GIT工具下載,執行以下命令:
[email protected]:~/Android$ mkdir kernel
[email protected]:~/Android$ cd kernel
[email protected]:~/Android/kernel$ git clone git://android.git.kernel.org/kernel/common.git
同樣是經過漫長的等待後,在kernel目錄下有一個common目錄,Linux核心代碼就在這裡了。
2. 下載完成後,可以查看下載的核心代碼版本:
[email protected]:~/Android/kernel$ cd common
[email protected]:~/Android/kernel/common$ git branch
android-2.6.36
3. 下載完Android的Linux核心代碼後,會發現在arch/arm/configs下沒有模擬器要使用的硬體設定檔goldfish_defconfig
下載完畢後,就能在arch/arm/configs下看到goldfish_defconfig這個檔案了。
ANDROID深度探索(卷1)HAL與驅動開發 第四章