其实是一段时间之前的事情了,当时这个坑先弃了,打算以后再填上的。趁着现在有空,做一些记录。

Host选择Ubuntu 14.04 + openjdk7,可以用docker:https://github.com/Tinker-S/docker-android-build

也可以自己配个vm

0x0 获取源码

Freescale imx.6 bsp 5.1: (Google Drive) IMX6_L5.1_2.1.0_AND_SOURCE_BSP.tar.gz

解压NXP 安卓bsp:

mkdir ~/kt3_ll_511_210
cd ~/kt3_ll_511_210
tar xvf ~/Downloads/IMX6_L5.1_2.1.0_AND_SOURCE_BSP.tar.gz
cd android_L5.1.1_2.1.0-ga_core_source/code/
tar xvf L5.1.1_2.1.0-ga.tar.gz

获取Android LL5.1.1 源码:

cd ~/kt3_ll_511_210
mkdir ll_511_210_build
cd ll_511_210_build
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#此处repo可以换成清华源提供的repo,下同
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1 
repo sync
cd ~/kt3_ll_511_210/ll_511_210_build/prebuilts/gcc/linux-x86/arm
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
cd arm-eabi-4.6
git checkout -b android-4.4.3_r1 android-4.4.3_r1

获取U-Boot和Linux kernel源码:

cd ~/kt3_ll_511_210/ll_511_210_build/bootable/bootloader
git clone https://github.com/MollySophia/imx6_android_u-boot_heisenberg.git uboot-imx

cd ~/kt3_ll_511_210/ll_511_210_build
git clone https://github.com/MollySophia/android_kernel_amazon_kindle.git -b kt3/3.10.53-lab126 kernel_imx

为拉取的aosp源码增加Freescale i.MX6支持(bsp patches):

cd ~/kt3_ll_511_210/ll_511_210_build
source  ../android_L5.1.1_2.1.0-ga_core_source/code/L5.1.1_2.1.0-ga/and_patch.sh
c_patch  ../android_L5.1.1_2.1.0-ga_core_source/code/L5.1.1_2.1.0-ga imx_L5.1.1_2.1.0-ga

至此,编译环境搭建成功。


0 条评论

发表评论

Avatar placeholder

您的电子邮箱地址不会被公开。