Custom Recovery Image

Discussion in 'Android Hacks and Help' started by Randomocity, Dec 12, 2009.

  1. brianr0131
    Offline

    brianr0131 New Member

    Joined:
    Nov 10, 2009
    Messages:
    408
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Cherry Hill, NJ
    Someone on this thread gave me advice to do this before i tried the recovery flash.

    Should I undo this? If so, can you post the correct commands. Thanks for the help.
  2. brianr0131
    Offline

    brianr0131 New Member

    Joined:
    Nov 10, 2009
    Messages:
    408
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Cherry Hill, NJ
    What's my workaround ?
  3. tktouch12
    Offline

    tktouch12 New Member

    Joined:
    Nov 17, 2009
    Messages:
    1,242
    Likes Received:
    0
    Trophy Points:
    0
    Sorry, tuis is going 2 sound like a noob question, but I'm still confused. Is this a firmware?or an 'update' that won't change anything but just patch the os to accept later firmware installs without signing them? That's what it does right, just patch the firmware?
  4. toka
    Offline

    toka New Member

    Joined:
    Dec 12, 2009
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    okay - here's my instructions as i recall them, and hopefully some insightful explanation:

    PLEASE: do not follow this unless you are /sure/ you know what you are doing. ALSO if you have disabled reflash of recovery on system boot, please UNDO the changes you made. It's okay for this to roll-back on first full-boot, we can go through it a second time after we validate everything is working as expected.

    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 - using cp (if you have busybox...) or cat FILE > TARGET - you should place flash_image in a place we can execute from (/system/xbin seems good to me)
    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, if you are, rejoice, reboot into android. IF NOT: stop here, let me know what you encountered
    13 - let's test to make sure our roll back worked, we should now (being fully booted in android) have the stock recovery image again, power-off, hold x, power on, you should see the stock recovery screen
    14 - if you've gotten this far, you now have the basics for how to make the change, to make it permanent follow the above steps and simply move the /system/recovery-on-boot.p before step 7. follow until step 12, you may want to reboot one more time to validate that it sticks.

    let me know if that's clear enough =)
  5. brianr0131
    Offline

    brianr0131 New Member

    Joined:
    Nov 10, 2009
    Messages:
    408
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Cherry Hill, NJ
    Can you please post undo commands. here's how I disabled:
    su
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    mv /system/recovery-from-boot.p /system/recovery-from-boot.old
    sync
    mount -o remount,r -t yaffs2 /dev/block/mtdblock3 /system
    I just mounted USB mode and drag/dropped onto root folder. Is this my problem?

    I tried my commands through terminal emulator. Is that OK?

    Thanks again for the help
  6. toka
    Offline

    toka New Member

    Joined:
    Dec 12, 2009
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    1 - This should do it, we simply want to put it back the way it was (i use short versions of the mount command because we have the mtab and fstab to remember our types and block devices)
    su
    mount -o rw,remount /system
    mv /system/recovery-from-boot.old /system/recovery-from-boot.p
    sync
    mount -o ro,remount /system

    2 - that shouldn't matter - might want to check the byte size of each to be paranoid - ls -l on the droid - and right-click properties in Windows

    3 - should work from terminal emulator, didn't try but the environment should technically be the same - i used adb shell mainly so i could use my full-size keyboard and lcd monitor =)
  7. boostdscoob
    Offline

    boostdscoob New Member

    Joined:
    Dec 11, 2009
    Messages:
    273
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    ohio
    please explain #5 for us terminal emulator users
  8. toka
    Offline

    toka New Member

    Joined:
    Dec 12, 2009
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    5 - using cp (if you have busybox...) or cat FILE > TARGET - you should place flash_image in a place we can execute from (/system/xbin seems good to me)

    if you have busybox: cp /sdcard/flash_image /system/xbin/flash_image

    if you don't have busybox (eg you are a masochist): cat /sdcard/flash_image > /system/xbin/flash_image
  9. boostdscoob
    Offline

    boostdscoob New Member

    Joined:
    Dec 11, 2009
    Messages:
    273
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    ohio
    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 recovery /sdcard/recovery-0.08.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: Dec 13, 2009
  10. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    Disregard below, I confirmed that when in SU I cannot fiddle with files unless r/w is set properly. I guess Astro lets me move system files around. Thank goodness I now have the new recovery. And thank you again for helping unravel the problem with pathing.

    Craig




    Sorry to jump in, Toka, but I was able to get the syops recovery to show using these commands to change the r/w attributes.


    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    sync
    mount -o remount,r -t yaffs2 /dev/block/mtdblock3 /system

    I am not gonna stick anything for a bit, until I am sure this is the correct image I want to use.


    But, I think I have a new problem. I checked to see that I had correctly changed the rw status back to Read only, and right now after using the above commands, I find that in Astro I can move system files that I should not have permission to do so.

    Any thoughts, and a big THANK YOU.

    Craig

    Last edited: Dec 13, 2009
  11. jdefe
    Offline

    jdefe New Member

    Joined:
    Dec 13, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hmmmm

    I have followed every instruction to the T...have gotten no errors during the process, and yet I still have the original recovery on my phone. Ive had no problem doing any of these things on my g1, but no matter how many times I do it the new recovery image wont load...so puzzling
  12. brianr0131
    Offline

    brianr0131 New Member

    Joined:
    Nov 10, 2009
    Messages:
    408
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Cherry Hill, NJ
    Every command i try to execute like move results in a "read only" error. If I have su access how do I get read only error?


    Thanks
  13. jinx10000
    Offline

    jinx10000 New Member

    Joined:
    Dec 10, 2009
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    0
    have you mounted the system folder as read/write.
  14. brianr0131
    Offline

    brianr0131 New Member

    Joined:
    Nov 10, 2009
    Messages:
    408
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Cherry Hill, NJ
    Yes I tried:

    mount -o rw,remount /system

    and

    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

    no joy
  15. jinx10000
    Offline

    jinx10000 New Member

    Joined:
    Dec 10, 2009
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    0
    the only times i've had this problem is when I don't mount the system with write priviledges or I forget to provide a destination.

    For example,

    cp /system/bin/xyz xyz.old
    vs
    cp /system/bin/xyz /system/bin/xyz.old

    I doubt if that is your problem but I have done it before.
  16. tdawg5480
    Offline

    tdawg5480 New Member

    Joined:
    Nov 25, 2009
    Messages:
    370
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    CT
    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..
  17. boostdscoob
    Offline

    boostdscoob New Member

    Joined:
    Dec 11, 2009
    Messages:
    273
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    ohio
    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: Dec 13, 2009
  18. tdawg5480
    Offline

    tdawg5480 New Member

    Joined:
    Nov 25, 2009
    Messages:
    370
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    CT
    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: Dec 13, 2009
  19. boostdscoob
    Offline

    boostdscoob New Member

    Joined:
    Dec 11, 2009
    Messages:
    273
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    ohio
    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
  20. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    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
Search tags for this page

custom recovery image

,
custon recovery imsge for droid 2 global android forums
,
droid custom recovery
,

flash image permission denied

,
flash image recovery /sdcard/name-of-recovery.img
,
flash image: permission denied
,
flash image.img permission denied
,
how to know phone have custom recovery image
,
motorola droid custom recovery
,
motorola droid recovery image
,
recovery.img motorola droid
,
verizon droid charge recovery image