MYZR-RK3288-EK314 ANDROID5.1 编译手册

来自明远智睿的wiki
Admin讨论 | 贡献2018年5月10日 (四) 10:44的版本 (创建页面,内容为“=安装ubuntu12.04(install ubuntu12.04)= (如果使用下载明远智睿的虚拟机,请直接跳到 下载源码并解压 这一节)<br> <span style="background:#...”)

跳转至: 导航搜索

安装ubuntu12.04(install ubuntu12.04)

(如果使用下载明远智睿的虚拟机,请直接跳到 下载源码并解压 这一节)
(if virtual machine downloaded from MYZR is going to be used,please skip to the section"download source code and decompress"
在这里建议用户使用64bit的ubuntu12.04的操作系统,已经真机编译验证过。
here it is recommended to users to use operating system of 64bit ubuntu12.04 of which has been proven in compilation by real machine

安装openjdk1.7(install openjdk1.7)

运行一下命令安装openjdk1.7
execute command to install 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
增加以下环境变量
add the following environment variables
export JAVA_HOME=/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_121就表示成功)
(when version 1.7.0_121 is seen,which represent a success)
My-rk32-ek314 android 2.1.1.png

安装编译Android系统所需要的库(install libraries needed to compile Android system)

(详细信息,请看网站http://source.android.com/source/initializing.html)
( for detailed information, please visit http://source.android.com/source/initializing.html))

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 \
g++-multilib mingw32 tofrodos gcc-multilib ia32-libs \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386 \
lzop libssl1.0.0 libssl-dev
My-rk32-ek314 android 3.1.1.png

下载源码并解压源码(download source code and decompress)

下载源码(download source code)

登陆http://www.myzr.com.cn下载专区下载Android5.1源码
login downloads in http://www.myzr.com.cn to download source code of Android5.1
Android5.1.1的分卷压缩解压后的源码包:rk32-myzr_android5.1_20180328.tar.bz2
source code package of Android5.1 sub-volume compression decompressed is :

解压源码(decompress source code)

$ mkdir ~/rk3288-myzr
$ tar jxvf rk32-myzr_android5.1_20180328.tar.bz2 -C ~/rk3288-myzr/
My-rk32-ek314 android 5.1.1.png

编译源码(Android系统)(compile source code(Android system))

设置环境变量(set environment variables)

$ export ARCH=arm
$ export CROSS_COMPILE=~/rk3288-myzr/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
My-rk32-ek314 android 6.1.1.png
$ ${CROSS_COMPILE}gcc -v
My-rk32-ek314 android 6.1.2.png

编译uboot(compile uboot)

  • 进入U-BOOT代码目录

enter U-BOOT code directory
$ cd ~/rk3288-myzr/u-boot/

  • 设置配置文件

set up configuration file
$ make rk3288_defconfig

  • 编译

compile
$ make
My-rk32-ek314 android 6.2.1.png

  • 目标文件

target file
My-rk32-ek314 android 6.2.2.png

编译kernel(compile kernetl)

不同的显示屏类型对于不同的镜像,在下表中列出。
different display types for different images are listed in the following table.

评估板型号
(evaluation board model no.)
LCD
配置
(configuration)
MY-RK3288-EK314
LVDS(1024X600) <thead> </thead> <tbody> </tbody>
rk3288-myzr_rh568_lvds.img
HDMI(1920X1080) <thead> </thead> <tbody> </tbody>
rk3288-myzr_rh568_hdmi.img
EDP(1920X1080) rk3288-myzr_rh568_edp.img
  • 进入内核代码目录

enter kernel code directory
$ cd ~/rk3288-myzr/kernel/

  • 清除内核配置

clear kernel configuration
$ make distclean
My-rk32-ek314 android 6.3.1.png

  • 设置配置文件

set up configuration file
$ make rk3288-myzr_defconfig
My-rk32-ek314 android 6.3.2.png

  • 编译(以LVDS为例)

compile(for example: LVDS)
$ make -j8 rk3288-myzr_rh568_lvds.img
说明:截图中使用了8线程编译。
instruction:8 threads compilation is used in the screenshots
My-rk32-ek314 android 6.3.3.png

  • 编译完成

complete compilation
My-rk32-ek314 android 6.3.4.png

  • 目标文件

target file
kernel.img和resource.img即为编译得到的目标文件,使用ls命令可查看文件信息。
Kernel.img and resource.img are the compiled target files. Use the ls command to view the file information.
$ ls
My-rk32-ek314 android 6.3.5.png

编译android源码(compile android code)

  • 设置android环境变量

set android environment variables
$ cd ~/rk3288-myzr/
$ source build.sh
My-rk32-ek314 android 6.4.1.png

  • 设置android版本配置

set android version configuration
$ lunch rk3288_box-userdebug
My-rk32-ek314 android 6.4.2.png

  • 编译

compile
$ make -j16
说明:截图中使用了16线程编译。
instruction:16 threads compilation is used in the screenshots
My-rk32-ek314 android 6.4.3.png

  • 编译完成

complete compilation
My-rk32-ek314 android 6.4.4.png

  • 目标文件

target file
boot.img,misc.img,kernel.img,resource.img,recovery.img,system.img即为编译得到的目标文件,使用ls命令可查看文件信息。
boot.img,misc.img,kernel.img,resource.img,recovery.img,system.img are the compiled target files. Use the ls command to view the file information.
$ ./mkimage.sh
$ ls rockdev/Image-rk3288_box/
My-rk32-ek314 android 6.4.5.png

打包批量文件relase_android_update.img(pack relase_android_update.img)

编译打包工具(compile packaging tools)

注意:如果编译了rk2918_tools.tar.bz2,就不需要重新编译了,可以跳过这个步骤。
Note: If you have compiled rk2918_tools.tar.bz2, you do not need to recompile. You can skip this step.
默认复制rk2918_tools.tar.bz2到目录~/rk3288-myzr/rockdev下
copy rk2918_tools.tar.bz2 to directory ~/rk3288-myzr/rockdev by default
$ cd ~/rk3288-myzr/rockdev
$ tar jxf rk2918_tools.tar.bz2
$ cd rk2918_tools/
$ make -j4
$ sudo cp afptool img_unpack img_maker mkkrnlimg /usr/local/bin/
My-rk32-ek314build 7.1.1.jpg

新建文件夹和复制镜像(new folder and copy image)

rockdev/Image-rk3288_box/的文件对应烧写工具Image\android文件夹中,rk3288box-3.10-uboot-ubuntu.parameter.txt重命名为parameter,RK3288UbootLoader_V2.30.10.bin对应RKLoader.bin,update-script和recover-script在烧写工具里面复制。package-file的内容重新按对应的文件重命名,如下:
The file of "rockdev/Image-rk3288_box/" corresponds to the file of "Image\android", rk3288box-3.10-uboot-android.parameter.txt is renamed to parameter, RK3288UbootLoader_V2.30.10.bin corresponds to RKLoader.bin, update-script and The recover-script is copied by the burning tool. The contents of the package-file are renamed according to the corresponding file, as follows:
My-rk32-ek314 android 7.1.1.png

$ mkdir -p rockdev/android/Image
$ cd rockdev/android/Image/
$ cp ~/rk3288-myzr/rockdev/Image-rk3288_box/* ./
$ rm pc*
$ $ ls
My-rk32-ek314 android 7.1.2.png

打包relase_android_update.img文件(pack relase_android_update.img)

$ afptool -pack . ../update.img
$ img_maker -rk32 RKLoader.bin update.img relase_android_update.img
My-rk32-ek314 android 7.1.3.png