What's new
DroidForums.net | Android Forum & News

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Custom Recovery Image

this did work for me however you typed " flash_image recover /sdcard/recovery.img and it should be flash_image recovery /sdcard/recovery.img as the way you typed i got cant find recover partition.....but thanks though worked for me and i was stuck i just added a y and it worked.....was either that or start ranting on here..
worked perfectly, the first time.. here it is combined, for you terminal emulator users



1 - place the required files (flash_image binary and recovery.img - naming shouldn't matter i kept the version number on it) on your sdcard - you can do this with a microsdcard reader, adb push, whatever you like =)
2 - start a root session using adb shell and su
3 - mount -o rw,remount /system - this makes /system writable
4 - mkdir /system/xbin - if it already exists you will simply get an error
5 - cat /sdcard/flash_image > /system/xbin/flash_image
6 - chmod 700 /system/xbin/flash_image - validate permissions on /system/xbin/flash_image - you are the root user afterall, don't need world and group executable or even read =)
7 - sync - flush changes to block device
8 - mount -o ro,remount /system - remount in read-only - you shouldn't need to make any more changes
9 - as /system/xbin is in your path, you can simply type: flash_image recover /sdcard/recovery.img
10 - hit power button, select power off
11 - hold x, hit power button
12 - you should be greated by the custom recovery firmware
 
sorry guys, copied and pasted, but forgot to fix the difference.. its fixed now, just go back to the post.. also, after you do step 9 close terminal app and reopen, enter the code for blocking the factory recovery image. then move to step 10

pm me if its still not working.. also for the noobs makes sure the # sign appears at the beginning of each new line after hitting enter.

im pretty sure once you enter the factory recovery image block code, you can simply type reboot also, then just hold x before the M appears.
 
Last edited by a moderator:
ehhh dont be sorry your intructions worked at least the site which you download from is quite vague......with all these different terminal commands floating in the prompt via quotes, replies etc could someone post how to undo blocking of reboot recovery erase in 2.0.1 i want im trying to make a text file of commands i use on my droid and moreless make a cheat sheet incase i need to do fix my fudgeup and get back to stock setup. THANKS its probably been posted but so many diffrent things floating in this thread i want to be sure....THANKS AGAIN I modded your post a little bit perhaps so people wont mess up where I did i also highlighted actual text to input into terminal

1 - place the required files (flash_image binary and recovery.img - naming shouldn't matter i kept the version number on it) on your sdcard - you can do this with a microsdcard reader, adb push, whatever you like =)
2 - start a root session using adb shell and type su
3 - mount -o rw,remount /system - this makes /system writable
4 - mkdir /system/xbin - if it already exists you will simply get an error
5 - cat /sdcard/flash_image > /system/xbin/flash_image
6 - chmod 700 /system/xbin/flash_image - validate permissions on /system/xbin/flash_image - you are the root user afterall, don't need world and group executable or even read =)
7 - sync - flush changes to block device
8 - mount -o ro,remount /system - remount in read-only - you shouldn't need to make any more changes
9. /system/xbin/ flash_image recovery /sdcard/recovery.img
10 - hit power button, select power off
11 - hold x, hit power button
12 - you should be greated by the custom recovery firmware
 
Last edited:
go to my sig, it now has everything

su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mv /system/recovery-from-boot.old /system/recovery-from-boot.p
sync
mount -o remount,r -t yaffs2 /dev/block/mtdblock3 /system
 
Random, Boost, Toka and the others here thank you for your patience. Sincerely. It would be very easy for you all to ignore us and assume if you are here in the hacks, we had better know what to do without asking.

Not sure if this is the right thread for these questions, but here goes. I think other newbs here like myself might glean something from a reply.

1. We have 4 options at the new Recovery. The first is obvious, but I am uncertain what 2-4 do to those of us with root.

For the sake of arguement, lets assume that one of us has erased some files that are not needed for running, but affect VZW 2.0.1. We have 2.0.1 w/root sitting as update.zip on the SD card.

2. For what ever reason, the user wants to go back to stock 2.0.1. with root. Can you just use the update.zip option from recovery without manually undoing all that you have done? I think 2.0.1 needs the proper file stucture, and until we get a new ROM we need to track what we have done to our system.

3. Same assumptions as above, and a user deletes something critical and gets stuck in some kind of boot loop/freeze. What would they do?

4. This may tie in with above, but I see that in the new recovery we have Mounted /sdcard at the bottom. Does this mean that with the unit sitting in the recovery screen, we can use our PC and adb or similar to fix file issues? Jinx alluded to this earlier, but I am unclear if this would be the mechanism.

5. Perhaps more of general confusion based on Tika's brick description, but are there any additional steps that we need to do at this point to ensure safety, besides the obvious like documenting changes, not hosing the wrong system files, etc. He mentioned booting to recovery to validate. Is this just booting to Recovery and visually checking to see that you have Sirpsycos' image? He aslo mentioned disabling auto-reflash. Sounds like he was "playing" with different versions of the Image, but I want to be sure there are no additional steps needed to "stick" and be able to recover.

Thank you all,

Craig
 
ok, im slightly confused, by your questions, but i'll try to answer what i can and then you can reask whatever i didnt answer..
first, tell me what your options are on recovery, im too lazy to reboot, and my internet is thru my phone, so i cant do that and be helpful..

going back to the stock update, and then rooting is how you return to stock. the original update, i believe will check for certain files, and will fail until you have those files. someone needs to make an update for root users, to avoid this. afaik its not out yet.

right now, without a custom rom, you would have to wait for a custom rom, or try to push the files back onto your system thru adb. im completely retarded when it comes to adb, although i am going to learn it tomorrow. (i said that yesterday)lol

the mounted /sdcard, is because the recovery is based on the file on your sdcard DO NOT EVER DELETE THIS! you will not have a recovery
yes you can use adb, thru busybox, as its built into the recovery

tika bricked, because 0.07 had a fatal error.at least on his part. 0.08 is stable, as far as i can tell.
without the script to block the recovery from resuming, upon a reboot, you'll go back to stock recovery

follow my guide, and you will have the new recovery, and you can simply rebbot from terminal and then hold x before the M screen appears, you will see a different recovery than the stock one. then you know your good. i suggest making a backup of the recovery, in case your sdcard fails. then you can simply put the new sdcard in, with the recovery on it, and it will resume to recovery.
 
Last edited by a moderator:
follow my guide, and you will have the new recovery, and you can simply rebbot from terminal and then hold x before the M screen appears, you will see a different recovery than the stock one. then you know your good. i suggest making a backup of the recovery, in case your sdcard fails. then you can simply put the new sdcard in, with the recovery on it, and it will resume to recovery.

Thanks for all the help. I hope you don't mind but I copied your recovery instructions at androidforums to help someone, but gave credit. It will help a lot of people.
 
please make sure you also give credit to cellulararrest, as he initially got this all together.
and thank you. appreciation really makes me smile, and know that someone is a step ahead now.
 
Boost, thanks,

I am where you are as far as the recovery rom, I muddled along last night like the rest of us.

1. At recovery

a) Reboot to system now - this one is obvious
b) Apply SDcard: Update.zip - I think you answered, that it will not work if you modify any system file. So yes it seems we need some type of update.zip that will force install without authentication or file checking? I'm betting this might not happen.
c) wipe data/factory reset - not sure what this to those of us who have rooted and/or renamed some of the files to add root, bypass the stock recovery image and turn off auto-updates.
d) wipe cache partition -this one sounds like I do not want to do, but not sure how it relates to someone getting stuck in a boot loop or almost bricked. What is this used to accomplish.

