ANDROID深度探索(卷1)HAL與驅動開發 第四章

來源:互聯網
上載者:User

標籤:

配置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與驅動開發 第四章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.