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 BuildRootPartition #2 : Root file system generated from AndroidPartition #3 : System partitions generated from AndroidPartition #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/mmcmount /dev/mmcblk0p3 /media/mmc/systemmount /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
- 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)
More info is available in the following pages
http://elinux.org/Android_on_OMAP
http://free-electrons.com/blog/android-beagle/