[HOW-TO] Safely Switch Back To Amon From Clockwork Recovery

Search This thread

edge.thefly

Member
Aug 20, 2010
16
0
********************DISCLAIMER********************
XDA-Developers & Myself are in no way responsible for any loss of information or damages to your device that may result from from the use (or misuse) of this process, though the process itself should not cause any such problems I feel it necessary to reinforce this fact.
********************DISCLAIMER********************

-----Special Thanks-----
jcase
-For the methodology and providing the flash_boot and recovery image links in his eng bootloader thread-

Stick from IRC
-For his sacrifice and bringing this issue to our attention (R.I.P. sticks Eris)-

Suno and Mezy (also IRC)
-For being unwitting guinea pigs and verifying the process-
--------------------



Overview:
It has recently come to our attention that a version of clockwork recovery included in rom manager can and has (sorry stick) caused problems for Eris. Clockwork (or more specifically this clockwork) does not play nice with the Eris and in at least one case has resulted in a corrupted userdata partition resulting in a brick. This is not necessarily going to happen in all cases but the possibility is there and as such it is better to be safe than sorry. If you are using clockwork without issue but wish to switch back to Amon Ra this thread can also help you meet that end.

NOTE: Users who cannot use Amon RA recovery due to trackball issues should attempt the usb wiggle method. there is some sort of connection between the usb housing and the trackball down sensor that makes the trackball register a down movement when the usb gets rocked in a downward motion (extra note. be gentle)



What You Need:
Android SDK for adb - (alternatively this can be done PC-less but I will cover that later)
flash_image - www.multiupload.com/KS2JCAMGBH
recovery.img - www.multiupload.com/DXQVBXB93G
su - for root permissions
Astro or Root Explorer - (For PC-Less Only)
Terminal Emulator - (For PC-Less Only)
________________________________________________


This process is relatively straightforward and I'm going to cover both the adb method and the PC-Less method in case you for some reason can't get your device recognized by your system (or don't have access to one). I have also made this very detailed for inexperienced users.



The Process:

ADB Version-
1) Download both the flash_image & recovery.img files from the links above and place them in your android-sdk tools directory
2) Open a Command Prompt (or terminal) and navigate to the tools directory.
3) Connect your device (USB Debugging Must Be Enabled) and verify the PC can see the device - type:
Code:
adb devices
4) Push both flash_image & recovery.img to /data/local on your device:
Code:
adb push flash_image /data/local
adb push recovery.img /data/local
5) Change the permissions of flash_image:
Code:
adb shell chmod 777 /data/local/flash_image
6) Flash the recovery image to recovery:
Code:
adb shell 
su    /*this is for those who do not get dropped into a root shell automatically remember $ = user # = root */
/data/local/flash_image recovery /data/local/recovery.img
7) Give it a few seconds to run (just give it 10 or so seconds to be safe)
8) Issue the following to reboot the device into recovery mode to verify the flash took:
Code:
adb reboot recovery


PC-Less Version-
1) Download both files to your sdcard.
2) Use Astro or Root Explorer to move both of the files to /data/local (if you run into a read only error use this command in terminal emulator and try again)
NOTE: Root Explorer users can hit the rw/ro toggle button.
Code:
su
mount -o remount,rw /

If for what ever reason you either can't get Root Explorer and ASTRO is blocking you from navigating outside your SD go to terminal emulator and issue the commands:
Code:
su
mv /sdcard/download/flash_image /data/local

3) Open terminal emulator and issue this command to set permissions:
Code:
su
chmod 777 /data/local/flash_image
4) Still in terminal emulator flash the recovery image to recovery:
Code:
/data/local/flash_image recovery /data/local/recovery.img
5) When the prompt returns issue the command:
Code:
reboot recovery



Verification:
If you completed either method you should be greeted by a green text recovery menu. If so congrats Amon RA has blessed you with it's presence. go ahead and reboot system or flash a rom if you like.


If This was Helpful I only ask that you become an active member and contribute to the community in any way possible. The OpenSource community is what it is because of people like you giving freely of themselves for the benefit of the whole.
 
Last edited:

midnight assassin

Senior Member
Jul 18, 2010
584
121
NY
What was the version the caused the issue? can't you also flash amons from clockwork in rom mgr then delete rom mgr? or would that not work? thank you.
 
Last edited:

edge.thefly

Member
Aug 20, 2010
16
0
What was the version the caused the issue? can't you also flash amons for clockwork in rom mgr then delete rom mgr? or would that not work? thank you.

