[Atrix 4G Android Development] sendust7:
This project is intended mainly for those interested in trading the near plug-and-play convenience of a dual boot flashable zip for increased flexibility when experimenting with different ROMs.

Users may also be interested in comparing the performance of identical ROMs hosted on different physical devices. Others may want to configure their emmc-based ROM, clone to SD and then flush emmc to host their entire system on removable media.

Preliminaries

Unlocked phone with fully charged, healthy battery and ClockWorkMod (CWM) Recovery 5.0.2.0 installed.

Instructions

1. Boot to primary ROM to ensure that correct boot image is flashed, though it is not necessary with the initial release of clone ROM zip.

2. Boot to CWM and connect phone to computer.

3. Partition SD card to host ROM. There are many ways to do this, but the most convenient is “SmartPart”: http://xdaforums.com/showthread.php?t=1651356 .

If you're already dual booted, this step shouldn't be necessary unless you are cloning a “heavy” ROM that doesn't quite fit. If so, you can modify SmartPart to increase the size of your SD ext partitions at the expense of further downsizing FAT32. I did this when porting NottachTrix 1.3.1 to SD.

4. Flash Clone-ROM-to-SD-Card-signed.zip : http://www.mediafire.com/?ara2r3174cb9yir

This will, in sequence: a) Backup any existing SD card-based ROM, b) wipe all three ROM partitions on SD card (it does not touch your FAT32), c) push primary ROM /system, /cache and /data to SD card and d) push ROM boot image to /tmp/boot.img. That's all for now --- see Note below. The entire process can take 15-20 minutes depending mainly on prior existence of SD ROM partitions, ROM size and performance of SD card.

Faster (no SD ROM backup) Clone-ROM-to-SD-Card-No-BK-signed.zip: http://www.mediafire.com/?kbaowagqmnu6k5o

Note: In the clone zip “updater-script”, there is a block of source code commented out. I was trying to modify the boot image, but CWM does not appear to support the "unpackbootimg" and "mkbootimg" executables. And CWM's “busybox awk” does not include the gawk extensions required to adequately support binary file processing. Another (smaller) problem is that the user has no direct knowledge as to which boot image is being modified unless that image is manually inserted into the zip prior to flash, or user boots to primary ROM before cloning. So, for now I am content with modifying boot image ramdisks offline using Perl on my Ubuntu 12.04 laptop.

5. User modifies ROM boot image offline to redirect /system, /cache and /data mounts from emmc to sdcard (just three lines of code in “init.olympus.rc”). For example if ROM = Neutrino V2.8 GT, modify Neutrino GT boot image to create “boot-Neutrino-V2.8-GT-sdcard.img”. See my Auto-Modify Boot Image thread here: http://xdaforums.com/showthread.php?t=1766939

Here are sample boot images ported to SD card:

boot-Neutrino-V2.8-GT-sdcard.img: http://www.mediafire.com/?oudm9qm5a0d7glh

boot-NottachTrix-1.3.1-att-sd-ext.img: http://www.mediafire.com/?nok6hp4rl5e92h6

Faux-CM7-1.00GHz-026b1boot-sdcard.img: http://www.mediafire.com/?fesm0hff58pnv28

6. Power down, enter fastboot and flash modified boot image, for example:

root@ubuntu:~/Desktop# fastboot flash boot boot-Neutrino-V2.8-GT-sdcard.img

sending 'boot' (2963 KB)...

OKAY [ 0.210s]

writing 'boot'...

OKAY [ 0.266s]

finished. total time: 0.476s

root@ubuntu:~/Desktop# fastboot reboot

rebooting...

finished. total time: 0.000s

root@ubuntu:~/Desktop#

After boot-up to SD, you can cross-verify that Neutrino-V2.8 was indeed cloned to sdcard by entering the android “mount” command via ADB or on phone using Terminal Emulator:

rootfs on / type rootfs (ro,noatime,nodiratime)
tmpfs on /dev type tmpfs (rw,noatime,nodiratime,mode=755)
devpts on /dev/pts type devpts (rw,noatime,nodiratime,mode=600)
proc on /proc type proc (rw,noatime,nodiratime)
sysfs on /sys type sysfs (rw,noatime,nodiratime)
tmpfs on /mnt/asec type tmpfs (rw,noatime,nodiratime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,noatime,nodiratime,mode=755,gid=1000)
[COLOR="Blue"]/dev/block/mmcblk1p2 on /system type ext4 (rw,noatime,nodiratime,errors=continue,barrier=0,nobh,data=writeback,noauto_da_alloc,discard)
/dev/block/mmcblk1p4 on /data type ext4 (rw,nosuid,nodev,noatime,nodiratime,barrier=0,nobh,data=writeback,noauto_da_alloc,discard)
/dev/block/mmcblk1p3 on /cache type ext4 [/COLOR](rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,nobh,data=writeback,noauto_da_alloc,discard)
/dev/block/mmcblk0p13 on /osh type ext4 (rw,nodev,noatime,nodiratime,barrier=1,data=ordered,noauto_da_alloc)
/dev/block/loop0 on /pds type ext3 (rw,noatime,nodiratime,data=ordered)
/dev/block/vold/179:33 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0602,dmask=0602,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:33 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0602,dmask=0602,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,relatime,size=0k,mode=000)
/dev/block/vold/179:18 on /mnt/emmc type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0602,dmask=0602,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

Benchmarks (CF Bench)

Identical ROMs (Neutrino V2.8 GT) hosted on emmc and Class 6 SD card. Guess which one is SD ROM...

Standard disclaimers apply. In short, I am not responsible for any harm you or your phone may incur by using any or all of this material.

Many thanks to Notorious544d and CM/Photon/Atrix/Android dev teams for their excellent ROMs, hatefuel19 for porting NottachTrix to SD, Koush (CWM and AnyKernelUpdater) and Always_Jonezen for offering the clone-to-SD concept.