android源碼編譯到刷機過程2

來源:互聯網
上載者:User

標籤:檔案夾   sudo   print   nal   epo   ntc   global   make   org   

0,vbox掛載共用
sudo mount -t vboxsf H /mnt/H/
1,安裝系統
配置:
記憶體 12G
cpu16個,峰值 95%
硬碟200G
分區:自動分區

2,配置環境,下載源碼
sudo apt-get update

sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip

sudo apt-get install openjdk-7-jdk

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

git config --global user.name "fbb"
git config --global user.email "[email protected]"


M4B30Zandroid-6.0.1_r77MarshmallowNexus 5

mkdir android-6.0.1_r77
cd android-6.0.1_r77

## 如果提示無法串連到 gerrit.googlesource.com,可以編輯 ~/bin/repo,把 REPO_URL 一行替換成下面的:
## REPO_URL = ‘https://gerrit-googlesource.proxy.ustclug.org/git-repo‘

//google地址下載困難用,清華的鏡像。
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-6.0.1_r77

repo sync -j4


3,(參考)下載nexus 5 的硬體驅動:
關鍵字:編譯android 刷到nexus 5
https://developers.google.com/android/drivers
Nexus 5 (GSM/LTE) ("hammerhead")
Nexus 5 (GSM/LTE) binaries for Android 6.0.1 (MMB29S)
/*
Nexus 5 (GSM/LTE) binaries for Android 6.0.1 (MMB29S)
Hardware Component Company Download SHA-256 Checksum
NFC, Bluetooth, Wi-Fi Broadcom Link 57e056be0925ab0800d5e07b06849322d9a8d3e9e00f0fe1ecebad0387d3f1f1
Camera, Sensors, Audio LG Link 3a8f970fc13330ea54573f2c9002a1071dae56eae5337aa2220efa213b810164
Graphics, GSM, Camera, GPS, Sensors, Media, DSP, USB Qualcomm Link add1a3008faf2a68b44851e7ab193fb5b2e488dd4a92ec0c6b7d391576312a23
*/
過程:
根據連結下載 三個 tgz的檔案,
解壓後是sh檔案放到源碼的跟目錄,
執行sh檔案,會在源碼根目錄下生存vendor檔案夾。
命令:
mkdir drivers
curl https://dl.google.com/dl/android/aosp/broadcom-hammerhead-mmb29s-3a3c03c6.tgz > ~/drivers/broadcom-hammerhead-mmb29s-3a3c03c6.tgz
curl https://dl.google.com/dl/android/aosp/lge-hammerhead-mmb29s-fa0209c9.tgz > ~/drivers/lge-hammerhead-mmb29s-fa0209c9.tgz
curl https://dl.google.com/dl/android/aosp/qcom-hammerhead-mmb29s-bd184be4.tgz > ~/drivers/qcom-hammerhead-mmb29s-bd184be4.tgz

tar -zxf broadcom-hammerhead-mmb29s-3a3c03c6.tgz
tar -zxf lge-hammerhead-mmb29s-fa0209c9.tgz
tar -zxf qcom-hammerhead-mmb29s-bd184be4.tgz

cp ~/drivers/extract-broadcom-hammerhead.sh ~/android-4.4.4_r1/extract-broadcom-hammerhead.sh
cp ~/drivers/extract-lge-hammerhead.sh ~/android-4.4.4_r1/extract-lge-hammerhead.sh
cp ~/drivers/extract-qcom-hammerhead.sh ~/android-4.4.4_r1/extract-qcom-hammerhead.sh

./extract-broadcom-hammerhead.sh
./extract-lge-hammerhead.sh
./extract-qcom-hammerhead.sh
################################################################
打包:tar -cf /mnt/H/android-6.0.1_r77.tar android-6.0.1_r77
################################################################

4,編譯android源碼
make clobber
source build/envsetup.sh
lunch
輸入:19
選擇的:
19. aosp_hammerhead-userdebug
make -j16

lunch aosp_hammerhead-user

TARGET_BUILD_VARIANT=user

 

 


choosecombo release msm8974 user


function choosecombo()
{
choosetype $1
echo
echo
chooseproduct $2
echo
echo
choosevariant $3
echo
set_stuff_for_environment
printconfig

choosevariant


choosevariant

 

 

user版本需要先開啟USB debug開關,開啟檔案如下:
1、開啟usb調試 build/core/main.mk
請將user版本下也改為ro.debuggable = 1

ifeq (true,(strip(enable_target_debugging)))
# Target is more debuggable and adbd is on by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
# Include the debugging/testing OTA keys in this build.
INCLUDE_TEST_OTA_KEYS := true
else # !enable_target_debugging
# Target is less debuggable and adbd is off by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 //這邊改成1
endif # !enable_target_debugging

語言:
/home/fbb/android-6.0.1_r77/build/target/product/languages_full.mk

android源碼編譯到刷機過程2

相關文章

聯繫我們

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