[Droid Eris Android Development] bftb0:
I spent some time tonight fooling around with RomManager (v3.0.0.7) and ClockworkMod (v2.5.0.1 for the Eris). Sort of an eye-opener, actually.

The way it works is that it is actually NEVER "FLASHES" ANYTHING TO THE RECOVERY PARTITION. Instead, when you first tap on the menu item to "flash the recovery", what ROM Manager does is identify your handset type, and then downloads some files to

/sdcard/clockworkmod, e.g.:

/sdcard/clockworkmod:

----rwxr-x 1 system sdcard_r 829658 Jan 17 02:23 recovery-update.zip

/sdcard/clockworkmod/download/koush.tandtgaming.com/recoveries:

----rwxr-x 1 system sdcard_r 829658 Jan 17 00:56 recovery-clockwork-2.5.0.1-desirec.zip

/sdcard/clockworkmod/download/rommanager.appspot.com:

d---rwxr-x 2 system sdcard_r 4096 Jan 17 02:23 manifests

/sdcard/clockworkmod/download/rommanager.appspot.com/manifests:

----rwxr-x 1 system sdcard_r 11492 Jan 17 02:23 devices.js

Note that "recovery-update.zip" and "recovery-clockwork-2.5.0.1-desirec.zip" are the same size - less than 1 MB. In fact, they are identical. It is a signed update package - but too small to even contain an Android kernel.

Here's how ROM Manager works: when you press the button "Reboot into Recovery", what actually takes place is this:

- Rom Manager copies "recovery-update.zip" into /cache/update.zip, and then places the following command into /cache/recovery/command

"/sbin/recovery" "--update_package=CACHE:update.zip"

and then executes a "reboot recovery" command.

The next thing that happens is that whatever Custom Recovery that IS ALREADY FLASHED to your recovery partition on the phone boots up, and immediately begins to process the /cache/update.zip file

Here's the $64,000 observation:

This update.zip modifies NOTHING IN FLASH MEMORY - IT ONLY MODIFIES THE RAMDISK OF THE BOOTED RECOVERY ALREADY PRESENT.

Towards the end of the updater-script, it kills off the old /sbin/recovery and /sbin/adbd processes; but since these processes are defined as services, they get restarted automatically, using the new "ClockworkMod" version of these program files. Voila! The ClockworkMod recovery menus pop up.

There are two important observations that arise from this analysis:

- It does not have it's own kernel - it uses the kernel of whatever was already present in the recovery partition boot

- To get ClockworkMod to be cold-bootable, you need to COMBINE IT WITH A KERNEL AND BOOTSCRIPTS FROM SOMEPLACE ELSE - but WHERE exactly?

Now, I don't know if ROM Manager formerly worked in a different fashion - but the point is fairly obvious: if you wanted to provide a rooting method which installs "ClockworkMod" as a recovery - well then, you would need to combine the minimal components of "ClockworkMod" (mostly just the /sbin/recovery program !) with someone else's bootable recovery. And you could not use an HTC stock recovery - because then koush's "update.zip" files would have needed to be signed by HTC in order to get processed.

If you accept the hypothesis that the so-called "Clockwork" brickings have been due to a bug in the kernel MTD driver - and nobody ever seems to see those bugs happening with Amon_RA v1.6.2 - then the real problem comes from a kernel which is was kanged into a flashable "Clockwork Mod" recovery by a third party - not koush.

Who is it then - the unrevoked team? Someone else? What kernel is it?

As I recall, nearly every one of the brickings that have been reported here have been folks that got their rooting instructions from outside the XDA Eris community.

Bottom line - it's starting to look like the problem is not really due to Clockwork - its a problem kernel from unknown origins.

Perhaps Rom Manager did not always work this way on the Eris - but the way it works now is that if you install it after already having Amon_RA in the recovery partition, if you cold-boot (Vol-up+End or via HBOOT), what will come up is Amon_RA, not Clockwork.

So - if you can cold-start your phone into recovery, and up pops a ClockworkMod menu instead of a Amon_RA menu - how did you root your phone originally?

bftb0

(sorry if this post is a bit of a ramble - it's pretty late/early)