Cubie A20 Android Source code compilation little Note

Source: Internet
Author: User

Cubie This development board has been purchased for more than a year, has no time to play, recently feel that they have no progress, want to learn something more, rummaging finally find out. Crap not much.

1. Source code Download Path method

Two download methods, I was directly to the Cubie Baidu network disk download, the network to share code and reference material or very full.

1) Download on GitHub
git clone https://bitbucket.org/cubietech/a20-android4.2_lichee.git
git clone https://bitbucket.org/cubietech/a20-android4.2_android.git
2) in the Baidu Cloud download source Compression package:
Http://pan.baidu.com/s/1kTFXnPP


2. Build a compilation environment system Ubuntu 14.10

Officially recommended system is Ubuntu 12.04, I am now installing 14.10, I am building the environment according to the 12.04 version

2.1 Installing the JDK
$wget dl.cubieboard.org/software/tools/android/jdk1.6.0_45.tar.gz
Decompression: &sudo TAR-XVF jdk1.6.0_45.tar.gz
$ sudo vim ~/.BASHRC
Increase:
Java_home=/jdk-path/jdk1.6.0_45
Export JRE_HOME=/JDK-PATH/JDK1.6.0_45/JRE
Export path= $JAVA _home/bin: $JRE _home/bin: $PATH
Jdk-path to download the extracted JDK path
Save it in effect and verify the success:
$source ~/.bashrc&&java-version

/////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// /

Compiling environment settings

I am my own Baidu search jdk1.6.0_45 downloaded and installed on their own

Or go to the Oracle official website to download the old version, specifically how to download the old version of Oracle, please Baidu: Oracle official website Download the old version of the JDK

1. Download Jdk-6u45-linux-x64.bin from Oracle

Download file: Jdk-6u45-linux-x64.bin

2. Copy the Jdk-6u45-linux-x64.bin into the/usr/java

3 Enter the/usr/java directory, modify the Jdk-6u45-linux-x64.bin executable permissions chmod u+x jdk-6u45-linux-x64.bin

4. Executive Jdk-6u45-linux-x64.bin

./jdk-6u45-linux-x64.bin for installation

5. Enter/etc/profile to configure the environment variable

6. Set the environment variables and add the following lines at the end

Export JAVA_HOME=/USR/JAVA/JDK1.6.0_17

Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Export path= $PATH: $JAVA _home/bin

(Note that the environment variables in Linux are split with ":", not ";")

7. Restart the system reboot

(Remember to restart the system after the change)

Final Test java-version to see if it is the version you installed

/////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// /


2.2 Install the required packages for compiling (Ubuntu 12.04):

$sudo apt-get Update
$sudo Apt-get Upgrade
$sudo apt-get Install build-essential u-boot-tools uboot-mkimage BINUTILS-ARM-LINUX-GNUEABIHF
$sudo apt-get Install gcc g++ gcc-arm-linux-gnueabi GCC-ARM-LINUX-GNUEABIHF g++-multilib
$sudo apt-get Install CPP-ARM-LINUX-GNUEABIHF libusb-1.0-0 libusb-1.0-0-dev wget fakeroot
$sudo apt-get Install kernel-package zlib1g-dev libncurses5-dev build-essential
$sudo apt-get Install texinfo texlive ccache zlib1g-dev gawk Bison Flex GetText Uuid-dev
$sudo apt-get Install ia32-libs git gnupg Flex Bison gperf build-essential zip
$sudo apt-get Install Curl Libc6-dev x11proto-core-dev libx11-dev:i386 Lib32ncurses5-dev
$sudo apt-get Install libreadline6-dev:i386 mingw32 tofrodos Python-markdown
$sudo apt-get Install libxml2-utils xsltproc zlib1g-dev:i386 Libgl1-mesa-dev


3. New Folder/work/

Unzip the Android source A20_android.tar.gz to the/work folder

The same A20_lichee.tar.gz also extracted to/work

Decompression method

