1??安裝ubuntu12.04
(如果使用下載明遠智睿的虛擬機,請直接跳到 下載源碼并解壓 這一節)
在這里建議用戶使用64bit的ubuntu12.04的操作系統,已經真機編譯驗證過。
2??安裝openjdk1.7
運行一下命令安裝openjdk1.7
sudo add-apt-repository "deb http://archive.canonical.com/lucid partner"
sudo apt-get update
sudo apt-get install openjdk-7-jdk
$ sudo gedit /etc/profile
增加以下環境變量
export JAVA_HOME=http://www.eechina.com/usr/lib/jvm/java-7-openjdk-amd64/
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib
JRE_HOME/lib
CLASSPATH
export PATH=$JAVA_HOME/bin
PATH
JRE_HOME/bin
$ source /etc/profile
$ java –version
(看到版本為1.7.0_101就表示成功)
3??安裝編譯Android系統所需要的庫
$ sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
$ sudo apt-get install uuid uuid-dev
$ sudo apt-get install zlib1g-dev liblz-dev
$ sudo apt-get install liblzo2-2 liblzo2-dev
$ sudo apt-get install lzop
$ sudo apt-get install git-core curl
$ sudo apt-get install u-boot-tools
$ sudo apt-get install mtd-utils
$ sudo apt-get install android-tools-fsutils
4??下載源碼并解壓源碼
4.1??下載源碼
登陸。Myzr。com.CN下載專區下載Android5.1源碼
Android5.1.1的分卷壓縮解壓后的源碼包:myzr_android-5.1.1.tar.bz2
4.2??解壓源碼
$ mkdir ~/myandroid5.1
$ cd ~
$ tar -jxvf myzr_android-5.1.1_r1.tar.bz2
4.3??編譯源碼(Android系統)
4.3.1??設置環境變量
$ export ARCH=arm
$ export CROSS_COMPILE=~/myandroid5.1/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
$ export PATH=~/myandroid5.1/bootable/bootloader/uboot-imx/tools
PATH
4.3.2??編譯uboot
$ cd ~/myandroid5.1/bootable/bootloader/uboot-imx
$ make distclean
$ make myimx6ek200-6q_android_defconfig (EK200-6Q-1G配置)
或 $ make myimx6ek200-6q-2g_android_defconfig (EK200-6Q-2G配置)
或 $ make myimx6ek200-6qp_android_defconfig (EK200-6QP-1G配置)
或 $ make myimx6ek200-6s-1g_android_defconfig (EK200-6S-1G配置)
或 $ make myimx6ek200-6u_android_defconfig (EK200-6U-1G配置)
或 $ make myimx6ek314-6q-2g_android_defconfig (EK314-6Q-2G配置)
或 $ make myimx6ek314-6q_android_defconfig (EK314-6Q-1G配置)
或 $ make myimx6ek314-6u_android_defconfig (EK314-6U-2G配置)
$ make
4.3.3??編譯kernel
$ cd ~/myandroid5.1/kernel_imx
$ cp myzr.config .config
$ make uImage LOADADDR=0x10008000
4.3.4??編譯bootimg (uImage和ramdisk)
$ cd ~/myandroid5.1
$ source build/envsetup.sh
$ lunch myimx6ek_6dq-user?
$ make bootimage
4.3.5??編譯system
$ cd ~/myandroid5.1
$ source build/envsetup.sh
$ lunch myimx6ek_6dq-user?
$ make
結果如下圖所示:
注意:生成的u-boot.imx在~/myandroid/bootable/bootloader/uboot-imx目錄下,boot.img和recovery.img和system.img在~/myandroid/out/target/product/myimx6ek_6dq目錄下。
5??啟動環境變量設置
5.1??單屏顯示
5.1.1??LVDS設置
setenv bootargs console=ttymxc0,115200 init=http://www.eechina.com/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1
ff video=mxcfb2
ff video=mxcfb3
ff vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M(不能用調試串口)
setenv bootargs console=ttymxc0,115200 init=http://www.eechina.com/init video=mxcfb0:dev=ldb,bpp=32
video=mxcfb1
ff video=mxcfb2
ff video=mxcfb3
ff vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled(可以用調試串口)
5.1.2??HDMI設置
setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=256M init=http://www.eechina.com/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1
ff video=mxcfb2
ff video=mxcfb3
ff androidboot.hardware=freescale cma=384M
(不能用調試串口)
setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=256M init=http://www.eechina.com/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1
ff video=mxcfb2:off video=mxcfb3:off androidboot.hardware=freescale cma=384M
androidboot.selinux=disabled androidboot.dm_verity=disabled(可以用調試串口)
5.2??雙屏顯示
5.2.1??LVDS+HDMI設置
setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=256M init=http://www.eechina.com/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:dev=hdmi,
1920x1080M@60,bpp=32 video=mxcfb2:off video=mxcfb3:off androidboot.hardware=freescale cma=384M (不能用調試串口)
setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=256M init=http://www.eechina.com/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb2:off video=mxcfb3:off androidboot.hardware=freescale cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled (可以用調試串口)
?
評論
查看更多