03, 在ubuntu 環境中,下載 Android 原始碼

03, 在ubuntu 環境中,下載 Android 原始碼

接下來請把載回來的 android 原始碼解壓縮

安裝 Repo

Repo 是一個工具,來做Git, 來取得 Android 系統的原始程式.  Repo 的詳細介紹,請看 Version Control.

To install, initialize, and configure Repo, follow these steps:

    • Make sure you have a bin/ directory in your home directory, and that it is included in your path:

[php]
$ sudo mkdir ~/bin
$ PATH=~/bin:$PATH
[/php]
[php]
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
[/php]

    • 下載  Repo script 和確認可以執行 :

[php]$ sudo curl https://android.git.kernel.org/repo > repo
$ chmod a+x repo
[/php]

設定 Repo client

[php]
$ sudo ./repo init -u git://android.git.kernel.org/platform/manifest.git
$ sudo ./repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
[/php]

開始下載了

現在正是要下載android 的原始程式碼了。

[php]$ sudo ./repo sync [/php]


要等很久,我是等一個多小時。

成功後,就可以看到

練習:

請看看你的 WORKING_DIRECTORY 的檔案結構,之後我們會花很多的時間講解裡面的檔案和文件


進階:

Verifying Git Tags

Load the following public key into your GnuPG key database. The key is used to sign annotated tags that represent releases.

[php]
$ gpg –import
[/php]

參考資料:

  • 官方的安裝文件下載篇  http://source.android.com/source/downloading.html
Android 系統底層
CH01 簡介CH02 安裝CH03 編譯系統CH04 編譯程式的QACH05 系統軟體CH06 JNICH07 APP呼叫Android Driver教學CH30 DRM