I.MX6 Android 5.1.1 下载、编译

/*************************************************************************
 *                 I.MX6 Android 5.1.1 下载、编译
 * 说明:
 *     这里要提到的就是4.2版本,编译中断了,你接着编好像是没事的,但是这个
 * 5.1.1版本貌似就得从头再编,这个有点郁闷。
 *
 *                                     2016-9-9 深圳 南山平山村 曾剑锋
 ************************************************************************/

一、购买VPN(为什么要买VPN?因为要去和Google打交道):
    https://www.expressvpn.xyz

二、下载参考文档:
    http://www.nxp.com/zh-Hans/products/microcontrollers-and-processors/arm-processors/i.mx-applications-processors/i.mx-6-processors/i.mx6qp/i.mx-6duallite-processors-dual-core-3d-graphics-hd-video-arm-cortex-a9-core:i.MX6DL?fpsp=1&tab=Documentation_Tab

三、下载补丁包:
    http://www.nxp.com/zh-Hans/products/software-and-tools/hardware-development-tools/sabre-development-system/sabre-platform-for-smart-devices-based-on-the-i.mx-6-series:RDIMX6SABREPLAT?fpsp=1&tab=Design_Tools_Tab

四、安装lib依赖:
    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 uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev lzop git-core curl u-boot-tools mtd-utils android-tools-fsutils

五、安装JDK:
    sudo apt-get install openjdk-7-jdk

六、下载Android源代码:
    $ cd ~
    $ mkdir myandroid
    $ mkdir bin
    $ cd myandroid
    $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    $ ~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1
    $ ~/bin/repo sync # this command loads most needed repos. Therefore, it can take several hours to load.
    $ cd ~/myandroid/prebuilts/gcc/linux-x86/arm
    $ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/armeabi-4.6
    $ cd arm-eabi-4.6
    $ git checkout android-4.4.3_r1

七、下载kernel:
    $ cd ~/myandroid
    $ git clone git://git.freescale.com/imx/linux-2.6-imx.git kernel_imx # the kernel repo is large. Therefore, this process can take a while.
    $ cd kernel_imx
    $ git checkout l5.1.1_2.1.0-ga

八、下载u-boot:
    $ cd ~/myandroid/bootable
    $ cd bootloader
    $ git clone git://git.freescale.com/imx/uboot-imx.git uboot-imx
    $ cd uboot-imx
    $ git checkout l5.1.1_2.1.0-ga

九、在home目录解压补丁包:
    1. tar xvf IMX6_L5.1_2.1.0_AND_SOURCE_BSP.tar.gz
    2. cd android_L5.1.1_2.1.0-ga_core_source/code/
    3. tar xvf L5.1.1_2.1.0-ga.tar.gz
    4. source ~/android_L5.1.1_2.1.0-ga_core_source/code/L5.1.1_2.1.0-ga/and_patch.sh

十、开始打补丁,出现warning:
    $ 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
    ......
    Applying patch to hardware/broadcom/libbt
    /home/zengjf/myandroid/hardware/broadcom/libbt/.git/rebase-apply/patch:42: new blank line at EOF.
    +
    warning: 1 line adds whitespace errors.
    /home/zengjf/myandroid/hardware/broadcom/libbt/.git/rebase-apply/patch:41: new blank line at EOF.
    +
    warning: 1 line adds whitespace errors.
    /home/zengjf/myandroid/hardware/broadcom/libbt/.git/rebase-apply/patch:26: new blank line at EOF.
    +
    warning: 1 line adds whitespace errors.
    Applying patch to hardware/broadcom/wlan
    Applying patch to packages/wallpapers/MusicVisualization
    Applying patch to external/aac
    Applying patch to external/tremolo
    Applying patch to external/libpng
    Applying patch to external/sonivox
    Applying patch to packages/apps/DeskClock
    *************************************************************
    Success: Now you can build android code for FSL i.MX platform
    *************************************************************

十一、编译:
    1. export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
    2. cd ~/myandroid
    3. source build/envsetup.sh
    4. lunch sabresd_6dq-user
    5. make 2>&1 | tee build-log.txt

