[Tilt, TyTN II, MDA Vario III Android Development] Niscandia:
Ok, You can run android on an SD card with 3 partitions.

1) Sdcard - Fat32 only (could change, but allows windows machines access)
2) Data - Any good permissions based system
3) System - Any good permissions based system

At this time they are setup as such since that is the way the script is done already, in addition to that Windows only shows the first partition.

If you still want to go this route, then you'll need access to a Linux box. If you don't have one, I would suggest VMware Player ( http://www.vmware.com/products/player/ ) since it is free, and you can give the Virtual Machine direct access to USB devices.

Second you'll need a SD card reader, or take a look online and you'll have to figure out how to use the Kaiser as a SD card reader... but I haven't done that....

Once you have your SD card mounted in Linux. You will need to wipe/resize the current partition. Then add in the two new ones. There is a lot of debate on if you should use a journaling filesystem (ext3 as an example) or a none journaling (ext2) or a filesystem designed for flash memory. Only thing I can say, is that it seems as if the data.img is done in ext3 mounted as an ext2.... (this is just an warning I've been noticing durning boot)

Now that your SD card is setup with the partitions, you need to copy the contents of data.img and system.img over. This is done by mounting them as a loop back.

mount -o loop /where/to/mount /image/file

Of coarse replace "/where/to/mount" and "/image/file" with where you want the image to be mounted, and where the image is located.

Most of the modern Linuxes will auto mount all three partitions from your SD card. So from that you'll have to find where they are mounted.

With that, now to copy the files over. This is done with:

cp /source/files /destination/location -r -p

With that done, your SD card is now useable. Without needing data.img or system.img. Also make sure you do NOT put data.gz in the root of partition 1 (the fat32, where everyone tells you to put it) This will "reformat" your data partition to be the same size as data.gz.... not a good idea, and it seem a little unstable doing it that way....

All that aside, now the annoying part. The initrd.gz needs to have one file modified.

Good post from Dcordes, that with out I would have never gotten it to work. If you get errors when you do the commands, that means you don't have enough permissions to extract all the files. So you will probably have to do it as root and thus do:

sudo gunzip initrd.gz && cpio -i < initrd

Make sure to do these commands in a nice clean folder, where there isn't any files. Otherwise they will get packaged up into your initrd.gz and cause some excess clutter.

Now one thing that Dcordes doesn't mention, is that at least for me, the file initrd (the unziped initrd.gz) is still left in the directory. Move, or delete it before you repackage the initrd.gz (other wise you'll be like me and wondering why your initrd.gz is double the size....)

With all of that unpacked, just look for "init". Now open init, in your favorite text editor (if you don't have one and are still on the command line, just do "vi init")

The section your looking for is:

#if [ "`cat /sys/block/mmcblk0/mmcblk0p2/size`" = "132240" ] ; then
#	PARTITIONED=1
#	echo "Data Partition Found"
#else
PARTITIONED=0
#fi

This is the area I've complained abit about. The # makes the entire line a comment, and is a semi-recent change. Thus commenting out the entire area we need to mount a secondary partition. (though the line made it almost impossible to mount the secondary partition as it is anyways... so it might as well have been commented out)

We need to change it to:

if [ "`cat /sys/block/mmcblk0/mmcblk0p2/size`" -ge "1" ] ; then
PARTITIONED=1
echo "Data Partition Found"
else
PARTITIONED=0
fi

And for the system partition, add in just under it:

if [ "`cat /sys/block/mmcblk0/mmcblk0p3/size`" -ge "1" ] ; then
SYSPARTITIONED=1
echo "System Partition Found"
else
SYSPARTITIONED=0
fi

Now with out any further changes, it will try mounting the second partition as the data partition and as ext2.

The next part of the code to look for is:

losetup /dev/block/loop1 /sdcard/system.img
[ $? -eq 0 ] || fail "Failed to find system.img on SD Card"
mount -t cramfs -o ro,noatime,nodiratime /dev/block/loop1 /system
[ $? -eq 0 ] || fail "Failed to mount /system"

if [ $PARTITIONED = "0" ] ; then
losetup /dev/block/loop0 /sdcard/data.img
[ $? -eq 0 ] || fail "Failed to find data.img on SD Card"
/bin/e2fsck -y /dev/block/loop0
mount -t ext2 -o noatime,nodiratime /dev/block/loop0 /data
else
/bin/e2fsck -y /dev/block/mmcblk0p2
mount -t ext2 -o noatime,nodiratime /dev/block/mmcblk0p2 /data
fi

and changed to

if [ $SYSPARTITIONED = "0" ] ; then
losetup /dev/block/loop1 /sdcard/system.img
[ $? -eq 0 ] || fail "Failed to find system.img on SD Card"
mount -t cramfs -o ro,noatime,nodiratime /dev/block/loop1 /system
[ $? -eq 0 ] || fail "Failed to mount /system"
else
/bin/e2fsck -y /dev/block/mmcblk0p3
mount -o noatime,nodiratime /dev/block/mmcblk0p3 /system
fi

if [ $PARTITIONED = "0" ] ; then
losetup /dev/block/loop0 /sdcard/data.img
[ $? -eq 0 ] || fail "Failed to find data.img on SD Card"
/bin/e2fsck -y /dev/block/loop0
mount -t ext2 -o noatime,nodiratime /dev/block/loop0 /data
else
/bin/e2fsck -y /dev/block/mmcblk0p2
mount -o noatime,nodiratime /dev/block/mmcblk0p2 /data
fi

With this save the init file (":wq" in vi) and repackage it and test it out.

To repackage use the command quoted above:

find ./ | cpio -H newc -o | gzip > ../my-initr-android-with-custom-stuffs.cpio.gz

Now after doing all of this and launching Android. IF you get stuck at the little green guy just flashing, and it never gets past that, means you repacked (or worst case, unpacked) the initrd.gz wrong.

And just in case people don't want to go in and mess with the initrd.gz, I have repatched the one that Dzo included in his package. So it should work with the new gpu system.img and zimage.

http://rapidshare.com/files/227985396/initrd.gz

Rather long post, but hope it helps.