How to get the Android distribution

From IGEP - ISEE Wiki

Revision as of 12:28, 26 May 2010 by Eballetbo (talk | contribs)

Jump to: navigation, search

How to get the Android distribution

Android is a software stack for mobile devices that includes an operating system, middleware and key applications, that uses a modified version of the Linux kernel. It was initially developed by Android Inc., a firm later purchased by Google, and lately by the Open Handset Alliance. It allows developers to write managed code in the Java language, controlling the device via Google-developed Java libraries.

Rowboat project provides Android on OMAP35xx platforms and enables key OMAP35xx hardware features (ARM plus NEON, DSP, 2D/3D Accelerated Graphics and others). Key differentiators among many others:

  • Active and open development of a quality Android port.
  • Focused on a stable, well tested and benchmarked Android port for OMAP35xx.
  • Graphics and Multimedia performance optimizations.

Pre-built images for impatients

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Release Kernel Rootfs Platform
Android 2.1 (Eclair) 2.6.29-igep0020 2.1 Update 1 http://developer.android.com/sdk/android-2.1.html


Overview of How-To

This How-To is meant to be a starting point for people to learn build and run Android images for IGEP v2 devices as quickly and easily as possible.

This How-To works with the Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine but most of the contents are valid also for other GNU/Linux distributions. We do not issue any guarantee that this will work on other distributions.

This How-To will start out by a Android Setup Environment introducing you to the Android environment and the way you can build an Android-based image.

Lastly, we will learn how to Installing and Using the Result on a NFS-mounted root filesystem.

Requirements

  • Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine

Feedback and Contributing

At any point, if you see a mistake you can contribute to this How-To.

How to get involved (http://code.google.com/p/rowboat/wiki/HowToContribute)

There are many ways to get involved with the Rowboat project.

Become a Rowboat user

  • Try out Rowboat Android - either pre-built or from source
  • Give us feedback via IRC #rowboat or the Rowboat mailing list (rowboat@googlegroups.com)
  • If you find an issue or bug, file a project issue

Share your Rowboat knowledge

  • Add Wiki articles or edit existing topics
  • Share your knowledge on #rowboat or rowboat@googlegroups.com

Submit code

  • Send your patches to the mailing list, rowboat@googlegroups.com

References

Android Platform Setup Environment

Ubuntu Linux (32-bit x86) To set up your Linux development environment, make sure you have the following:

Required Packages:

  • Git 1.5.4 or newer and the GNU Privacy Guard.
  • JDK 5.0, update 12 or higher. Java 6 is not supported, because of incompatibilities with @Override.
  • flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.

In Ubuntu Linux you will do:

$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev libreadline5-dev
  • You might also want Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc.
$ sudo apt-get install valgrind

Once you installed the requirements, you will create a working directory and download the repo tool.

$ mkdir ~/bin
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=$PATH:~/bin
$ mkdir android
$ cd android

Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:

$ repo init -u git://gitorious.org/rowboat/manifest.git -m < manifest name >

where manifest name is:

  • rowboat-eclair.xml - for eclair version of rowboat
  • rowboat-eclair-dsp.xml - for eclair version of rowboat with DSP support

To pull down files to your working directory from the repositories as specified in the default manifest, run

$ repo sync

If you want eclair with DSP support you need to download and place codec_engine_2_24_01.tar.gz under the external/ti-dsp folder. Codec Engine is available here. Note you may need to have an account on software-dl.ti.com

Now build for your target product, do

$ make TARGET_PRODUCT=igepv2 -j8

for rowboat-eclair or

$ make TARGET_PRODUCT=igepv2 BUILD_WITH_GST=true dvsdk -j8

for rowboat-eclair-dsp

Next step is create a tarball containing the rootfs

$ cd out/target/product/igepv2
$ mkdir android-rootfs
$ cp -r root/* android-rootfs
$ cp -r system android-rootfs
$ sudo ../../../../build/tools/mktarball.sh ../../../host/linux-x86/bin/fs_get_stats android-rootfs . rootfs rootfs.tar.bz2
$ cd ../../../../

The next step is build the Linux kernel for your board.

$ export PATH=${PWD}/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH
$ cd kernel/
$ make ARCH=arm igep0020_android_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-eabi- uImage -j8
$ cd ..

Now, you're ready to install and run your new android image.

Installing and Using the Result on a NFS-mounted root filesystem

With factory seetings, the board will attempt to mount its root filesystem from the server as /srv/nfs/<distro>/<project>/<machine>, where

***<distro> where distro is <your distro>
***<project> where project is <your project>
***<machine> where machine is <your machine>

Create the directory structure and extract the root file system to the NFS server

$ sudo mkdir -p /srv/nfs/android/android-image-eclair/igep0020
$ pushd /srv/nfs/android/android-image-eclair/igep0020
$ sudo tar jxf rootfs.tar.bz2
$ popd

After this the only configuration that needs to be added is an entry for your target root directory to your /etc/exports file, for instance like this:

# Poky image rootfs
/srv/nfs/android/android-image-eclair/igep0020       *(rw,no_root_squash,no_subtree_check,sync)

After modifying the /etc/exports file you will make sure the NFS system is notified about the change, for instance by issuing the command:

$ sudo exportfs -a

The target also can get its kernel image from your tftp server. Similar to the NFS root filesystem, the target system will attempt to get its kernel image from the server as /srv/tftp/<distro>/<project>/<machine>. Follow next steps to configure your board and run the your new image.

Create the directory structure and copy the kernel image to the TFTP server, refer to "How to cross compile the Linux kernel" for build your own image.

$ mkdir -p /srv/tftp/android/android-image-eclair/igep0020
$ cp kernel/arch/arm/boot/uImage /srv/tftp/android/android-image-eclair/igep0020

Then, connect your development board as explained in IGEP v2 Software SDK Manual

Next, power up your board and stop u-boot's autoboot by pressing a key.

Now, it's time to change the U-Boot environment.

U-Boot> setenv distro android
U-Boot> setenv project android-image-eclair
U-Boot> setenv bootargs-base mem=512M androidboot.console=ttyS2 console=tty0 console=ttyS2,115200n8 init=/init rootwait omap-dss.def_disp=dvi omapfb.video_mode=720x480MR-16@60

If you want to set as default boot option, you can also save your new environment

U-Boot> saveenv

The last step is run the boot command.

U-Boot> run nfs-boot

--- That's all folks ---