十二、编译完成最后输出信息:
    ......
    host C: libbz_32 <= external/bzip2/compress.c
    host C: libbz_32 <= external/bzip2/decompress.c
    host C: libbz_32 <= external/bzip2/bzlib.c
    host StaticLib: libbz_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libbz_intermediates/libbz.a)
    Export includes file: bootable/recovery/applypatch/Android.mk -- out/host/linux-x86/obj32/EXECUTABLES/imgdiff_intermediates/export_includes
    host Executable: imgdiff (out/host/linux-x86/obj32/EXECUTABLES/imgdiff_intermediates/imgdiff)
    Notice file: bootable/recovery/applypatch/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//bin/imgdiff.txt
    Notice file: external/bzip2/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//lib/libbz.a.txt
    Install: out/host/linux-x86/bin/imgdiff
    Import includes file: out/host/linux-x86/obj32/EXECUTABLES/bsdiff_intermediates/import_includes
    host C: bsdiff <= external/bsdiff/bsdiff.c
    external/bsdiff/bsdiff.c: In function 'main':
    external/bsdiff/bsdiff.c:196:5: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized]
    Export includes file: external/bsdiff/Android.mk -- out/host/linux-x86/obj32/EXECUTABLES/bsdiff_intermediates/export_includes
    host Executable: bsdiff (out/host/linux-x86/obj32/EXECUTABLES/bsdiff_intermediates/bsdiff)
    Install: out/host/linux-x86/bin/bsdiff
    Construct recovery from boot
    mkdir -p out/target/product/sabresd_6dq/obj/PACKAGING/recovery_patch_intermediates/
    PATH=out/host/linux-x86/bin:$PATH out/host/linux-x86/bin/imgdiff out/target/product/sabresd_6dq/boot.img out/target/product/sabresd_6dq/recovery.img out/target/product/sabresd_6dq/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p
    chunk 0: type 0 start 0 len 7274506
    chunk 1: type 2 start 7274506 len 1480704
    chunk 2: type 0 start 8142159 len 49112
    Construct patches for 3 chunks...
    patch   0 is 205 bytes (of 7274506)
    patch   1 is 435259 bytes (of 867653)
    patch   2 is 594 bytes (of 49112)
    chunk   0: normal   (         0,    7274506)         205
    chunk   1: deflate  (   7274506,    1476108)      435259  (null)
    chunk   2: normal   (   8750614,      48918)         594
    Install system fs image: out/target/product/sabresd_6dq/system.img
    out/target/product/sabresd_6dq/system.img+out/target/product/sabresd_6dq/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p maxsize=385389312 blocksize=4224 total=318349634 reserve=3894528

    #### make completed successfully (07:51:40 (hh:mm:ss)) ####

    zengjf@zengjf:~/myandroid$ 

十三、磁盘空间占用情况:
    zengjf@zengjf:~/myandroid$ df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda1        97G   87G  5.2G  95% /
    none            4.0K     0  4.0K   0% /sys/fs/cgroup
    udev            2.0G  4.0K  2.0G   1% /dev
    tmpfs           395M  1.1M  394M   1% /run
    none            5.0M     0  5.0M   0% /run/lock
    none            2.0G  152K  2.0G   1% /run/shm
    none            100M   52K  100M   1% /run/user
    zengjf@zengjf:~/myandroid$ 

十四、u-boot编译:
    1. 环境变量:
        1. export ARCH=arm
        2. export CROSS_COMPILE=~/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
    2. 编译:
        1. make mx6dlsabresdandroid_config
        2. make

十五、kernel编译:
    1. 环境变量:
        1. export PATH=~/myandroid/bootable/bootloader/uboot-imx/tools:$PATH
        2. export ARCH=arm
        3. export CROSS_COMPILE=~/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
    2. 编译:
        1. make imx_v7_android_defconfig
        2. make uImage LOADADDR=0x10008000

十六、boot.img编译:
    1. cd ~/myandroid
    2. source build/envsetup.sh
    3. lunch sabresd_6dq-user
    4. make bootimage

十七、.bashrc环境变量
    ......
    export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
    export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
    export ARCH=arm
    export CROSS_COMPILE=~/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
    export PATH=~/myandroid/bootable/bootloader/uboot-imx/tools:$PATH

    export out=~/myandroid/out/target/product/sabresd_6dq
    export uboot=~/myandroid/bootable/bootloader/uboot-imx
    export kernel=~/myandroid/kernel_imx
    export win=/mnt/hgfs/ftp_root
    ......

 

