Thursday, October 27, 2016

Build the Android Source for helios x20

  Image result for helio x20

Requirements

Please refer to AOSP website and follow all the instruction mentioned there. Read and prepare carefully through the link, http://source.android.com/source/requirements.html .

Pay attention to the following key points:

GUN/Linux distribution selecting: We strongly recommend you install Ubuntu 14.04 (Trusty) to  build the environment;
Java Development Kit (JDK): OpenJDK 7 for Android 6.0 (Marshmallow) on Ubuntu;
Device binaries: MediaTek X20 SLA source part including the device binaries;

Establishing a Build Environment


Refer to AOSP website ( http://source.android.com/source/initializing.html ) and follow the below key points:

The Android build is routinely tested in house on recent versions of Ubuntu LTS (14.04)
Installing the JDK 7


$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk


Installing required packages


$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
  lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
  libgl1-mesa-dev libxml2-utils xsltproc unzip


Using a separate output directory


$ export OUT_DIR_COMMON_BASE=<path-to-your-out-directory>


Downloading the Source


Refer to AOSP website ( http://source.android.com/source/downloading.html ) and follow the below key points:

Installing Repo


$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl  https://storage.googleapis.com/git-repo-downloads/repo  > ~/bin/repo
$ chmod a+x ~/bin/repo


Downloading the AOSP


$ mkdir ~/develop/x20
$ cd ~/develop/x20
$ repo init -u  https://android.googlesource.com/platform/manifest  -b android-6.0.0_r1
$ epo sync –j8


Downloading Linux Kernel


$ cd ~/develop
$ git clone  https://github.com/helio-x20/linux.git


Downloading MediaTek SLA


$ cd ~/develop
$ curl  https://builds.96boards.org/releases/helio-x20/mediatek/aosp/16.07/sla.tar.gz


 Merge the Source



$ cd ~/develop
$ mv linux ~/develop/x20/kernel-3.18
$ tar vxfz sla.tar.gz
$ cp –rf sla/* ~/develop/x20/

Build the Android Source


Refer to AOSP website ( http://source.android.com/source/building.html ) and follow the below key points:

Clean up

$ make clobber


Set up environment

$ source build/envsetup.sh


Choose a target

$ lunch full_amt6796_64_open-eng


Build the code

Build everything with make. GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. For example, on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.


$ make -j8


or make one by one manually


$ make pl -j8
$ make lk -j8
$ make kernel -j8
$ make bootimage -j8
$ make systemimage -j8

Note that, the Android OS for x20 96Boards is open source, but excluding HAL part, and the preloader part.

So, there is no need to execute "$ make pl -j8".

Images in the out directory



boot.img
cache.img
lk.bin
logo.bin
MT6797_Android_scatter.txt
PGPT
preloader_amt6797_64_open.bin
recovery.img
system.img
tinysys-scp.bin
trustzone.bin
userdata.img

Follow up with next blog to know how to install android on the board