You can switch the root account using sudo or sudo-i

TAR-ZXVF a20_lichee.tar.gz-c/work

TAR-ZXVF a20_android.tar.gz-c/work

4. Kernel compilation

The extracted source package is divided into 2 directories, one is Android and the other is Lichee, kernel compilation is performed under Lichee.
Lichee is mainly to compile some devices need modules, drivers, cores, etc., as well as configuration files. The compiled modules and cores are
The body compiles the Android firmware while copying the past.

The compile steps are as follows:
Copy Kernel configuration file

Enter lichee/linux-3.4 to execute sudo cp arch/arm/configs/cubieboaed2_config. config
Compiling the kernel

Under the Lichee folder./build.sh-p sun7i_android

Wait for compilation to complete

Will eventually appear

Info:build U-boot OK

Build Rootfs ...

Skip make Rootfs for Android

Build Rootfs OK

Build Lichee OK

Enter Lichee/out to see Zimage

5, the overall source code compiled

After the kernel has been compiled, go to the Android directory. This performs the compilation of the entire firmware, generates SYSTEM.IMG,USERDATA.IMG, etc.
Images, and then package them as the firmware we want.

The steps are as follows:
[Email protected]:/work/le/a20-android$ cd Android
[Email protected]:/work/le/a20-android/android$ Source build/envsetup.sh
[Email protected]:/work/le/a20-android/android$ Lunch

Input 16 (select Sugar_cubietruck-eng)

Copy the kernel and modules:
[Email protected]:/work/le/a20-android/android$ extract-bsp
Compile:
[Email protected]:/work/le/a20-android/android$ make-j8
Wait...........
Compile Complete:

After the compilation is complete, package:
[Email protected]:/work/le/a20-android/android$ Pack
Finally, we will generate our final firmware in the Lichee/tools/pack.


6. Errors occurred during compilation

1) Make 4.0 needs to be replaced by 3.81 or 3.82, reference website

Android can only is built by versions 3.81 and 3.82

Remove the high version make 4.0.8, compile and install the low version make 3.82

The question is, how do I replace the lower version of make?

View First

$ make--version
GNU Make 4.0

Download downloaded 3.82 from http://ftp.gnu.org/gnu/make/

Download make-3.82-154.1.1.x86_64.rpm

Then unzip into the folder and install

./configure
sudo make install

Make--version
GNU make 3.82

This gives you a version of make that meets your needs

Then continue compiling the source code

(Pay special attention to make version changed after the need to re-set the compilation source several steps, that is, source build/envsetup.sh lunch ... Re-operation)


2) calling Gperf failed:32512 at./makeprop.pl Line 140

Sh:gperf:not found

Target Generated:libwebcore <= external/webkit/source/javascriptcore/create_regex_tables
Generating CSSPropertyNames.h <= csspropertynames.in
Sh:gperf:not found
Calling Gperf failed:32512 at./makeprop.pl Line 140.
Make: * * * [out/target/product/generic/obj/static_libraries/libwebcore_intermediates/source/webcore/css/ CSSPROPERTYNAMES.H] Error 25
Make: * * * Deleting file ' out/target/product/generic/obj/static_libraries/libwebcore_intermediates/source/webcore/ Css/csspropertynames.h '

Workaround:sudo apt-get install gperf

{The above error is not compiled by me, I am a copy of the reference article, because when the compilation of grapefruit Records save, but the solution can, this important}

Reference http://www.oschina.net/question/565065_86092


7. Make a compilation after solving the above problems

Finally appeared

Reallen=0x4b0c00
Cplugin free Lib
Cplugin free Lib
Normal
Dragon Image.cfg Sys_partition.fex [OK]
----------image is at----------

/work/lichee/tools/pack/sun7i_android_sugar-cubietruck.img

Pack Finish

It should be compiled, I'll download the firmware first.

Now remember so much, follow-up and share.


Cubie A20 Android Source code compilation little Note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.