[Miscellaneous Android Development] sztupy:
Part 1

Part 1: Preparations

A: Preconditions

For building and creating a LiveSuite flashable package you will need the following:

For building the kernel and android you will need a 64 bit Linux machine. Ubuntu 10.04 64 bit is preferred for Gingerbread builds

For creating the LiveSuite flashable images, and actually flashing you will need a Windows machine. Windows 7 x64 works fine, as should Windows XP 32 bit too.

You will also need a working LiveSuite image file, for your tablet. Make sure that you can flash it to your device without problems!

Virtual machines are fine, if you have enough memory available. To build Android in a VM, you should give it at least 2GB of RAM. Alternatively if you're using Linux, you can create a Windows VM for the image creation or flashing part.

For the rest of the tutorial I will assume you are using a Linux Virtual Machine on a Windows box.

For building the kernel and AOSP you will need at least 35GB of free space in your linux machine (the more the better). To create the images you will need an additional 2GB of space on your Windows machine.

B: Getting the kernel and AOSP sources

First initialize your Linux machine according to this page: http://source.android.com/source/initializing.html

Here are the most important commands:

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
// Additonal commands for Ubuntu 10.10:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
// Additonal commands for Ubuntu 11.10:
$ sudo apt-get install libx11-dev:i386

Now create a directory on your linux machine. The path should contain no spaces in it. Inside this directory first pull the kernel source from the allwinner github page:

$ git clone https://github.com/allwinner/linux-2.6.36 lichee

Make sure that the kernel resides in the lichee directory

Now download AOSP Android. We will use Gingerbread version 2.3.7:

$ mkdir android
$ cd android
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
$ repo sync

Allwinner uses a special init, which has a few additional commands that you have to download too:

$ cd system/core
$ git pull git://github.com/sztupy/allwinner_android_system_core.git
$ cd ../..

You will also need the device descriptors for the tablets:

$ cd device
$ git clone git://github.com/sztupy/android_device_softwinner.git softwinner
$ cd ..

C: ARM compiler

You might simply use a compiler that is supplied for AOSP, they are inside the android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/ directory. Alternatively you can also download the ARM compiler of CodeSourcery. Get the arm-2009q3 / arm-none-linux-gnueabi version, and unpack it inside a directory.

If ready, go on to next step: building the kernel