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 only applies if you boot fully into android after making your change. i ran the flash_image command, hit power off, held x on start and got into the 0.07 custom recovery image. it replaces the recovery partition as part of the os init. i wouldn't advocate moving that file until you're sure you want the new recovery image to stick =) just remember, if you do normal startup, you're back to factory and need to rerun the commands if you want to go back to custom.

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.
 
the line for flash_image and the recovery.img files on the first, and the line for the /sdcard mount on the second

----rwxr-x system sdcard_rw 26172 2009-12-12 20:46 flash_image

/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 o

excellent, see that "noexec" in the mount entry for sdcard? that should be your permission denied issue.

What's my workaround ?
 
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?
 
----rwxr-x system sdcard_rw 26172 2009-12-12 20:46 flash_image

/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 o

excellent, see that "noexec" in the mount entry for sdcard? that should be your permission denied issue.


What's my workaround ?

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 =)
 
ALSO if you have disabled reflash of recovery on system boot, please UNDO the changes you made.

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
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 =)

I just mounted USB mode and drag/dropped onto root folder. Is this my problem?

2 - start a root session using adb shell and su

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

Thanks again for the help
 
ALSO if you have disabled reflash of recovery on system boot, please UNDO the changes you made.

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
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 =)

I just mounted USB mode and drag/dropped onto root folder. Is this my problem?

2 - start a root session using adb shell and su

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

Thanks again for the help

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 =)
 
please explain #5 for us terminal emulator users

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
 
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:
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:
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
 
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
 
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.
 
Back
Top