All Board Android Without Ramdisk

Document created by jesseg Employee on Aug 6, 2012Last modified by Jodi Paul on May 16, 2013
Version 10Show Document
  • View in full screen mode

Ramdisk is unnecessary thing for some embedded systems, but it's required for Android


You can develop an Android system with no ramdisk (initrd/initramfs), just follow these steps:


1) Remove RAMDISK support from kernel:

General setup  --->
            [ ] Initial RAM filesystem and RAM disk (initramfs/initrd) support

Create a single rootfs:

cd myandroid/out/target/product/imx51_BBG

mkdir rootfs
sudo cp -a system rootfs/
sudo cp -a root/* rootfs/
sudo cp -a recovery rootfs/

Since you are using a single filesystem, then comment out these lines from rootfs/init.rc:

#mount ext3 /dev/block/mmcblk0p2 /system
#mount ext3 /dev/block/mmcblk0p2 /system ro remount
#mount ext3 /dev/block/mmcblk0p5 /data nosuid nodev
#mount ext3 /dev/block/mmcblk0p6 /cache nosuid nodev

Create just one partition into your MMC or Flash memory:

  • Partition 1: 200MB+ as EXT3 will be used as system(rootfs). Remember to skip 4MB to save kernel.

It is a good idea to create a second partition (VFAT) to mount as /data to save user files.

Mount that "system" partition and copy all content of rootfs:

sudo mount /dev/sdb1 -t ext3 /mnt
sudo cp -a .../target/product/imx51_BBG/rootfs/* /mnt
sudo umount /mnt

Now just setup your bootloader parameter correctly (i.e. MMC Partition 1):

setenv bootargs_base 'setenv bootargs root=/dev/mmcblk0p1 rootfstype=ext3 console=ttymxc0,115200 noinitrd'