Difference between revisions of "Rock/Android Build/zh cn"
< Rock | Android Build
(Created page with " {{Languages|rock/Android_Build}} __TOC__ === Before start === Building AOSP(Android Open Source Project) for radxa rock is a huge task, it takes a lot of time and disk sp...") |
|||
(14 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
__TOC__ | __TOC__ | ||
− | === | + | === 开始之前 === |
− | + | 给radxa rock编译AOSP(Android Open Source Project)整个安卓系统源码是一项大工程,会很耗费时间和硬盘空间。你可以参考安卓官方的详细[http://source.android.com/source/building.html 系统要求页面]。推荐的编译主机是Ubuntu 12.04 64位。在我们的测试编译机器上一次完整编译总共花费了35分钟和30G的硬盘空间。配置Intel 4770处理器(第四代i7,四核八线程,3.4Ghz),16G内存和256G固态硬盘(友情提示: 固态硬盘可以极大提高编译速度). | |
− | === | + | === 初始化编译环境 === |
− | + | 参考了安卓官方的环境搭建[http://source.android.com/source/initializing.html 教程],下面是我们测试过的在全新的系统上可用的步骤。 | |
− | + | * 安装JDK | |
sudo add-apt-repository ppa:webupd8team/java | sudo add-apt-repository ppa:webupd8team/java | ||
sudo apt-get update | sudo apt-get update | ||
sudo apt-get install oracle-java6-installer | sudo apt-get install oracle-java6-installer | ||
− | + | * 安装所需要的包 | |
sudo apt-get install git gnupg flex bison gperf build-essential \ | sudo apt-get install git gnupg flex bison gperf build-essential \ | ||
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ | zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ | ||
Line 22: | Line 22: | ||
python-markdown libxml2-utils xsltproc zlib1g-dev:i386 | python-markdown libxml2-utils xsltproc zlib1g-dev:i386 | ||
− | + | 注意: 在Ubuntu 13.10上,已经没有ia32-libs这个包,不需要安装这个包。 | |
− | + | * 安装ARM交叉编译器和编译内核相关依赖 | |
sudo apt-get install gcc-arm-linux-gnueabihf | sudo apt-get install gcc-arm-linux-gnueabihf | ||
sudo apt-get install lzop libncurses5-dev | sudo apt-get install lzop libncurses5-dev | ||
export ARCH=arm | export ARCH=arm | ||
export CROSS_COMPILE=arm-linux-gnueabihf- | export CROSS_COMPILE=arm-linux-gnueabihf- | ||
− | + | ||
+ | * 安装其他所需要的运行库 | ||
sudo apt-get install libssl1.0.0 libssl-dev | sudo apt-get install libssl1.0.0 libssl-dev | ||
− | === | + | === 获取源码 === |
+ | |||
+ | |||
+ | Git clone from the [http://linux-rockchip.org/ linux-rockchip mirror servers]. (日本服务器) | ||
+ | |||
+ | For android 4.2.2 Jelly Bean | ||
+ | git clone -b radxa/radxa-dev [http://git.us.linux-rockchip.org/cgit/rk3188_r-box_android4.2.2_sdk/ http://git.us.linux-rockchip.org/rk3188_r-box_android4.2.2_sdk] | ||
+ | |||
+ | For android 4.4.2 KitKat | ||
+ | git clone -b radxa/rock2014 [http://git.us.linux-rockchip.org/cgit/rk3188_rk3066_r-box_android4.4.2_sdk/ http://git.us.linux-rockchip.org/rk3188_rk3066_r-box_android4.4.2_sdk] | ||
+ | or 从百度云下载 http://pan.baidu.com/s/1hqorKva (China) | ||
+ | |||
− | + | 注: 国内客户建议从百度云下载,速度较快; rock,rock_pro,rock_lite可以用同一份代码(android 4.4版本), 编译时使用不同的配置即可 | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | === | + | === 编译内核 === |
export ARCH=arm | export ARCH=arm | ||
cd kernel | cd kernel | ||
− | make rk3188_radxa_rock_defconfig | + | make rk3188_radxa_rock_defconfig #Use this config If you build the '''android 4.2 JB image for radxa rock''' |
− | make kernel.img #kernel.img is the normal kernel image with rockchip crc | + | make rk3188_radxa_rock_kitkat_defconfig #Use this config If you build the '''android 4.4 KK image for radxa rock''' |
+ | make rk3188_box_radxa_rock_pro_hdmi_defconfig #Use this config if you build the '''android 4.4 KK image for radxa rock pro''' | ||
+ | make rk3188_box_radxa_rock_lite_hdmi_defconfig #Use this config if you build the '''android 4.4 KK image for radxa rock lite''' | ||
+ | make kernel.img #kernel.img is the normal kernel image with rockchip crc | ||
cd .. | cd .. | ||
− | === | + | === 编译安卓源码 === |
source build/envsetup.sh | source build/envsetup.sh | ||
− | lunch rk31sdk-eng | + | lunch rk31sdk-eng #Launch this config if you build '''android 4.2 JB for radxa rock''' |
+ | lunch radxa_rock-eng #Launch this config if you build '''android 4.4.2 KK for radxa rock''' | ||
+ | lunch radxa_rock_pro-eng #Launch this config if you build '''android 4.4.2 KK for radxa rock pro''' | ||
+ | lunch radxa_rock_lite-eng #Launch this config if you build '''android 4.4.2 KK for radxa rock lite''' | ||
make -j8 | make -j8 | ||
− | === | + | === 生成镜像 === |
./mkimage.sh ota | ./mkimage.sh ota | ||
− | + | 你会在rockdev/Image文件夹下得到boot.img recovery.img system.img分区镜像文件, 和 rockdev文件夹下的[[rock/update.img | update.img]]整个固件。 | |
− | === | + | === 写入镜像(刷机) === |
− | + | 参考[[rock/flash the image]]如何刷入你刚刚编出来的镜像。 | |
[[Category: Distributions]] | [[Category: Distributions]] | ||
[[Category:Tutorial]] | [[Category:Tutorial]] | ||
[[Category:Android]] | [[Category:Android]] |
Latest revision as of 02:51, 30 January 2016
开始之前
给radxa rock编译AOSP(Android Open Source Project)整个安卓系统源码是一项大工程,会很耗费时间和硬盘空间。你可以参考安卓官方的详细系统要求页面。推荐的编译主机是Ubuntu 12.04 64位。在我们的测试编译机器上一次完整编译总共花费了35分钟和30G的硬盘空间。配置Intel 4770处理器(第四代i7,四核八线程,3.4Ghz),16G内存和256G固态硬盘(友情提示: 固态硬盘可以极大提高编译速度).
初始化编译环境
参考了安卓官方的环境搭建教程,下面是我们测试过的在全新的系统上可用的步骤。
- 安装JDK
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java6-installer
- 安装所需要的包
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
注意: 在Ubuntu 13.10上,已经没有ia32-libs这个包,不需要安装这个包。
- 安装ARM交叉编译器和编译内核相关依赖
sudo apt-get install gcc-arm-linux-gnueabihf sudo apt-get install lzop libncurses5-dev export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf-
- 安装其他所需要的运行库
sudo apt-get install libssl1.0.0 libssl-dev
获取源码
Git clone from the linux-rockchip mirror servers. (日本服务器)
For android 4.2.2 Jelly Bean
git clone -b radxa/radxa-dev http://git.us.linux-rockchip.org/rk3188_r-box_android4.2.2_sdk
For android 4.4.2 KitKat
git clone -b radxa/rock2014 http://git.us.linux-rockchip.org/rk3188_rk3066_r-box_android4.4.2_sdk or 从百度云下载 http://pan.baidu.com/s/1hqorKva (China)
注: 国内客户建议从百度云下载,速度较快; rock,rock_pro,rock_lite可以用同一份代码(android 4.4版本), 编译时使用不同的配置即可
编译内核
export ARCH=arm cd kernel make rk3188_radxa_rock_defconfig #Use this config If you build the android 4.2 JB image for radxa rock make rk3188_radxa_rock_kitkat_defconfig #Use this config If you build the android 4.4 KK image for radxa rock make rk3188_box_radxa_rock_pro_hdmi_defconfig #Use this config if you build the android 4.4 KK image for radxa rock pro make rk3188_box_radxa_rock_lite_hdmi_defconfig #Use this config if you build the android 4.4 KK image for radxa rock lite make kernel.img #kernel.img is the normal kernel image with rockchip crc cd ..
编译安卓源码
source build/envsetup.sh lunch rk31sdk-eng #Launch this config if you build android 4.2 JB for radxa rock lunch radxa_rock-eng #Launch this config if you build android 4.4.2 KK for radxa rock lunch radxa_rock_pro-eng #Launch this config if you build android 4.4.2 KK for radxa rock pro lunch radxa_rock_lite-eng #Launch this config if you build android 4.4.2 KK for radxa rock lite make -j8
生成镜像
./mkimage.sh ota
你会在rockdev/Image文件夹下得到boot.img recovery.img system.img分区镜像文件, 和 rockdev文件夹下的 update.img整个固件。
写入镜像(刷机)
参考rock/flash the image如何刷入你刚刚编出来的镜像。