时间: 2024-10-24 10:08:20

I.MX6 Android 5.1.1 下载、编译的相关文章

WebRTC 国内不翻墙下载编译Linux\Android版,已下23G【未完成版】

WebRTC 国内不翻墙下载编译Linux\Android版,已下23G[未完成版] mkdir /webrtccd /webrtcgit clone https://source.codeaurora.org/quic/lc/chromium/tools/depot_tools.gitexport PATH=`pwd`/depot_tools:"$PATH"cd depot_tools 下载webrtc fetch过的Android版(http://pan.baidu.com/s/1

I.MX6 android 4.2 源码下载

/************************************************************************* * I.MX6 android 4.2 源码下载 * 说明: * NXP官网已经不提供4.2版本的源码下载了,目前这个地方还能下载. * * 2016-8-24 深圳 南山平山村 曾剑锋 ************************************************************************/ 一.参考文档:

I.MX6 Android 5.1 纯Linux、U-Boot编译

/***************************************************************************** * I.MX6 Android 5.1 纯Linux.U-Boot编译 * 说明: * 单纯编译一下Linux内核和U-Boot这部分代码,用于测试用. * * 2017-5-12 台湾 中和区 曾剑锋 *********************************************************************

Android源码 在Ubuntu上下载,编译和安装

看完了前面说的几本书之后,对Linux Kernel和Android有一定的认识了,是不是心里蠢蠢欲动,想小试牛刀自己编译一把Android源代码了呢?一直习惯使用Windows系统,而Android源代码是不支持在Windows上编译上,于是决定使用虚拟机安装Ubuntu,然后下载.编译和安装Android源代码. 一. 环境准备. 1. 磁盘空间预留20G左右,内存3G,因为一边要跑主机,一边要跑虚拟机,内存要求还是比较高的,这样才会比较流畅. 2. 安装VMWare 7.1.4.我的操作系

Android内核源码 在Ubuntu上下载,编译,安装

从源代码树下载下来的最新Android源代码,是不包括内核代码的,也就是Android源代码工程默认不包含Linux Kernel代码,而是使用预先编译好的内核,也就是prebuilt/android-arm/kernel/kernel-qemu文件.那么,如何才能DIY自己的内核呢?这篇文章一一道来. 一. 首选,参照前一篇在Android源码 在Ubuntu上下载,编译和安装准备好Android源代码目录. 二. 下载Linux Kernel for Android源代码. 1. 使用GIT

webrtc所有平台下载编译步骤详细说明

webrtc所有平台下载编译步骤详细说明   1.安装depot tools Windows:国外下载:https://storage.googleapis.com/chrome-infra/depot_tools.zip下载完把压缩包解压,然后把解压目录加入PATH环境变量Linux(Android)/Mac(iOS):安装Git国外:git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git国内:git

Android编程之防止反编译的实现方法_Android

本文实例讲述了Android编程之防止反编译的实现方法.分享给大家供大家参考,具体如下: 1. 判断程序是否运行在模拟器上 boolean isRunningInEmualtor() { boolean qemuKernel = false; Process process = null; DataOutputStream os = null; try{ process = Runtime.getRuntime().exec("getprop ro.kernel.qemu"); os

三星Galaxy S4原生Android 4.3 ROM下载

&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;   在昨天已经有国外媒体送上了原生版Galaxy S4的系统截图,运行的是最新版Android 4.3系统,其版本号为JWR66N.S005.130625,同时消息还称,目前不少手机制造商都在内测Android 4.3.目前原生版Galaxy S4的Android 4.3系统已经被泄露了出来,经过国外大神的验证,它能够在国际版的GT-I9505(骁龙600版Gala

I.MX6 Android stlport 使用

/****************************************************************** * I.MX6 Android stlport 使用 * 说明: * 在移植JNI过程中使用了C++ stlport lib,而在Android源码中编译 * 和在NDK中使用,其配置方式是不一样. * * 2016-8-11 深圳 南山平山村 曾剑锋 *******************************************************