“MYZR-I.MX6-DEMO Android4.4.2环境搭建”的版本间的差异

来自明远智睿的wiki
跳转至: 导航搜索
(创建页面,内容为“=安装ubuntu12.04= (如果使用下载明远智睿的虚拟机,请直接跳到 下载源码并解压 这一节)<br> 在这里建议用户使用64bit的ubuntu12.04...”)
 
第1行: 第1行:
=安装ubuntu12.04=
+
=安装ubuntu12.04(install ubuntu12.04)=
 
(如果使用下载明远智睿的虚拟机,请直接跳到 下载源码并解压 这一节)<br>
 
(如果使用下载明远智睿的虚拟机,请直接跳到 下载源码并解压 这一节)<br>
 +
<span style="background:#CCCCCC">(if virtual machine downloaded from MYZR is going to be used,please skip to the section"download source code and decompress"</span><br>
 
在这里建议用户使用64bit的ubuntu12.04的操作系统,已经真机编译验证过。<br>
 
在这里建议用户使用64bit的ubuntu12.04的操作系统,已经真机编译验证过。<br>
=安装JDK1.6 SE=
+
<span style="background:#CCCCCC">here it is recommended to users to use operating system of 64bit ubuntu12.04 of which has been proven in compilation by real machine</span><br>
 +
 
 +
=安装JDK1.6 SE(install JDK1.6 SE)=
 
登陆[http://http://www.myzr.com.cn http://www.myzr.com.cn]的下载专区,下载jdk-6u45-linux-x64.bin文件<br>
 
登陆[http://http://www.myzr.com.cn http://www.myzr.com.cn]的下载专区,下载jdk-6u45-linux-x64.bin文件<br>
 +
<span style="background:#CCCCCC">login in downloads of http://www.myzr.com.cn, to download jdk-6u45-linux-x64.bin</span><br>
 
$ cd /usr<br>
 
$ cd /usr<br>
 
$ sudo mkdir java<br>
 
$ sudo mkdir java<br>
第12行: 第16行:
 
$ sudo gedit /etc/profile<br>
 
$ sudo gedit /etc/profile<br>
 
增加以下环境变量<br>
 
增加以下环境变量<br>
 +
<span style="background:#CCCCCC">add the following environment variables</span><br>
 
export JAVA_HOME=/usr/java/jdk1.6.0_45<br>
 
export JAVA_HOME=/usr/java/jdk1.6.0_45<br>
 
export JRE_HOME=$JAVA_HOME/jre<br>
 
export JRE_HOME=$JAVA_HOME/jre<br>
第19行: 第24行:
 
$ java –version<br>
 
$ java –version<br>
 
(看到版本为1.6.0_45就表示成功)<br>
 
(看到版本为1.6.0_45就表示成功)<br>
=安装编译Android系统所需要的库=
+
<span style="background:#CCCCCC">(when version 1.6.0_45 is seen,which represent a success)</span><br>
(详细信息,请看网站[http://source.android.com/source/initializing.html http://source.android.com/source/initializing.html]<br>
+
 
 +
=安装编译Android系统所需要的库(install libraries needed to compile Android system)=
 +
(详细信息,请看网站[http://source.android.com/source/initializing.html  
 +
http://source.android.com/source/initializing.html]<br>
 +
<span style="background:#CCCCCC">for detailed information, please visit [http://source.android.com/source/initializing.html
 +
http://source.android.com/source/initializing.html]</span><br>
 
$ 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<br>
 
$ 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<br>
 
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so<br>
 
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so<br>
第29行: 第39行:
 
$ sudo apt-get update<br>
 
$ sudo apt-get update<br>
 
$ sudo apt-get install git-core curl<br>
 
$ sudo apt-get install git-core curl<br>
=下载源码并解压源码=
+
 
==下载源码==
+
=下载源码并解压源码(download source code and decompress)=
 +
==下载源码(download source code)==
 
登陆[http://http://www.myzr.com.cn http://www.myzr.com.cn]=下载专区下载Android4.2源码<br>
 
登陆[http://http://www.myzr.com.cn http://www.myzr.com.cn]=下载专区下载Android4.2源码<br>
 +
<span style="background:#CCCCCC">login downloads in http://www.myzr.com.cn to download source code of Android4.2</span><br>
 
Android4.4的分卷压缩解压后的源码包:myzr_android-4.4.2_r1.tar.bz2<br>
 
Android4.4的分卷压缩解压后的源码包:myzr_android-4.4.2_r1.tar.bz2<br>
==解压源码==
+
<span style="background:#CCCCCC">source code package of Android4.4 sub-volume compression decompressed is :</span><br>
 +
 
 +
==解压源码(decompress source code)==
 
$ mkdir ~/myandroid<br>
 
$ mkdir ~/myandroid<br>
 
$ cd ~<br>
 
$ cd ~<br>
 
$ tar -jxvf myzr_android-4.4.2_r1.tar.bz2 –C ~/myandroid<br>
 
$ tar -jxvf myzr_android-4.4.2_r1.tar.bz2 –C ~/myandroid<br>
==编译源码(Android系统)==
+
 
===设置环境变量===
+
==编译源码(Android系统)(compile source code(Android system))==
 +
===设置环境变量(set environment variables)===
 
$ export ARCH=arm<br>
 
$ export ARCH=arm<br>
 
$ export CROSS_COMPILE=~/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
 
$ 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<br>
 
$ export PATH=~/myandroid/bootable/bootloader/uboot-imx/tools:$PATH<br>
===编译uboot===
+
 
 +
===编译uboot(compile uboot)===
 
$ cd ~/myandroid/bootable/bootloader/uboot-imx<br>
 
$ cd ~/myandroid/bootable/bootloader/uboot-imx<br>
 
$ make distclean<br>
 
$ make distclean<br>
 
$ make mx6q_sabresd_android_config (四核配置)<br>
 
$ make mx6q_sabresd_android_config (四核配置)<br>
 +
<span style="background:#CCCCCC">$ make mx6q_sabresd_android_config (quadruple core configuration)</span><br>
 
或 $ make mx6dl_sabresd_android_config (双核简化配置)<br>
 
或 $ make mx6dl_sabresd_android_config (双核简化配置)<br>
 +
<span style="background:#CCCCCC">or $ make mx6dl_sabresd_android_config (dual core tile configuration)</span><br>
 
或 $ make mx6solo_sabresd_android_config (单核配置)<br>
 
或 $ make mx6solo_sabresd_android_config (单核配置)<br>
 +
<span style="background:#CCCCCC">or $ make mx6solo_sabresd_android_config (single core configuration)</span><br>
 
$ make<br>
 
$ make<br>
===编译kernel===
+
 
 +
===编译kernel(compile kernel)===
 
$ cd ~/myandroid/kernel_imx<br>
 
$ cd ~/myandroid/kernel_imx<br>
 
$ make imx6_android_defconfig<br>
 
$ make imx6_android_defconfig<br>
 
$ make uImage<br>
 
$ make uImage<br>
===编译bootimg (uImagel和ramdisk)===
+
 
 +
===编译bootimg (uImagel和ramdisk)(compile bootimg (uImagel and ramdisk))===
 
$ cd ~/myandroid<br>
 
$ cd ~/myandroid<br>
 
$ source build/envsetup.sh<br>
 
$ source build/envsetup.sh<br>
 
$ lunch sabresd_6dq-user (此为发布版本,调试版本改成lunch sabresd_6dq-eng)<br>
 
$ lunch sabresd_6dq-user (此为发布版本,调试版本改成lunch sabresd_6dq-eng)<br>
 +
<span style="background:#CCCCCC">lunch sabresd_6dq-user (this is release version,debug version is changed to be lunch sabresd_6dq-eng)</span><br>
 
$ make bootimage<br>
 
$ make bootimage<br>
===编译system===
+
 
 +
===编译system(compile system)===
 
$ cd ~/myandroid<br>
 
$ cd ~/myandroid<br>
 
$ source build/envsetup.sh<br>
 
$ source build/envsetup.sh<br>
 
$ lunch sabresd_6dq-user (此为发布版本,调试版本改成lunch sabresd_6dq-eng)<br>
 
$ lunch sabresd_6dq-user (此为发布版本,调试版本改成lunch sabresd_6dq-eng)<br>
 +
<span style="background:#CCCCCC">$ lunch sabresd_6dq-user (this is release version,debug version is changed to be lunch sabresd_6dq-eng)</span><br>
 
$ make<br>
 
$ make<br>
  
  
 
注意:生成的u-boot.bin在~/myandroid/bootable/bootloader/uboot-imx目录下,boot.img和recovery.img和system.img在~/myandroid/out/target/product/sabresd_6dq目录下。<br>
 
注意:生成的u-boot.bin在~/myandroid/bootable/bootloader/uboot-imx目录下,boot.img和recovery.img和system.img在~/myandroid/out/target/product/sabresd_6dq目录下。<br>
 +
<span style="background:#CCCCCC">note: u-boot.bin generated is in the directory of ~/myandroid/bootable/bootloader/uboot-imx,boot.img and recovery.img and system.img are in the directory of ~/myandroid/out/target/product/sabresd_6dq</span><br>

2017年6月26日 (一) 17:07的版本

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

安装JDK1.6 SE(install JDK1.6 SE)

登陆http://www.myzr.com.cn的下载专区,下载jdk-6u45-linux-x64.bin文件
login in downloads of http://www.myzr.com.cn, to download jdk-6u45-linux-x64.bin
$ cd /usr
$ sudo mkdir java
$ cd java
$ sudo cp ~ /jdk-6u45-linux-x64.bin ./
$ sudo chmod 777 ./jdk-6u45-linux-x64.bin
$ sudo ./jdk-6u45-linux-x64.bin
$ sudo gedit /etc/profile
增加以下环境变量
add the following environment variables
export JAVA_HOME=/usr/java/jdk1.6.0_45
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.6.0_45就表示成功)
(when version 1.6.0_45 is seen,which represent a success)

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

(详细信息,请看网站[http://source.android.com/source/initializing.html http://source.android.com/source/initializing.html]
for detailed information, please visit [http://source.android.com/source/initializing.html 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 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 add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git-core curl

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

下载源码(download source code)

登陆http://www.myzr.com.cn=下载专区下载Android4.2源码
login downloads in http://www.myzr.com.cn to download source code of Android4.2
Android4.4的分卷压缩解压后的源码包:myzr_android-4.4.2_r1.tar.bz2
source code package of Android4.4 sub-volume compression decompressed is :

解压源码(decompress source code)

$ mkdir ~/myandroid
$ cd ~
$ tar -jxvf myzr_android-4.4.2_r1.tar.bz2 –C ~/myandroid

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

设置环境变量(set environment variables)

$ 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

编译uboot(compile uboot)

$ cd ~/myandroid/bootable/bootloader/uboot-imx
$ make distclean
$ make mx6q_sabresd_android_config (四核配置)
$ make mx6q_sabresd_android_config (quadruple core configuration)
或 $ make mx6dl_sabresd_android_config (双核简化配置)
or $ make mx6dl_sabresd_android_config (dual core tile configuration)
或 $ make mx6solo_sabresd_android_config (单核配置)
or $ make mx6solo_sabresd_android_config (single core configuration)
$ make

编译kernel(compile kernel)

$ cd ~/myandroid/kernel_imx
$ make imx6_android_defconfig
$ make uImage

编译bootimg (uImagel和ramdisk)(compile bootimg (uImagel and ramdisk))

$ cd ~/myandroid
$ source build/envsetup.sh
$ lunch sabresd_6dq-user (此为发布版本,调试版本改成lunch sabresd_6dq-eng)
lunch sabresd_6dq-user (this is release version,debug version is changed to be lunch sabresd_6dq-eng)
$ make bootimage

编译system(compile system)

$ cd ~/myandroid
$ source build/envsetup.sh
$ lunch sabresd_6dq-user (此为发布版本,调试版本改成lunch sabresd_6dq-eng)
$ lunch sabresd_6dq-user (this is release version,debug version is changed to be lunch sabresd_6dq-eng)
$ make

注意:生成的u-boot.bin在~/myandroid/bootable/bootloader/uboot-imx目录下,boot.img和recovery.img和system.img在~/myandroid/out/target/product/sabresd_6dq目录下。
note: u-boot.bin generated is in the directory of ~/myandroid/bootable/bootloader/uboot-imx,boot.img and recovery.img and system.img are in the directory of ~/myandroid/out/target/product/sabresd_6dq