[Samsung Galaxy Nexus] dlhxr:
Step 3: How to Modify the updater-script in the Flashable Zip Installer.

Part I: Image Boot

Firstly, add following lines below the first line. assert(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro");

unmount("system");
unmount("data");
unmount("cache");
run_program("/sbin/mkdir", "/rdata");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/rdata");

Replace the following line

mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");

by

run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/rom/system.img");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");

Replace the following lines

format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");

by

run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/rom/system.img");
run_program("/sbin/mke2fs", "-T", "ext4", "/dev/block/loop1");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");

Replace the following line

mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/data");

by

run_program("/sbin/losetup", "/dev/block/loop2", "/realdata/media/rom/data.img");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop2", "/data");

Replace the following line (not include the lines you add at first.)

unmount("data");

by

run_program("/sbin/umount", "-d", "/data");

Replace the following line (not include the lines you add at first.)

unmount("system");

by

run_program("/sbin/umount", "-d", "/system");

Delete the following line

package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");

Add the following line in the end

run_program("/sbin/umount", "/rdata");

Part II: Image Folder Mix Boot

Firstly, add following lines below the first line. assert(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro");

unmount("system");
unmount("data");
unmount("cache");
run_program("/sbin/mkdir", "/realdata");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/rdata");

Replace the following line

mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");

by

run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/2nd/system.img");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");

Replace the following lines

format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");

by

run_program("/sbin/losetup", "/dev/block/loop1", "/rdata/media/2nd/system.img");
run_program("/sbin/mke2fs", "-T", "ext4", "/dev/block/loop1");
run_program("/sbin/mount", "-t", "ext4", "/dev/block/loop1", "/system");

Delete the following line

mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/data");

Delete the following line (not include the lines you add at first.)

unmount("data");

Replace the following line (not include the lines you add at first.)

unmount("system");

by

run_program("/sbin/umount", "-d", "/system");

Delete the following line

package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");

Add the following line in the end

run_program("/sbin/umount", "/rdata");

Modify the orginal line related to data partition. For example.

Replace the following line

package_extract_dir("data", "/data");

by

package_extract_dir("data", "/rdata/media/2nd/data");

Part III: Folder Cache Boot

Modify the updater-script to mount /dev/block/platform/omap/omap_hsmmc.0/by-name/cache to /system.

And rember to wipe your cache in CWM recovery, before apply the zip file.

You can also use twistedumbrella's app Dual-Boot Builder to install the system as folder cache boot system.

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

Delete the following line in updater-script

format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0", "/system");

Delete the following line in updater-script

package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");

Replace the following line in updater-script

mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");

by

mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/cache", "/system");

And replace the package extract for data like this.

package_extract_dir("data", "/data");

To

package_extract_dir("data", "/data/media/2nd/data");