Compiling Android from sources

From Low cost, low power, android ARM system board by Mini-Box.com - pico WiKi
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Getting Project Source Code

Our project is hosted at http://gitorious.org/picopc-android-eclair/
Follow below steps, it shows how to set up the building environment, how to download android source code and how to build it from scratch.

Precondition: Sun JDK

You would need Sun JDK version 1.5 to build Eclair. However, Sun JDK version 1.5 is known to be EOL (End-Of-Line), and Ubuntu Linux 9.10 no longer ships with sun-java5-jdk.

If you are using Ubuntu Linux 9.10, just add these two line in file /etc/apt/sources.list:

deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

If you are using Ubuntu 10.04 LTS (Lucid Lynx), add this line to file /etc/apt/sources.list:

deb http://ir.archive.ubuntu.com/ubuntu hardy-updates main multiverse

and install Sun JDK 1.5:

$ sudo apt-get update
$ sudo apt-get install sun-java5-jdk

To set the system to use Java 5, you need to update your java alternatives by running

$ sudo update-alternatives --config java

Choose java-1.5.0-sun and it should be done.

Precondition: git and repo

Before you download the source, you will need git and repo tools.

On an Ubuntu 9.04 host, you can do the following:

Getting git:

$ sudo apt-get install git-core

Getting repo:

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

For reference details about Repo, see Using Repo and Git.

Get picoPC-android source

Android Gingerbread

Download the picopc android gingerbread source code (sources available here):

$ mkdir picopc-android-gingerbread
$ cd picopc-android-gingerbread
$ repo init -u git://gitorious.org/picopc-android-gingerbread/manifest.git 
$ repo sync

Android Eclair

Download the picopc android eclair source code (sources available here):

$ mkdir picopc-android-eclair

$ cd picopc-android-eclair
$ repo init -u git://gitorious.org/picopc-android-eclair/manifest.git 
$ repo sync


Archive (warning might get outdated use git):

https://arm.mini-box.com/releases/android-gingerbread-2.3.4-src.tgz with the md5sum: 057cc88e1a374f68e3b992ca64fe612f

Warning: the size of the archive it's 3,264Gb

Build picoPC-android from source

Android Gingerbread

Setup picopc configurations:

$ cd picopc-android-gingerbread
$ . build/envsetup.sh

Start the building process by executing android build system 'm' command

$ make update-api (only on first compilation)
$ TARGET_PRODUCT=picopc m

Android Eclair

Setup picopc configurations:

$ cd picopc-android-eclair
$ ln -sf build/buildspec.mk buildspec.mk
$ . build/envsetup.sh

Start the building process by executing android build system 'm' command

$ m

Installing picoPC-android files

Android Gingerbread

Once successfully built you can use the picopc-tools to extract the rootfs and system images by running the script in:

$ picopc-tools/android-tools/rootfs-creator/android-2.3/rootfs-generator.sh

The resulting files from the latest/ folder can be copied in the rootfs partition on microSD

Android Eclair

Once successfully built you can use the picopc-tools to extract the rootfs and system images by running the script in:

$ picopc-tools/android-tools/rootfs-creator/android-2.1/rootfs-generator.sh