Powered By Blogger

30 January 2011

Android Nexus S - flashing a custom recovery image and making it permanent

Each time Gingerbread reboots it recovers the stock recovery image by running a shell script in the /system/etc directory.

This means if you have installed a custom recovery image e.g. clockwork it will get overwritten and you have re-flash each time you want to use it.

If you have rooted your phone, e.g. installed superuser, you can use adb to rename the shell script and so retain the custom recovery image.

Boot phone and connect via USB:

adb shell
#
# now you have a shell on the phone
#
su
#
# super user app on phone will ask if this ok, press appropriate button, you are now root
#
# now make file system writable
#
mount -o remount,rw /dev/null /system
#
# rename unwanted script such that you can get it back if you really need it
#
mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.orig
#
# leave root and leave the shell
#
exit
exit

Now reflash your custom recovery image using fastboot, power down the phone, and re-power holding down volume-up and the power button to enter the boot loader.

New (re)flash the recovery image, either directly with fastboot :

sudo fastboot flash recovery recovery.img

or using an app like ROMManager.

Now reboot phone to bootloader (adb reboot bootloader or volume-up-and-power methods) and confirm you can enter the custom recovery image.


From there reboot the phone, again enter bootloader and again confirm the custom recovery image can be entered - this proves the shell script rename has worked.


No comments:

Post a Comment