4. Just wanted the actual process for accessing the phone, to move/rename the modified files if you again find yourself stuck in a boot loop or some other almost bricked situation. Do we plug our phone into USB, boot to recovery and then use adb or similar on a pc to undo all of the file changes we have made? Will a pc see the phone files (non-sdcard) and allow mounting, renaming, moving etc. I sort of have adb figured out using SDK and the pc, I guess I need to understand busybox and whether this is again used in conjunction with a pc or is there an additional step at recovery to allow use on the phone.

5. Understood, he was actually helping with the updates to the actual recovery image for the rest of us. Took one for the team, so to speak.

In general I am hoping by you claifying these things for me, one I will learn what to do if I do that which I know better, and two, folks who follow these root, recovery threads will see some nuggets in your answers and snap to the fact that we are still not 100% bulletproof, that perhaps they should document each and every SU command that they perform on the system and if they insist on deleting stuff, at least back it up on sd or pc.

one other little thing about your compilation that is most appreciated, might be something describing that the SU commands might vary for the different shell's that may be used, or the way they have their path set up. I know it was decribed, but not in laymens terms. You know mount v. mount ytaffs. I snapped to that last night, but I can guarantee that some folks who just want a list of key steps without any base understanding are gonna get stumped there.

Thanks, you are most patient.

