Android : 下載核心源碼 and 編譯、打包

來源:互聯網
上載者:User

標籤:x86_64   核心版本   pop   href   nload   刷機   height   letter   disk   

一、Android核心源碼的下載:

1.Google GIT地址:

$ git clone https://android.googlesource.com/kernel/common.git  

$ git clone https://android.googlesource.com/kernel/exynos.git  

$ git clone https://android.googlesource.com/kernel/goldfish.git  

$ git clone https://android.googlesource.com/kernel/msm.git  

$ git clone https://android.googlesource.com/kernel/omap.git  

$ git clone https://android.googlesource.com/kernel/samsung.git  

$ git clone https://android.googlesource.com/kernel/tegra.git  

 

2.清華伺服器位址:

 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/common.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/exynos.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/goldfish.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/hikey-linaro.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/lk.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/msm.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/omap.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/samsung.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/tegra.git
 git clone https://aosp.tuna.tsinghua.edu.cn/kernel/x86_64.git

goldfish這個project包含了適合於模擬器平台的源碼;
msm這個project包含了適合於ADP1、ADP2、Nexus One、Nexus 4的源碼,並且可以作為高通MSM晶片集開發定製核心工作的起始點;
omap這個project包含了適合於PandaBoard、Galaxy Nexus的源碼,並且可以作為德州儀器OMAP晶片集核心開發定製工作的起始點;
samsung這個project包含了適合於Nexus S的源碼,並且可以作為三星蜂鳥晶片集核心開發定製工作的起始點;
tegra這個project包含了適合於Xoom和Nexus 7的源碼,並且可以作為英偉達圖睿晶片集核心開發定製工作的起始點;
exynos這個project包含了適合與Nexus 10的源碼,並且可以作為三星獵戶座晶片集核心開發定製工作的起始點。

 

二、編譯:
 1.程式碼程式庫download之後會在對應的目錄下可以通過 ls -al 查看到 .git , git branch -a 查看所有分支,我手上nexus平板刷的Android5.0的系統,所有選擇以下核心版本:

  git checkout remotes/origin/android-tegra-flounder-3.10-lollipop-release

    2.分支代碼下載好之後:

      (1)修改Makefile:

  #ARCH  ?= $(SUBARCH)
  #CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)

       修改為:

  ARCH ?= arm
  CROSS_COMPILE ?= arm-eabi-

      (2)配置:

       kernel/xxx/arch/arm/configs/    ,目錄下有很多設定檔
       make tegra_defconfig              ,選擇預設配置,之後會產生 .config
       make menuconfig                    ,可以通過此命令進一步配置核心更新 .config

      
   (3)編譯:      

       配置好核心後就可以輸入 : make    ,等待zImage的產生。

三、打包zImage 到 boot.img,並刷機:

# 下載解打包工具 https://github.com/derekhe/u8825d-bootimg-scripts# 解壓到任意地方後,從手機上擷取得你現在正使用的boot.img放到解壓出來的目錄# 1. 解壓現有的boot.img./unpack-bootimg.pl boot.img
# 2. 拷貝編譯的zImage檔案到此目錄,路徑自己確定cp ../arch/arm/boot/zImage ./
# 3. 打包zImage和ramdisk目錄mv boot.img boot.img.bak./repack-bootimg.pl zImage boot.img-ramdisk boot.img
# 4. 刷入boot.img,手機重啟的瞬間要記得按音量減鍵./adb reboot./fastboot devices./fastboot erase boot./fastboot flash boot boot.img
./fastboot reboot

如果能正常開機,就congratulation!!!^v^

Android : 下載核心源碼 and 編譯、打包

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.