穿prada的008的个人空间 https://www.eechina.com/space-uid-108322.html [收藏] [复制] [RSS]

博客

Rayeager PX2开发板Android编译开发环境介绍

已有 1299 次阅读2015-3-12 16:50 | Android

Rayeager PX2的源码 采用目前最新的Android 4.4.2_r1系统,系统编译环境搭建参考本章相关章节,请开发板用户尤其注意,PX2的编译与固件烧写等使用方法。
Rayeager 提供的Android源码是在Google原生Android的基础上加入PX2平台相关的优化后整合出来的。 Google Android源码的获取、编译,在谷歌官网上有比较详细的介绍,开发板用户可以直接参考谷歌官网的相关说明,搭建系统环境,获取和编译代码。
谷歌官网关于源码下载、编译的地址: https://source.android.com/source/building.html(需翻墙)
【为了方便国内同学,小编复制了原文内容: Downloading and Building
The Android build is routinely tested in-house on recent versions of Ubuntu LTS (14.04), but most distributions should have the required build tools available. We welcome reports of successes or failures on other distributions.
Before you download and build the Android source, ensure your system meets the following requirements:
A Linux or Mac system. It is also possible to build Android in a virtual machine on unsupported systems such as Windows. If you are running Linux in a virtual machine, you need at least 16GB of RAM/swap and 50GB or more of disk space in order to build the Android tree. See disk size requirements below. A 64-bit environment is required for Gingerbread (2.3.x) and newer versions, including the master branch. You can compile older versions on 32-bit systems. At least 50GB of free disk space for a checkout, 100GB for a single build, and 150GB or more for multiple builds. If you employ ccache, you will need even more space. Python 2.6 -- 2.7, which you can download from python.org. GNU Make 3.81 -- 3.82, which you can download from gnu.org, JDK 7 to build the master branch of Android in the Android Open Source Project (AOSP); JDK 6 to build Gingerbread through KitKat; JDK 5 for Cupcake through Froyo. See Initializing a Build Environment for installation instructions by operating system. Git 1.7 or newer. You can find it at git-scm.com.】

对于Rayeager提供的Android代码,请参考《PX2开发板开源代码获取》中的描述获取。
下载、编译Android源码,需要满足如下基本要求: 
一台Linux或Mac主机。或者,window系统或其它OS中安装虚拟机也可以。如果在虚拟机中运行Linux,至少需要16G交换分区空间,30G或更多的磁盘空间来编译Android。 
编译Gingerbread (2.3.x)或更新系统版本,需要64位系统;2.3之前的系统可以使用32位系统编译。 
Android源码大小接近8.5G,单次编译需要约30G磁盘空间,完整编译需要100G或者更多。 
Python 2.6或更新版本,可从python.org网站下载安装。 
GNU Make 3.81或更新,可从gnu.org网站下载安装。 
Git 1.7或更新。

谷歌推荐使用Ubuntu系统。Ubuntu 12.04系统,安装完后,可以查看如下版本信息:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise

如果发现按照Google官网上的指南安装JDK不成功,可以按照下面的说明手动安装:
从Oracle官网去下载jdk:
http://www.oracle.com/java ->Downloads->Java for developers->Download Java SE 6 Update 45.(jdk-6u45-linux-x64.bin)
这里推荐使用1.6.0_45版本的JDK 使用如下命令安装jdk:
$ mv jdk-6u45-linux-x64.bin /user/local
$ chmod a+x jdk-6u45-linux-x64.bin
$ ./jdk-6u45-linux-x64.bin

安装完JDK后,将jdk路径加入到系统环境变量/etc/profile中:
JAVA_HOME=/usr/local/jdk1.6.0_45/
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH

保存之后,可以source /etc/profile,然后查看jdk版本:
java -version

系统编译步骤:
1,初始化系统编译环境
使用如下命令:
$ source build/envsetup.sh
$ . build/envsetup.sh


2,编译代码
直接在工程根目录下执行make即可,可用-j参数指定多线程编译,加快编译速度。
先编译产品kernel,见如下命令: $ cd kernel
$ make rkpx2_4.4_lcd_defconfig //支持屏幕的内核镜像
$ make kernel.img
如果要编译带VGA功能的内核镜像,请配置
$ make rkpx2_4.4_vga_defconfig
在kerne/目录下生成kernel.img 上面的两个defconfig文件可以通过make help命令查看

然后编译android:
$ cd ../
$ make -j4


3,生成固件
编译完成后,可执行mkimage.sh脚本生成固件。
$ ./mkimage.sh
固件生成目录:rockdev/Image-rkpx2/,生成
boot.img ,misc.img,recovery.img,system.img

4,uboot的编译
在工程目录下的
$ cd u-boot
$ make rkpx2
在目录下生成RKPX2Loader_miniall.bin和uboot.img

原文地址:http://wiki.chipspark.com/cn/index.php/PX2%E5%BC%80%E5%8F%91%E6%9D%BFAndroid%E7%BC%96%E8%AF%91%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E4%BB%8B%E7%BB%8D

路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

关于我们  -  服务条款  -  使用指南  -  站点地图  -  友情链接  -  联系我们
电子工程网 © 版权所有   京ICP备16069177号 | 京公网安备11010502021702
返回顶部