Craig

Opps, almost forgot EVERYONE should look at Boost's post #88. A spare backup sd card with the recovery image. That is a nugget that should be given consideration.
 
Last edited by a moderator:
I had trouble with the recovery flashing steps from Terminal Emulator so I rewrote the instructions to work from Terminal Emulator. I also made it a little more noob friendly. The casual modder shouldn't need to mess with adb.
Code:
01 - Plug your phone into your USB port and choose mount USB storage from your status bar.
02 - Copy the required files (flash_image binary and recoveryX.XX.X.img X.XX.X will be the numbers of the current build of the recovery img).
03 - Rename recoveryX.XX.X.img to recovery.img (this makes thigs easier later).
04 - Unmount your SD card from your status bar and unplug your USB cord.
05 - Fire up Terminal Emulator you downloaded from market place (or you can adb).
06 - Type su                                                            - To get a Super User prompt (#).
07 - Type mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system    - This makes /system writable.
08 - Type mkdir /system/xbin                                            - If it already exists you will simply get an error.
09 - Type cd /system/xbin                                               - This will change your directory to where the flash_image copy will go.
10 - Type cat /sdcard/flash_image > flash_image                         - This will copy flash_image to a place where you can execute it.
11 - Type chmod 700 flash_image                                         - This will make flash_image executable.
12 - Type sync                                                          - Flush changes to block device.
13 - Type mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system    - Remount in read-only - you shouldn't need to make any more changes.
14 - Type flash_image recovery /sdcard/recovery.img                     - This does the actual business of flashing your recovery partition (gulp) should only take 2 seconds
15 - Hold down the power button for a few seconds and choose "Power Off"
16 - Hold x and hold the power button until you see the Motorola logo.
17 - You should be greeted by the custom recovery firmware.  Choose reboot and wait for the first set of custom roms!
Easier to read and copy version here:
Recovery Flash from Terminal Emulator

Update: Fixed Typo in step 14. Sorry about that.
 
Last edited:
the mounted /sdcard, is because the recovery is based on the file on your sdcard DO NOT EVER DELETE THIS! you will not have a recovery
yes you can use adb, thru busybox, as its built into the recovery

I may have missed something but the normal method of
flash_image recovery recovery.img
does not need the file to remain on the sdcard. You can erase it, rename it, do whatever you want with it and the recovery will still come up when you hold x and press power.
 
Ok let's see now.....yep, I am throughly confused!

I don't want to offend anyone but I am a noob (don't know a lick of linux) and I understand that I shouldn't mess with any of this stuff or a might brick my phone. With that being said.... this how I learn stuff and I just can't seem to help myself. If someone says it can be done I just gotta try it. lol

This is what I have accomplished over several days as the procedures have been developed: With the help of those smarter than me.

1. Applied the manual update it went as expected.
2. Applied root hack by appending superuser.zip and update.zip (easy way).
3. I then proceeded to mv a couple of apps with the .apk to .bak as found in a thread here.
4. Next I applied the otacert thingy to prevent auto update.

Soooo...If I understand correctly I need to revert steps 3 and 4 if I want to install the custom recovery image. Does that sound about right?

If so does the total tutorial above (I don't have SDK or busybox) apply to my situation or do I jump in somewhere down the list. Sorry if this is as clear as mud.

Thanks to all for the hard work to get us where we are today.

Tim

I did't see the above 2 post as they were posted while I was posting this.
 
Last edited:
Thanks Soljin that helps a lot. But I still need to know If i need to reallow otacert that I disallowed before. (see my previous post)
 
soljin (or whoever) I followed your instructions for Terminal Emulator exactly, typing exactly what was in the fields, putting recovery and flash img's on my phone after unzipping flash, but when I get to the end of the typing (where you say the actual flashing occurs) instead of actually flashing it just says permission denied. I went through and made sure that all of my steps were correct, and they are, so what am I doing wrong here?
 
Back
Top