发 帖  
原厂入驻New
[资料] MY-RK3288-EK314 ANDROID5.1 编译手册
2018-5-29 10:49:56  1673 android 嵌入式 智能硬件 Linux
分享
安装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)

安装编译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

下载源码并解压源码(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/

编译源码(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-

$ ${CROSS_COMPILE}gcc -v

编译uboot(compile uboot)
  • 进入U-BOOT代码目录
enter U-BOOT code directory
$ cd ~/rk3288-myzr/u-boot/
  • 设置配置文件
set up configuration file
$ make rk3288_defconfig
  • 编译
compile
$ make

  • 目标文件
target file

编译kernel(compile kernetl)不同的显示屏类型对于不同的镜像,在下表中列出。
different display types for different images are listed in the following table.
评估板型号
(evaluation board model no.)
LCD
配置
(configuration)
MY-RK3288-EK314LVDS(1024X600)rk3288-myzr_rh568_lvds.img
HDMI(1920X1080)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

  • 设置配置文件
set up configuration file
$ make rk3288-myzr_defconfig

  • 编译(以LVDS为例)
compile(for example: LVDS)
$ make -j8 rk3288-myzr_rh568_lvds.img
说明:截图中使用了8线程编译。
instruction:8 threads compilation is used in the screenshots

  • 编译完成
complete compilation

  • 目标文件
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

编译android源码(compile android code)
  • 设置android环境变量
set android environment variables
$ cd ~/rk3288-myzr/
$ source build.sh

  • 设置android版本配置
set android version configuration
$ lunch rk3288_box-userdebug

  • 编译
compile
$ make -j16
说明:截图中使用了16线程编译。
instruction:16 threads compilation is used in the screenshots

  • 编译完成
complete compilation

  • 目标文件
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/


打包批量文件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/


新建文件夹和复制镜像(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:

$ mkdir -p rockdev/android/Image
$ cd rockdev/android/Image/
$ cp ~/rk3288-myzr/rockdev/Image-rk3288_box/* ./
$ rm pc*
$ $ ls


打包relase_android_update.img文件(pack relase_android_update.img)$ afptool -pack . ../update.img
$ img_maker -rk32 RKLoader.bin update.img relase_android_update.img

0
分享淘帖 显示全部楼层
· 2018-5-29 21:12:56
围观一下

评论

高级模式
您需要登录后才可以回帖 登录 | 注册

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容图片侵权或者其他问题,请联系本站作侵删。 侵权投诉
发资料
关闭

站长推荐 上一条 /7 下一条

快速回复 返回顶部 返回列表