Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock/Android Build"

(Get the source code)
 
(44 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
+
{{rock_header}}
 
+
 
{{Languages|rock/Android_Build}}
 
{{Languages|rock/Android_Build}}
  
Line 15: Line 14:
 
     sudo apt-get update
 
     sudo apt-get update
 
     sudo apt-get install oracle-java6-installer
 
     sudo apt-get install oracle-java6-installer
Install required packages
+
    '''Note if the sdk is android5.x you should install java 7 as below'''
 +
    sudo apt-get install openjdk-7-jdk
 +
 
 +
Install required packages - ubuntu 12.04
 
     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 21: Line 23:
 
     g++-multilib mingw32 tofrodos gcc-multilib ia32-libs\
 
     g++-multilib mingw32 tofrodos gcc-multilib ia32-libs\
 
     python-markdown libxml2-utils xsltproc zlib1g-dev:i386
 
     python-markdown libxml2-utils xsltproc zlib1g-dev:i386
 +
 +
Install required packages - ubuntu 13.10 and 14.04
 +
    sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev\
 +
    libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl\
 +
    libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 libxml2-utils\
 +
    xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev\
 +
    lib32readline-gplv2-dev gcc-multilib libswitch-perl
 +
 
Install ARM toolchain and building kernel related pacakges  
 
Install ARM toolchain and building kernel related pacakges  
    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
+
Install libraries for other tools
     export CROSS_COMPILE=arm-linux-gnueabihf-
+
     sudo apt-get install libssl1.0.0 libssl-dev
  
 
=== Get the source code ===
 
=== Get the source code ===
     git clone -b radxa-dev git@git.linux-rockchip.org:radxa/radxa_rock_android.git
+
 
    cd radxa_rock_android
+
Git clone from the [http://linux-rockchip.org/ linux-rockchip mirror servers]. (git.us.linux-rockchip.org is located at U.S.A.)
Note: you need access to the private git server, send mail to [mailto:support@radxa.com?subject=Private%20git%20server&body=Hi,%20i%20want%20to%20access%20radxa%20private%20git%20server support@radxa.com] for account.
+
 
 +
For android 4.2.2 Jelly Bean (rock)
 +
     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.2.2 Jelly Bean (rock pro)
 +
    git clone -b radxa/radxa-dev-rock_pro [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  (rock pro & rock lite)
 +
 
 +
    git clone -b radxa/rock2014 http://git.us.linux-rockchip.org/rk3188_rk3066_r-box_android4.4.2_sdk
 +
 
 +
or
 +
 
 +
    Download from Mega [https://mega.nz/#F!lZNWBQzT!-s0xAyFvJVPYiq4YNg9ekw?gMMjkQzb  radxa_rock_android4-4_141219.tar.gz]
 +
 
 +
Note: After unzip the file please run git checkout . to get the code
  
 
=== Build the kernel ===
 
=== Build the kernel ===
    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 ..
 +
 +
'''note''': if you want to build android '''sdcard image for rock pro''', you need to run make menuconfig and go to Device Drivers  ---> MMC/SD/SDIO card support, and disable RK29 SDMMC0 controller support(sdmmc), for rock lite the sdmmc0 driver is already disabled in defconfig.
  
 
=== Build android source code ===
 
=== Build android source code ===
 
     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
  
Line 47: Line 79:
 
     ./mkimage.sh ota
 
     ./mkimage.sh ota
 
you will get boot.img recovery.img system.img under rockdev/Image, and [[rock/update.img | update.img]] under rockdev
 
you will get boot.img recovery.img system.img under rockdev/Image, and [[rock/update.img | update.img]] under rockdev
 +
 +
generate the image for '''sdcard'''(optional)
 +
 +
    cd rockdev && ./mksdimge.sh
 +
 +
android_xx-xx-x_sdcard.img is the generated image for sd card.
 +
 +
'''Note: How to write the image on sdcard, you can refer to http://radxa.com/Rock/SD_images ,  You can't use SD_Firmware_Tool._v1.43.zip'''
  
 
=== Flash the image ===
 
=== Flash the image ===
Next, follow the [[rock/flash the image]] to flash the image you just build.
+
Next, follow the [[rock/flash the image | flash to NAND flash]] to flash the image to NADN flash you just build. Or follow [[Rock/SD_images| flash to sd card]] to write the image on sd card.
 +
 
 +
== External reference ==
 +
http://www.cnx-software.com/2014/01/17/getting-started-with-raxda-rock-building-an-android-4-2-image-from-source/
  
 
[[Category: Distributions]]
 
[[Category: Distributions]]
 +
[[Category:Tutorial]]
 +
[[Category:Android]]

Latest revision as of 00:33, 1 December 2018

Before start

Building AOSP(Android Open Source Project) for radxa rock is a huge task, it takes a lot of time and disk space. You can read the detail requirement of the machine on AOSP requirement page. The recommend building OS is Ubuntu 12.04 64bit. It takes about 35 minutes and 30G disk space on a intel 4770 processor(i7, quad core, 3.4Ghz) machine with 16G ram and SSD.

Initializing a Build Environment

  • Refer instructions from Google. Below is what we tested and set up the environment.

Install JDK

   sudo add-apt-repository ppa:webupd8team/java
   sudo apt-get update
   sudo apt-get install oracle-java6-installer
   Note if the sdk is android5.x you should install java 7 as below
   sudo apt-get install openjdk-7-jdk

Install required packages - ubuntu 12.04

   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

Install required packages - ubuntu 13.10 and 14.04

   sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev\
   libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl\
   libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 libxml2-utils\
   xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev\
   lib32readline-gplv2-dev gcc-multilib libswitch-perl

Install ARM toolchain and building kernel related pacakges

   sudo apt-get install lzop libncurses5-dev

Install libraries for other tools

   sudo apt-get install libssl1.0.0 libssl-dev

Get the source code

Git clone from the linux-rockchip mirror servers. (git.us.linux-rockchip.org is located at U.S.A.)

For android 4.2.2 Jelly Bean (rock)

   git clone -b radxa/radxa-dev http://git.us.linux-rockchip.org/rk3188_r-box_android4.2.2_sdk

For android 4.2.2 Jelly Bean (rock pro)

   git clone -b radxa/radxa-dev-rock_pro http://git.us.linux-rockchip.org/rk3188_r-box_android4.2.2_sdk

For android 4.4.2 KitKat (rock pro & rock lite)

   git clone -b radxa/rock2014 http://git.us.linux-rockchip.org/rk3188_rk3066_r-box_android4.4.2_sdk

or

   Download from Mega radxa_rock_android4-4_141219.tar.gz

Note: After unzip the file please run git checkout . to get the code

Build the kernel

   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 ..

note: if you want to build android sdcard image for rock pro, you need to run make menuconfig and go to Device Drivers ---> MMC/SD/SDIO card support, and disable RK29 SDMMC0 controller support(sdmmc), for rock lite the sdmmc0 driver is already disabled in defconfig.

Build android source code

   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

Generate the image

   ./mkimage.sh ota

you will get boot.img recovery.img system.img under rockdev/Image, and update.img under rockdev

generate the image for sdcard(optional)

   cd rockdev && ./mksdimge.sh

android_xx-xx-x_sdcard.img is the generated image for sd card.

Note: How to write the image on sdcard, you can refer to http://radxa.com/Rock/SD_images , You can't use SD_Firmware_Tool._v1.43.zip

Flash the image

Next, follow the flash to NAND flash to flash the image to NADN flash you just build. Or follow flash to sd card to write the image on sd card.

External reference

http://www.cnx-software.com/2014/01/17/getting-started-with-raxda-rock-building-an-android-4-2-image-from-source/