Reinstall stock recovery

Got a problem with your Scroll? Unsure how to do something? Ask here! (ANY Model)

Reinstall stock recovery

Postby Fonefixer » January 26th, 2011, 6:55 am

Im trying to reinstall stock recovery (thanks to those who have helped so far) to no avail.

Ive been poking my nose in a few files and have come across these lines in the install-recovery.sh file:
#!/system/bin/sh
if ! applypatch -c

I know nothing about android but I have an idea that this code is a reference to an sh file that I have on my scroll (ive checked, it is there). My question is this, what does the "!" mean? Is it saying something like " if the system/bin/sh file is not there or corrupt, apply the patch (ie reinstall original recovery)" if so what should i do, modify the sh file, delete it?

Ive googled the first line of code and there are suggestions that a line of code is missing, something like "mount -o rw /system"

Am I barking up the wrong tree?

TIA
Dave

Employees are like mules. Some you stand in front of and coax them along with a carrot. Some you stand behind and kick them in the arse. The key to management is knowing which mules are which!
User avatar
Fonefixer
Honoured Contributor
Honoured Contributor
 
Posts: 1372
Joined: January 2nd, 2011, 8:31 am
Location: Vertical & Breathing
Real Name: Dave
Scroll Version: Scroll Excel

Re: Reinstall stock recovery

Postby Panrider » January 26th, 2011, 7:51 am

The first line invokes the shell.

Not sure about the second line - have got to go to work so have run out of time to look for it :)

Mark
Firmware: v1.01 - Kernel: 2.6.29
User avatar
Panrider
Donator
Donator
 
Posts: 135
Joined: January 10th, 2011, 4:48 pm
Location: Lincolnshire

Re: Reinstall stock recovery

Postby Diego » January 26th, 2011, 8:19 am

! is a negation -ie == is 'equal to' and != is 'not equal to'- so I'd say your guess is most likely accurate.
ImageImageThere's only one way off, might as well enjoy the ride..
Image
_________________________________________________________
firmware v1.00 kernel 2.6.29 Andriod 2.1
User avatar
Diego
Donator
Donator
 
Posts: 474
Joined: December 28th, 2010, 12:50 pm
Location: Naphoria

Re: Reinstall stock recovery

Postby Charlie » January 26th, 2011, 9:42 am

in the init.rc file there is this service call line:

Code: Select all

service flash_recovery /system/etc/install-recovery.sh
    oneshot

Each time the OS boots it therefore runs /system/etc/install-recovery.sh.

Code: Select all
#!/system/bin/sh
if ! applypatch -c MTD:recovery:2048:039c557a915d0952eba272ceddb5824efff621ad; then
  log -t recovery "Installing new recovery image"
  applypatch MTD:boot:5165056:2da0a439bb088865736290b16e8277d47cfd5d6d MTD:recovery 1975102594023372b9758eb4e3dcd288564e6971 5423104 2da0a439bb088865736290b16e8277d47cfd5d6d:/system/recovery-from-boot.p
else
  log -t recovery "Recovery image already installed"
fi

What this does is look at the first 2K block of the recovery partition image and take a SHA1 has of it. If the hash isn't the one shown then it calls "applypatch". Applypatch uses the first 2,875,392 bytes of the boot partition image (headers, kernel, and ramdisk) and the contents of /system/recovery-from-boot.p (a "diff" file) to mathematically reconstruct an image of the recovery partition.
" Just because you could, doesn't mean you should. "
User avatar
Charlie
Trusted Developer
Trusted Developer
 
Posts: 2471
Joined: December 28th, 2010, 8:41 pm
Location: UK
Real Name: Charlie
Scroll Version: Moto G 16GB (4.4.2 rooted)
Nexus 7 - G1 (4.4.2 rooted)
Huawei Y300 (4.1.1 rooted - TWRP)
MK809 (4.1.1 rooted - CWM)
Raspberry Pi B (512MB)

Retired: Excel (CM10) & 1st Gen' (2.1) Tab'.

Re: Reinstall stock recovery

Postby Fonefixer » January 26th, 2011, 10:31 am

A minor update in this...

Ive removed the root from my device (using z4root) and the other stuff (supermanager et al) no joy.

I still have a working cwm installed. Oh well, at least I can still do backups
Dave

Employees are like mules. Some you stand in front of and coax them along with a carrot. Some you stand behind and kick them in the arse. The key to management is knowing which mules are which!
User avatar
Fonefixer
Honoured Contributor
Honoured Contributor
 
Posts: 1372
Joined: January 2nd, 2011, 8:31 am
Location: Vertical & Breathing
Real Name: Dave
Scroll Version: Scroll Excel


Return to HELP REQUESTS (all models)

Who is online

Users browsing this forum: No registered users and 8 guests

cron