How to get the Android distribution

From IGEP - ISEE Wiki

Revision as of 14:53, 22 February 2011 by Eballetbo (talk | contribs) (How to get the Android distribution)

Jump to: navigation, search

How to get the Android distribution

Android-logo.png
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.


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.

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

Android Froyo 2.2 Platform

WORK IN PROGRESS

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 x-loader u-boot Kernel Rootfs Platform
Android 2.2 (Froyo) http://developer.android.com/sdk/android-2.2.html
Build Android Froyo from sources

WORK IN PROGRESS

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:

$ mkdir froyo
$ cd froyo
$ repo init -u git://gitorious.org/rowboat/manifest.git -m rowboat-froyo-dsp.xml

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

$ repo sync

First of all edit device/ti/igepv2/BoardConfig.mk and set BOARD_USES_OMAP3_LIGHTS to false, otherwise compilation fails.

diff --git a/BoardConfig.mk b/BoardConfig.mk
index b9e86b3..95187de 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -11,7 +11,7 @@ BUILD_WITH_ALSA_UTILS := true
 
 BUILD_PV_VIDEO_ENCODERS := 1
 
-BOARD_USES_OMAP3_LIGHTS := true
+BOARD_USES_OMAP3_LIGHTS := false
 
 BOARD_USES_VIRTUAL_TOUCHSCREEN := true
 USE_CUSTOM_RUNTIME_HEAP_MAX := "64M"

TIP: Enable loading dsp modules

diff --git a/init.rc b/init.rc
index 57bf9bc..dacc2de 100644
--- a/init.rc
+++ b/init.rc
@@ -124,6 +124,12 @@ loglevel 3
     chmod 0777 /dev/video2
     chmod 0777 /dev/omap-resizer
 
+# loading dsp modules
+    insmod /system/ti-dsp/cmemk.ko "phys_start=0x84700000 phys_end=0x85900000 allowOverlap=1 useHeapIfPoolUnavailable=1"
+    insmod /system/ti-dsp/dsplinkk.ko
+    insmod /system/ti-dsp/lpm_omap3530.ko
+    insmod /system/ti-dsp/sdmak.ko
+
 # create basic filesystem structure
     mkdir /system/etc/wifi 0770 system wifi
     chmod 0770 /system/etc/wifi

TIP: Use partition 3 as media data.

diff --git a/vold.fstab b/vold.fstab
index fc83907..b58f21f 100644
--- a/vold.fstab
+++ b/vold.fstab
@@ -1,2 +1,2 @@
-dev_mount sdcard /mnt/sdcard auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc0
+dev_mount sdcard /mnt/sdcard 3 /devices/platform/mmci-omap-hs.0/mmc_host/mmc0

Download the TI DVSDK package to the external/ti-dsp folder manually from the table in webpage http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_4_00/latest/index_FDS.html. Registration might be needed.

  • For DM37xx platform, download dvsdk_dm3730-evm_4_01_00_09_setuplinux package;
  • For OMAP35xx platform, download dvsdk_omap3530-evm_4_01_00_09_setuplinux package.
$ cp <dvsdk package> external/ti-dsp

Now build for your target product, do

source build/envsetup.sh
lunch igepv2-eng
make TARGET_PRODUCT=igepv2 -j8 OMAPES=(2.x|3.x|5.x)

Set OMAPES variable to install proper version of SGX drivers (Default is 3.x):

  • OMAPES=2.x, for OMAP3530 ES1 or ES2;
  • OMAPES=3.x, for OMAP3530 ES3.0;
  • OMAPES=5.x, for DM37x

Next step is create a tarball containing the rootfs

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

Create a SD card

$ wget http://downloads.igep.es/binaries/x-loader/v1.4.4-1/x-load-1.4.4-1.igep0020-sdcard.bin.ift
$ wget http://downloads.igep.es/binaries/u-boot-arm/v2010.06-1/u-boot-arm-2010.06-1.igep0020.bin
mmc init 0
fatload mmc 0 80200000 uImage
setenv bootargs 'mem=71M@0x80000000 mem=384M@0x88000000 console=tty0 console=ttyS2,115200n8 \
       androidboot.console=ttyS2 root=/dev/mmcblk0p2 rw rootfstype=ext3 init=/init rootwait ip=off \
       omap_vout.vid1_static_vrfb_alloc=y omapdss.def_disp=lcd-70 omapfb.mode=dvi:1280x720MR-16 mpurate=800'
bootm 0x80200000
$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Boot setup script' -d boot.source boot.scr

finally create the sdcard with the mkmmc-android.sh script

$ mkdir Media

copy media files to Media directory

$ wget http://downloads.igep.es/android/froyo-2.2/mkmmc-android.sh
$ sudo ./mkmmc-android.sh <device> x-load-1.4.4-1.igep0020-sdcard.bin.ift u-boot-arm-2010.06-1.igep0020.bin kernel/arch/arm/boot/uImage boot.scr froyo-rootfs.tar.bz2 Media

Warning: Provide the right device name after the script name when you invoke the script. If you get this wrong it can wipe your HDD.

Android Eclair 2.1 Platform

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
Build Android Eclair from sources

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:

$ mkdir android
$ cd android
$ 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 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
Links and resources

--- That's all folks ---