The CWM for Ouya project

Search This thread

mybook4

Senior Member
Apr 3, 2011
445
267
Backup worked fine, flash worked and I'm booting now to make sure it put the files where it was supposed to and see if they work. Then i'll reboot and restore and make sure those files go away.One thing to note is that when i choose reboot system now it asked me to disable recovery flash,so I took the plunge and said yes, we'll see if it goes back to stock or not...

It rebooted to stock recovery, as I expected, so still haven't flashed it just yet.

Yeah, I think install_recovery.sh is run on startup (init.rc of the kernel ramdisk tells it to run). I think we need to rename /system/recovery-from-boot.p to recovery-from-boot.bak in order to prevent the overwriting of the recovery partition.

UPDATE: Sure enough, that's what it was. I performed the following and now I have successfully flashed CWM to my recovery partition. I can reboot and it stays there.

1) adb shell
2) su
3) mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
4) cd /system
5) mv recovery-from-boot.p recovery-from-boot.bak
6) exit
7) exit
8) adb reboot bootloader
9) fastboot flash recovery OuyaCWMRecovery.img
10) fastboot reboot
11) adb reboot recovery


NOTE: The updates issued by Ouya simply format the whole system partition and write an updated system partition. If you receive an update from Ouya, it will undo the change I described above and flash the stock recovery over CWM. Kind of annoying. We could prevent this from happening by turning off updates (I'm not sure how to do this yet). When Ouya releases an update, we could take the update.zip and modify it so that CWM wouldn't be overwritten. Not a huge deal.

Sent from my SCH-I535 using xda premium
 
Last edited:
  • Like
Reactions: Notfast

professorpoptart

Senior Member
Jul 7, 2010
166
110
The .zip I built said it flashed correctly (unless i'm reading wrong the parts i could see with the overscan problems i'm having) but the files did not go to /system/app. I have attached the .zip file to see if I did something wrong with it

Looks like the update script is mounting /dev/block/mmcblk0p2 as system. Shouldn't this be /dev/block/mmcblk0p3

edit:
probably need to add this too.
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
 
Last edited:

mybook4

Senior Member
Apr 3, 2011
445
267
Looks like the update script is mounting /dev/block/mmcblk0p2 as system. Shouldn't this be /dev/block/mmcblk0p3

Yeah you definitely don't want to do that! 0p2 is LNX (the kernel). I'm surprised it even booted after that flash! Skywalker, if you run into problems booting, let me know. We can fix it.

Better to do the following:

mount("ext4", "EMMC", "/dev/block/platform/sdhci-tegra.3/by-name/APP", "/system");

We know APP is the /system parition.
 
Last edited:

professorpoptart

Senior Member
Jul 7, 2010
166
110
with the music zip, once the right fstab is built into the recovery, wonder if we can just flash the regular gapps.zip and get the play store.

---------- Post added at 05:21 PM ---------- Previous post was at 05:10 PM ----------

We could prevent this from happening by turning off updates (I'm not sure how to do this yet). When Ouya releases an update

could edit the build.prop and change the ro.update_url= to localhost or something? put it in an install.zip...
 

professorpoptart

Senior Member
Jul 7, 2010
166
110
worth a shot. If no one has tried it by the time I make it home I'll try modifying the gapps zip to mount

I'm hoping we don't have to edit the gapps script at all, I think that update script uses fstab to mount system, so as long as recovery is correct I'm hoping it just works.

edit: is there a post with the new recovery build? The only one I see looks like its before the post where it had the right fstab...
 
Last edited:

sonofskywalker3

Senior Member
Jan 22, 2009
812
460
I see what you mean, The updater-script for the gapps just mounts system, doesn't say where it is. like i said, for music.zip i just downloaded a sample from a tutorial and added the files, mostly to see if the flash would happen. My restore worked perfectly, so I'm going to flash gapps now. cross your fingers!

Note that mybook4's CWM recovery.img from post 16 is what I'm using.
 
Last edited:

mybook4

Senior Member
Apr 3, 2011
445
267
I see what you mean, The updater-script for the gapps just mounts system, doesn't say where it is. like i said, for music.zip i just downloaded a sample from a tutorial and added the files, mostly to see if the flash would happen. My restore worked perfectly, so I'm going to flash gapps now. cross your fingers!

Note that mybook4's CWM recovery.img from post 16 is what I'm using.

I noticed someone thanked the post with the music zip. Might want to take that down before someone else flashes it.

Sent from my SCH-I535 using xda premium
 

sonofskywalker3

Senior Member
Jan 22, 2009
812
460
Thanks for the heads up. So i flashed gapps, flash worked fine, it booted up, did the "your OUYA is upgrading" thing for a bit, then setupwizard.apk crashed. I deleted setupwizard.apk from system/app and the launcher popped up, and there was google play. I opened it, and was greeted by the welcome site of the "add a gmail account" wizard. I put in my account info with no problems, but then, alas, google play crashed. Now whenever I reboot I get the "Your OUYA is upgrading" and it optimizes apps for about 45 seconds. I also get 5-8 popups saying the process "com.google.process.gapps" has stopped, and google play store has stopped before it settles down.

I have attached a copy of the 4.1.2 gapps.zip with setupwizard.apk removed for your convenience.

https://dl.dropboxusercontent.com/u/7653846/gapps-OUYA-alpha1.zip
 

mybook4

Senior Member
Apr 3, 2011
445
267
So it sounds like the cwm recovery works well. I'll post some final instructions and we can open a new thread for getting the Play store working.

Sent from my SCH-I535 using xda premium
 

sonofskywalker3

Senior Member
Jan 22, 2009
812
460
So it sounds like the cwm recovery works well. I'll post some final instructions and we can open a new thread for getting the Play store working.

Sent from my SCH-I535 using xda premium

I'd suggest for the sake of ease, you go ahead and post a new thread we can get stickied with the method to install CWM, and the recovery.

I'm currently working on a "getting started" package to flash to a stock ouya once cwm is installed that will include the basics like Hulu, Netflix, Nova Launcher, Pandora, Play Music, ES File Explorer, and the Amazon App Store. I'll play more with the Play store later and start a new thread unless you beat me to it.
 

CptTwinkie

Senior Member
Sep 1, 2010
160
24
Prague
I don't know if you guys noticed yet but your work was featured on xda tv. Good job and thank you.

~L.T.
Sent from my Galaxy S3 [AT&T][CM10.1]
Galaxy S Captivate [CM10.1]
Nexus 7 [CM10.1]
OUYA [Stock Rom...for now]
 

TadeoNYC

Senior Member
May 9, 2013
281
50
New York
Congrats on getting some well deserved recognition. Let's all keep our fingers crossed that you will make repeat appearances as development progresses on the Rom

Sent from my GT-P3113 using Tapatalk 4 Beta
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    Well, since i'm not aware of anyone else doing it, and it will be necessary for any real development to occur, I have decided to try porting Clockworkmod Recovery to the Ouya. I am downloading ubuntu right now and I'll start trying to build it from source against our current recovery tonight or tomorrow night depending on how long the setup and prerequisites take.

    The reason I'm posting this now, is to solicit help. I've never built CWM before, but XDA has a really great tutorial I'm going to follow, but if anyone here has had experience in the past I'd love some help/tips, and other than that I would like a few brave souls to volunteer and try flashing it on their Ouya when/if I have a build that works on my own.

    I'll update this thread with my progress, if I make any, and please let me know if any of you are willing to help in any way.

    Update 1:
    I have compiled a version of CWM recovery that theoretically should work, but I'm unable to flash it. I have installed flash_image onto the ouya and it works fine, but i normally would have used "flash_image recovery recovery.img" however there is no "recovery" partition on the ouya. This is what I get:

    ./flash_image recovery recovery.img
    error scanning partitions: No such file or directory

    Mount reveals the following info:

    mount
    rootfs / rootfs ro,relatime 0 0
    tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
    devpts /dev/pts devpts rw,relatime,mode=600 0 0
    proc /proc proc rw,relatime 0 0
    sysfs /sys sysfs rw,relatime 0 0
    debugfs /sys/kernel/debug debugfs rw,relatime 0 0
    none /acct cgroup rw,relatime,cpuacct 0 0
    tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
    tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
    none /dev/cpuctl cgroup rw,relatime,cpu 0 0
    /dev/block/platform/sdhci-tegra.3/by-name/APP /system ext4 ro,relatime,user_xatt
    r,acl,barrier=1,data=ordered 0 0
    /dev/block/platform/sdhci-tegra.3/by-name/CAC /cache ext4 rw,nosuid,nodev,noatim
    e,errors=panic,user_xattr,acl,barrier=1,journal_async_commit,nodelalloc,data=wri
    teback 0 0
    /dev/block/platform/sdhci-tegra.3/by-name/UDA /data ext4 rw,nosuid,nodev,noatime
    ,errors=panic,user_xattr,acl,barrier=1,journal_async_commit,nodelalloc,data=writ
    eback 0 0
    /dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1
    023,default_permissions,allow_other 0 0

    This is the script from the OTA update:
    #!/system/bin/sh
    if ! applypatch -c EMMC:/dev/block/platform/sdhci-tegra.3/by-name/SOS:5906432:f80238c4f4a53888b547e4463fb4751343f23412; then
    log -t recovery "Installing new recovery image"
    applypatch EMMC:/dev/block/platform/sdhci-tegra.3/by-name/LNX:5277696:5d7013bf98f76199ea5b7d7d8baeb07fa3ad26ff EMMC:/dev/block/platform/sdhci-tegra.3/by-name/SOS f80238c4f4a53888b547e4463fb4751343f23412 5906432 5d7013bf98f76199ea5b7d7d8baeb07fa3ad26ff:/system/recovery-from-boot.p
    else
    log -t recovery "Recovery image already installed"
    fi

    but I can't make any sense of it. If anyone can help out i'd much appreciate it...
    4
    Some definite info:
    • SOS is recovery
    • OUYA firmware updates patches the boot partition on the fly (binary patching) - silly and error prone, but *shrug*. Don't need apply patch at all. dd is fine
    • It's much safer to use 'fastboot boot recovery.img' while in fastboot mode. This allows loading recovery or boot.img's into ram and execute them from there. Once that works 100%, you can flash it to SOS.
    • As most people already know, it's not possible to force the device into recovery. It has to be done with something like 'adb reboot recovery'.


    I did the following with skywalker's recovery.

    1) Attached a usb keyboard to the Ouya's full size usb port
    2) Attached my computer to the Ouya's micr usb port
    3) Ran "adb reboot bootloader" (the Ouya rebooted to a blank screen)
    4) Waited 30 seconds and ran "fastboot boot recovery.img" (skywalker's recovery file)

    The Ouya rebooted into CWM Recovery v6.0.3.2!
    Error messages were encountered on the recovery screen (image attached)

    5) Navigated around CWM with the arrow keys and the enter key
    6) Rebooted with "reboot system now". Ouya booted right up.


    When we flash the recovery to mmcblk0p1, we should rename /system/etc/install-recovery.sh (and maybe /system/recovery-from-boot.p) to prevent the recovery partition from being overwritten.

    Looks like we need to adjust the recovery so it properly mounts the partitions. Hopefully after that we are good to go.
    3
    Some definite info:
    • SOS is recovery
    • OUYA firmware updates patches the boot partition on the fly (binary patching) - silly and error prone, but *shrug*. Don't need apply patch at all. dd is fine
    • It's much safer to use 'fastboot boot recovery.img' while in fastboot mode. This allows loading recovery or boot.img's into ram and execute them from there. Once that works 100%, you can flash it to SOS.
    • As most people already know, it's not possible to force the device into recovery. It has to be done with something like 'adb reboot recovery'.
    2
    Here's the recovery.fstab from my Ouya's recovery partition.

    # mount point fstype device

    /recovery emmc /dev/block/platform/sdhci-tegra.3/by-name/SOS
    /boot emmc /dev/block/platform/sdhci-tegra.3/by-name/LNX
    /system ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
    /cache ext4 /dev/block/platform/sdhci-tegra.3/by-name/CAC
    /misc emmc /dev/block/platform/sdhci-tegra.3/by-name/MSC
    /staging emmc /dev/block/platform/sdhci-tegra.3/by-name/USP
    /metadata emmc /dev/block/platform/sdhci-tegra.3/by-name/MDA
    /data ext4 /dev/block/platform/sdhci-tegra.3/by-name/UDA
    /sdcard vfat /dev/block/platform/sdhci-tegra.0/by-num/p1

    I tried doing CWM build with this recovery.fstab. /system, /data, and /cache all mounted.
    Couldn't mount /sdcard automatically (trying to choose zip from sdcard) or manually (in mounts and storage, mount /sdcard).


    I tweaked the recovery.fstab to the following:

    /recovery emmc /dev/block/platform/sdhci-tegra.3/by-name/SOS
    /boot emmc /dev/block/platform/sdhci-tegra.3/by-name/LNX
    /system ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
    /cache ext4 /dev/block/platform/sdhci-tegra.3/by-name/CAC
    /misc emmc /dev/block/platform/sdhci-tegra.3/by-name/MSC
    /staging emmc /dev/block/platform/sdhci-tegra.3/by-name/USP
    /metadata emmc /dev/block/platform/sdhci-tegra.3/by-name/MDA
    /data ext4 /dev/block/platform/sdhci-tegra.3/by-name/UDA
    /sdcard datamedia /dev/null

    This one mounted /sdcard correctly. I can "choose a zip from sdcard". I didn't actually choose a zip yet. I didn't format any of the partitions. I suppose we could try making a quick cwm zip to write something to the sdcard to test it out.


    I've attached the stock Ouya recovery.img (from SOS partition). THIS IS NOT A CWM FLASHABLE ZIP, it only contains a zipped up version of the stock recovery.img. The md5 hash of the unzipped recovery.img is a6c1a6962984e9080ed8821628c4cc3f.


    I've attached the CWM recovery.img that worked for me. THIS IS NOT A CWM FLASHABLE ZIP, it only contains a zipped up version of a newly built CWM recovery.img. The md5 hash of the unzipped recovery.img is c6b37906f280b16cd200503c3cde6dfb.
    1
    New thread created with working CWM recovery. See http://xdaforums.com/showthread.php?p=41835959