Not sure of the exact version as I don't personally use rom manager (kinda a manual guy) but I think it has been fixed in the most recent release. As for using Rom Manager to reflash I can't say for sure either but this method is pretty simple and already resolved two cases. I believe stick may have tried it he was in IRC with us for hours and we were bouncing everything we could think of at him but he got sig verification failure in a flash using it not knowing the issue and corrupted his userdata partition.

If there are any more questions I will have to answer them when I wake up because I'm nearly sleeping in my chair right now :)
 

midnight assassin

Senior Member
Jul 18, 2010
584
121
NY
thanks for the answer and putting this together. I know there are a lot of noobs like myself around here lately who may benefit from this and the time you put into it. thanks for makin it simple.
 

homewmt

Senior Member
Mar 10, 2010
124
2
Pennsylvania
Thanks for the great post.

I just have to say theres an easier/alternate way to do it

1)download rom manager.
2)at the bottom of rom manager click flash alternate recovery.

[PC WAY]
As pointed out by bftb0 the below method will only work for those on HBOOT 1.49.2000 S-OFF bootloader. (those who flashed the original root rom)
1) download amon's recovery from this thread http://forum.xda-developers.com/showthread.php?t=648025
2) (if you don't already have the android sdk, download it) If your in Windows fastboot is included in the android sdk, if your in mac or linux go here http://developer.htc.com/adp.html and scroll down a bit, click download and move fastboot to your /sdk/tools folder.
3) with your phone connected to your computer and off hold the power and send buttons at the same time until fastboot comes up on the screen.
4) open cmd/terminal and cd to your /sdk/tools folder, and type in "adb flash recovery <path to amon's recovery>"(if your in linux or mac type ./ in front of fastboot).
5)reboot your phone.

I personally use clockwork recovery and have had no problems, though I do not suggest it for anyone. (unless your trackball is as messed up as mine is, I can't even scroll down in amon's recovery)
 
Last edited:

bftb0

Senior Member
Feb 5, 2010
2,594
1,040
A couple of comments.

Stick's phone

A corrupted "userdata" (/data mount point) alone might prevent the OS from booting, but that should not effect the ability to start the phone in HBOOT, FASTBOOT, or RUU (oem-78) mode. I didn't sit in on the IRC, so maybe I'm missing something, but there really are only three things which will completely brick the phone:

- screwing up a flash of the (512 kB) bootloader
- screwing up the NVRAM area
- (maybe) screwing up the misc partition

You can screw the pooch in /boot, /recovery, /system, and /data (aka "userdata") - even all four of them at the same time, if you please - and your phone should still not be bricked.

If the bootloader can not be started (in any mode), then that is absolutely a bricked device; OTOH, if you can start up the bootloader in HBOOT mode, the only thing that would prevent you from re-flashing the Leak-V3/"Official" PB00IMG.ZIP file is corruption of either the /misc partition or NVRAM. None of the dev ROMs touch those areas though. So, it is very strange that someone using any custom recovery would cause corruption of those partitions. Is Stick really bricked?

I once corrupted my /system partition which caused it to be unmountable (in Amon_RA) by doing something dumb (twice!) - but re-flashing the entire ROM (HBOOT+PB00IMG.ZIP) overcame that and gave me an earlier starting point from which to re-root and recover via Nand. There is evidence, from looking at the string data contained within the bootloader that it knows how to recreate the partition tables in flash memory - presumably this would be needed if HTC shipped a ROM which needed more space in the /system or /data partitions than existed in prior ROMs. Whether it does that for normal PB00IMG.ZIP-style ROM flashing, I can't say - but there are hints that the HTC bootloader knows how to deal with flash memory in which the entire partition table has been destroyed.

PC-based method
Step #6 in the first set of instructions will not work for rooted (dev) ROMs which do not start adbd as root (that is, "adb shell" from the PC does not launch a root shell). Most dev ROMs do that, so perhaps this is a nit-picking point. If "su" is available in the ROM, prefixing the command with "su" should work, though - just as in the PC-less example.

Use of fastboot
homewmt should probably edit his post to add the disclaimer that using fastboot for flashing of recovery will only work for folks who gained root by flashing the "Root-ROM" (or post-installing it after root was gained), which gave them the 1.49.2000 S-OFF bootloader. None of the other bootloaders will let fastboot do this. I think it is important to mention this because a lot of the new rooters are using either the "One-Click" or "Dummies" (AF) methods to install a custom recovery - and so they never touch their bootloaders.


bftb0
 
Last edited:

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
Kalamazoo
So as long as you can get the boot loader up (power + volume down) then you can still use the 2.1 RUU (for those with HBoot s-on) to get the phone back working?

