Embedded Linux Encounters

A peek in to the world of Embedded Linux and stuff

  • Linux is addictive, I'm hooked!

         Geek@WastingTime>

Porting Android

Posted by Vaisakh P S On 7:54 PM 1 comments

Android build system by default generates few YAFF2 File system Images, which can be flashed on devices running in NAND flash. Since the platform which I was working on did not have a NAND flash on board. The images had be made available to Kernel in some other storage devices like NOR flash, SDCARD or USB Memory Stick.


There will be three out put images of the build process:
  • Root - A small image in order kilo bytes, with basic utilities and init script to bring rest of the system up.
  • System - Contains the Android specific programs and related libraries. The size will be some where around 40 to 50 Mega Bytes (for default configuration) depending on the build configuration.
  • Data - Will be a blank file system initially, but as system boots up, relevant information will added.
Like every other Linux Root file system image, there is an init script, (format is different from standard init script). Here comment out of the portion of script which mounts the yaffs2 file system like this:
#mount yaffs2 mtd@system /system
#mount yaffs2 mtd@system /system ro remount
#mount yaffs2 mtd@userdata /data nosuid nodev

For bringing up the required file system, an SDCARD base storage system was decided. The sdcard was partitioned in to four ext2 partitions. Here is the partition layout
Partition #1 : Root file system generated from BuildRoot
Partition #2 : Root file system generated from Android
Partition #3 : System partitions generated from Android
Partition #4 : Data partition to be used to Android.

The Linux system was be booted up with Partition#1 as root. Then Partitions 2, 3 and 4 are mounted like this
mount /dev/mmcblk0p2 /media/mmc
mount /dev/mmcblk0p3 /media/mmc/system
mount /dev/mmcblk0p4 /media/mmc/data
Using the 'chroot' command the root will be changed to Partition#2 hence initiating startup of Android:
chroot /media/mmc /init
NOTE

  • Ensure that the system and data directories are given global read, write and execute permission.
  • To interface touch screen with Android, make use modifications in Android Input System code to make use of the calibration corrections obtained using TsLib. (Refer previous post)

Categories: , ,

1 Response for the "Porting Android"

  1. More info is available in the following pages

    http://elinux.org/Android_on_OMAP
    http://free-electrons.com/blog/android-beagle/

Post a Comment