[Touch CDMA General] zenulator:
I figured I would start a tutorial thread. If you have some tutorials or instructions you would like to share then post them. Also post links to other helpful posts and threads.

Basic instructions for building an android squashfs system image:

First you need a Linux installation. I use Ubuntu 9.04 and run as the root user.

You need to have squashfs-utils installed. I have version 3.3 installed.

You need the android version of genext2fs. You might want to chmod this to executable before using it.

Starting simple download the ion 1.5 build or any other build that works on vogue as a base.

If the base image your using is a system.img then it's cramfs. You can mount this image and pull from it. Enter android-builds directory and create a tmp directory for mounting the image and a mount point in that tmp dir.

mkdir tmp
mkdir tmp/cram-sys
mount -o loop system.img tmp/cram-sys

The system.img should be mounted on tmp/cram-sys

Now you have a base system image to grab files from.

If you have a system.sqsh then it is a little easier to do.

Put the system.sqsh in a working directory like base-rom in your android-builds directory and while in the directory from a terminal execute:

unsquashfs system.sqsh

This will create a directory called squashfs-root.

Then download a build from the dream forums on xda.

Usually they come in update.zip format. Extract the zip to a working directory like android-builds/foo

Inside you should see some directories mainly data and system is what you are after.

Look inside the data folder for any app or app_s directories. Copy those apps to the system/app directory. Leave out any unnecessary apps like wifi tether and so on.

In the system directory is another directory called lib. You need to take out libaudio.so libaudioflinger.so libgps.so. Depending upon the build the vogue specific libraries are either in /lib or /lib/donut in the rootfs. We take these out of system/lib because they cause conflicts. Another way around this is to copy the vogue specific libraries to system/lib.

In the system directory is another directory called etc. You need to replace apns.conf with the one from a working vogue android build.

Depending on the build you are porting you will need to modify system/bin and system/xbin. I usually add any missing files to the new image and base the missing files off of the ones in the android 1.5 ion build.

After this you need to edit your build.prop in the system directory. Look at the ion cupcake 1.5 or a donut build with market fix for reference depending on the build you are porting.

The last step is to put a .build file in the system directory. This depends on the build type.

donut.build

ion.build

rogers.build

hero.build

After you've modified the system directory you need to use genext2fs to create an android specific ext2 image.

for cupcake/donut images

genext2fs -d ./system -b 80000 -a system.ext2

this will make ~80mb ext2 system image.

for hero/sense ui builds a larger image is required

genext2fs -d ./system -b 160000 -a system.ext2

This system.ext2 is now bootable and you should be able to copy it to your sdcard and run it.

To turn this into a system.sqsh you need to mount it

mkdir tmp/system-ext2-mnt
mount -o loop system.ext2 tmp/system-ext2-mnt

Then make a squashfs image of the mounted directory

mksquashfs tmp/system-ext2-mnt/ system.sqsh

Build scripts/environment from loserskater:

http://xdaforums.com/showthread.php?t=585452