[Ouya Android Development] Trooper_Max:
For anyone who doen't have a Linux box handy or an extra thumb drive to boot a live USB, here are some quick instructions on how to partition the thumb drive from the OUYA itself. You can connect the thumb drive either before or after booting, it doesn't really matter. I'm using all fastboot/adb commands here so they are easy to recognize. If you're knowledgeable about how to use adb/fastboot, feel free to execute the commands however you're comfortable.

Type all the adb/fastboot commands as specified - if it doesn't begin with adb or fastboot, it isn't a command. All /dev paths you type into the commands should be related to /dev/block/sda (your thumb drive), not any internal partitions or you could mess up your OUYA!!!

Boot up the OUYA normally, then reboot into the bootloader:

adb reboot bootloader

Boot CWM using fastboot:

fastboot boot OuyaCWMrecovery6.0.3.2.img

Print partition information for the thumb drive:

adb shell parted /dev/block/sda print

(note in the example output above I already have it partitioned)

Here I was using an 8 GB thumb drive, you can see the size where it says 8128MB.

Delete Partitions from thumb drive: (be sure you don't have anything important on your thumb drive)

adb shell parted /dev/block/sda rm 1

adb shell parted /dev/block/sda rm 2

adb shell parted /dev/block/sda rm 3

(note that you only need to delete partitions that showed up in the table when you printed it, here I deleted 1,2,3, since I had 3 partitions above and the parted commands will say you may need to update your fstab, but that is not relevant here so don't worry about it)

Create 3 primary partitions (adjust the sizes as necessary):

adb shell parted /dev/block/sda mkpart primary 1 6000

adb shell parted /dev/block/sda mkpart primary 6000 7000

adb shell parted /dev/block/sda mkpart primary 7000 8128

Check your paritions again:

adb shell parted /dev/block/sda print

Format your partitions as ext4:

adb shell mke2fs -t ext4 /dev/block/sda1

adb shell mke2fs -t ext4 /dev/block/sda2

adb shell mke2fs -t ext4 /dev/block/sda3

Push the cm10 system image onto the device: (this will take a little while)

adb push ouya-cm10-system.img /tmp/ouya-cm10-system.img

Check that it copied correctly:

adb shell ls -l /tmp

(Note the size... I'm pretty sure copying it /tmp put it into the ramdisk, but our OUYA has enough ram for this)

Write the cm10 system image onto /dev/block/sda2: (this will take a little while)

adb shell dd if=/tmp/ouya-cm10-system.img of=/dev/block/sda2 bs=4M

Check/fix the filesystem:

adb shell e2fsck -fp /dev/block/sda2

Resize the filesystem to fill the partition:

adb shell resize2fs /dev/block/sda2

(Unfortunately, it looks like resize2fs is not included in CWM, so this step would need to be done on the computer)

At this point, the thumb drive should be good, so you just gotta reboot back to the bootloader and boot the boot image:

Reboot to the bootloader again:

adb reboot bootloader

Boot the modified boot image I provided:

fastboot boot ouya-sda123-boot.img

Not sure if that's necessarily easier or harder to follow than the other instructions... I'd probably rather do the partitioning on a desktop with GUIs, but for some who don't have a Linux box handy it might be easier to use the OUYA as a little Linux box ;)

I'm sure you noticed this method still used dd to write the system image, just run from the OUYA instead. I looked into just extracting the system files from the CM10 zip onto the OUYA, but fixing the permissions was not as easy as I thought it would be - the /system partition permissions are actually fixed by the updater script as referred to here:

http://fokke.org/site/content/howto-create-android-updatezip-package

It's actually a scripting language and the script also creates symlinks and does other stuff.

You'd have to extract/modify the updater script to not use the internal partitions and then execute it (I think using the edify program)... still less straightforward than using dd if you have the image handy like I gave you... But I may look into this as another option. The knowledge will certainly be relevant when I look to build a custom CWM recovery to allow you to flash zips to the thumb drive instead of the internal partitions.

~Troop