I think people assume that since the moded recovery image is fried that means the phone is bricked since you can't get into recovery on the phone to restore a backup.

Myself I've been using Clockwork Mod Recovery for 3 months without any problems and I've flashed a lot of ROMS and restored a lot of backups. Both using the recovery console and ROM Manager. I'll never go back to Amon's as I see no point and Koush is at least updating Clockwork on a regular basis.
 

edge.thefly

Member
Aug 20, 2010
16
0
A couple of comments.

Stick's phone

A corrupted "userdata" (/data mount point) alone might prevent the OS from booting, but that should not effect the ability to start the phone in HBOOT, FASTBOOT, or RUU (oem-78) mode. I didn't sit in on the IRC, so maybe I'm missing something, but there really are only three things which will completely brick the phone:

- screwing up a flash of the (512 kB) bootloader
- screwing up the NVRAM area
- (maybe) screwing up the misc partition

You can screw the pooch in /boot, /recovery, /system, and /data (aka "userdata") - even all four of them at the same time, if you please - and your phone should still not be bricked.

If the bootloader can not be started (in any mode), then that is absolutely a bricked device; OTOH, if you can start up the bootloader in HBOOT mode, the only thing that would prevent you from re-flashing the Leak-V3/"Official" PB00IMG.ZIP file is corruption of either the /misc partition or NVRAM. None of the dev ROMs touch those areas though. So, it is very strange that someone using any custom recovery would cause corruption of those partitions. Is Stick really bricked?

I once corrupted my /system partition which caused it to be unmountable (in Amon_RA) by doing something dumb (twice!) - but re-flashing the entire ROM (HBOOT+PB00IMG.ZIP) overcame that and gave me an earlier starting point from which to re-root and recover via Nand. There is evidence, from looking at the string data contained within the bootloader that it knows how to recreate the partition tables in flash memory - presumably this would be needed if HTC shipped a ROM which needed more space in the /system or /data partitions than existed in prior ROMs. Whether it does that for normal PB00IMG.ZIP-style ROM flashing, I can't say - but there are hints that the HTC bootloader knows how to deal with flash memory in which the entire partition table has been destroyed.

Yes stick is really bricked. He had access to the recovery but got a sig failure which terminally corrupted his userdata partition and the only option available to him was fastboot which would throw a sig failure at any attempt to flash over (even tried PB00IMG and RUU at the end)

NOTE: Good catch on #6 I edited the OP to drop into a shell then su in.


So as long as you can get the boot loader up (power + volume down) then you can still use the 2.1 RUU (for those with HBoot s-on) to get the phone back working?

This is inadvisable as stick tried the RUU which is what killed off his ability to enter hboot
 

bftb0

Senior Member
Feb 5, 2010
2,594
1,040
Yes stick is really bricked. He had access to the recovery but got a sig failure which terminally corrupted his userdata partition and the only option available to him was fastboot which would throw a sig failure at any attempt to flash over (even tried PB00IMG and RUU at the end)

That is truly bizarre. I don't know what Clockwork does for checks, but Amon_RA performs (in the verification step) the equivalent of a "jarsigner --verify" operation: it computes the SHA1 hash of every last file in the .zip archive, and compares those sigs to the manifest. If even a single file is wrong, it won't proceed to the install, but just bombs out on a verification failure. The upshot of that is - in the Amon_RA (or stock recovery update.zip) case - it is literally impossible to install a corrupted ROM file.

In the case of HBOOT and PB00IMG.ZIP installs, a "whole-archive" signature is performed - the individual images are not inspected, but that doesn't matter: if you touch a single bit anywhere, even in the .zip file directory, that verification step will also fail.

So - in both of those examples, the only way to burn something wrong onto the phone is if the files get corrupted internally to the phone, after they have already passed signature checks - or if they are read off the SD card differently between the verification pass and the install pass!

Do you know if Stick has a S-OFF bootloader? (i have a tricky idea, if so) I suspect he doesn't, because if fastboot passes a privilege check, I don't think there are ever any sig checks performed by the phone when the bootloader is in FASTBOOT mode - all you have to do is have a S-OFF bootloader, and you can write total crap to the phone.

bftb0
 

edge.thefly

Member
Aug 20, 2010
16
0
I'm almost certain he had S-ON but hes not around right now so I can't verify.

I should also note that while he can still power on the device he only has fastboot access it wont even get into bootloader or recovery at this point.
 
Last edited:

bftb0

Senior Member
Feb 5, 2010
2,594
1,040
I'm almost certain he had S-ON but hes not around right now so I can't verify.

I should also note that while he can still power on the device he only has fastboot access it wont even get into bootloader or recovery at this point.

Ugh. Vol-Down won't get him from FASTBOOT-USB mode to HBOOT?

Sux.

I was going to suggest - only if he had the S-OFF (1.49.0000) bootloader - that he could boot to a recovery image without ever flashing it to the device, e.g.

Code:
[B]C:\blech> [COLOR=green]fastboot boot recovery-RA-eris-v1.6.2.img[/COLOR][/B]

Even if he had S-OFF, and can get a recovery boot up on it's legs, it might still be a long uphill climb if e2fsck/mke2fs can't repair/rebuild /dev/block/mtdblock5 (for instance if the mtd device is so corrupted that the partition map got thrashed).

But that route is a no-go if he has a S-ON bootloader.

bftb0
 

edge.thefly

Member
Aug 20, 2010
16
0
Good question. I personally dont use clockwork but...

the navigation interface is different (uses volume keys to select instead of trackball)

Amon_RA is far more tested and reliable on Eris

and of course the general consensus that clockwork should NOT be used on the eris.

NOTE: I am sure there are other internal differences someone like bftb0 or koush would be more apt to give a detailed explanation.
 
Last edited:

Macrodroid

Senior Member
Jul 27, 2010
1,420
648
BLACK CANYON CITY - Hell's DoorStep!
Good question. I personally dont use clockwork but...

the navigation interface is different (uses volume keys to select instead of trackball)

Amon_RA is far more tested and reliable on Eris

and of course the general consensus that clockwork should NOT be used on the eris.

NOTE: I am sure there are other internal differences someone like bftb0 or koush would be more apt to give a detailed explanation.

I've been using clockwork for a while now... I haven't had issues yet. What kind of problems have people had with this, anyway? There is an option in rom manager to flash back to Amon ra...

Sent from my Buuf Froyo using XDA App
 

edge.thefly

Member
Aug 20, 2010
16
0
The usual, failed flashes failed nandroid backups i heard something about a random reboot issue but that could be unrelated and of course the one case of corrupted partition/inability to get into hboot or recovery resulting in a brick.

I will note some people are using clockwork without issue and for them great but it is not advisable on the Eris at this time though I do realize some people have trackball issues and have to in which case best of luck to those few brave souls.

NOTE: If you have trackball issues i advise you to attempt the usb wiggle method. there is some sort of connection between the usb housing and the trackball down sensor that makes the trackball register a down movement when the usb gets rocked in a downward motion (extra note. be gentle)
 
Last edited:

rrem

Senior Member
May 24, 2010
65
4
The usual, failed flashes failed nandroid backups i heard something about a random reboot issue but that could be unrelated and of course the one case of corrupted partition/inability to get into hboot or recovery resulting in a brick.

I will note some people are using clockwork without issue and for them great but it is not advisable on the Eris at this time though I do realize some people have trackball issues and have to in which case best of luck to those few brave souls.

NOTE: If you have trackball issues i advise you to attempt the usb wiggle method. there is some sort of connection between the usb housing and the trackball down sensor that makes the trackball register a down movement when the usb gets rocked in a downward motion (extra note. be gentle)


maybe you should post this on OP :) the trackball issue that is
 

rougegoat

Senior Member
Jul 26, 2010
691
93
so...I'm not at my normal computer(and I can't get Root Explorer because my card always screws up when it converts from US to any other currency) and am trying the On-Phone method via Astro. The issue I'm having is I cannot get it to show me the /data/local folder. I can't find any tweak for it in settings or anything. There's no read only error or anything like that, so I don't think that mount command in the first post will help very much. I'm fairly new to Android hacking, so this could easily be something I just don't know yet. My gut says it's a permissions thing, and that since Astro is meant for normal users it just doesn't set itself to show the restricted stuff by default.

So I guess does anyone know how to make this folder appear in Astro?

(I've been meaning to change back to Amon_Ra for a while ever since I noticed that RomManager deleted the other recovery program. Just can't trust something that does that.)

[edit] tried the command to remount as a rewritable et all that jazz(mount -o remount, rw /) and no change.
 
Last edited:

edge.thefly

Member
Aug 20, 2010
16
0
Do you have Superuser installed? My astro sees those extra files and it isnt in my Superuser permissions list.

However if you cant get past this issue go ahead and use the terminal emulator to perform the move.

Code:
su
mv /sdcard/download/flash_image /data/local
 
Last edited:
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone