Jump to content


Photo

[How-To]Learning, Understanding & Installation of Recoveries(Stock/CWM/TWRP)


  • Please log in to reply
26 replies to this topic

#1 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 10 April 2013 - 07:51 PM

As a warning: I do not currently own a Razr HD/ Razr HD Maxx/Razr M or Atrix HD. I am posting this so others can understand and learn the commands necessary to achieve your goal. All the commands should work as posted. However, should they not work for you, please post in detail and I will do my absolute best to help you. If anyone has any additional knowledge to add to this project, please let me post so I can adjust the code appropriately. if necessary. My door is always opened.

If you do not want to one click this. I will now explain to you how it works and you can try it on your own. I want to help teach you guys how to do this as well as not give you...er bad help.

For the sake of saving time, I will provide you with a copy of ADB (Android Debugging Bridge) so you do not have to go through the time of downloading the entire Android SDK. Download that first here. Place it on your desktop and UNZIP it. However, should you wish to learn how to properly install and set up the Android SDK, please see my thread here.

Also, on the quest to save time. I have zipped up and will include all 3 recoveries for you. Razr HD or Razr M. Unzip those and place all 3 into the ADB folder you just unzipped.

Next, I would like you to press and hold Shift and RIGHT click on the ADB folder. Select from the contextual menu "Open Command window here". This will open a command line for you, already browsed to the folder on your desktop. Now, the easy part.

Ensure you're phone is plugged into your computer, that you have all the necessary drivers installed and that USB debugging mode it ticked in Settings>Developer Options>USB Debugging.

Now we will run some commands and I will tell you what they do. So let's start with killing an previously running ADB deamon that may already be running:

adb kill-server

Next, we will connect to your device:
 

adb wait-for-device

If it hangs at this point, then you are having communication issues with your PC. Check your drivers, your wire, or untick and then retick Usb debugging. If we want to be doubly sure you can run
 

adb devices

If you are given what looks like a serial number, then we are indeed connected. If it just says "List of Devices" but no serial number, you are not connected, go back a step.

Now, we need to start communicating with the shell on your phone. And we are going to want to be running as root so we can complete the process. So next we will type
 

adb shell
su

You may be prompted with a Superuser prompt on your phone, Grant it permission. You will now be met with a new prompt something like root@android:/# We will then move on and mount /system, remember, no ADB prefix to these commands:
 

mount -o rw,remount -t ext4 /dev/block/system /system

Now, depending on what ROM you are on, some people had trouble with the recovery removing a script that motorola puts in place to over write any custom recoveries you may flash. So we are going to get rid of this file before we move forward.
 

rm /system/ect/install-recovery.sh

 
Also, the "Patch" that is stored on your phone that the aforementioned script would have flashed to erase your custom recovery 
 

mv /system/recovery-from-boot.p /system/recovery-from-boot.bak

Ok, now that that's gone we need to back out of shell and get back to your windows CMD line. (Note, depending on your set up, you may need to run the exit code twice. Once to get out of SU and again to completely exit shell. If you are back to your original C:\user\me\desktop\ADB prompt then there is no need to exit again or you will close you Windows CMD. So:

exit

Ok, We are going to put the recovery of your choosing into a temporary location until we're ready to flash it. Keep in mind, you will need to use the name of the recovery you intend to flash. So if its CWM you're pushing cwmrecovery, if it's Team Win, then it's twrprecovery and if it's stock Motorola then it will be motorecovery. I will use CWM in my example, you just need to change the name so it reflects the recovery you are trying to flash.

adb push cwmrecovery.img /data/local/tmp/cwmrecovery.img

It will proceed to tell you how long it took. Tip, if it says no such file or command, this means that the recovery of your choosing is not in the ADB folder that we put on your desktop. So now, we will flash it. but first back into shell
 

adb shell
su

Followed with:
 

dd if=/data/local/tmp/cwmrecovery.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery

Clean up our mess:
 

rm /data/local/tmp/cwmrecovery.img

And back out (2x's only if needed)
 

exit

Lastly, we reboot into recovery for confirmation
 

adb reboot recovery

And we kill our ADB daemon:
 

adb kill-server

You're Finished!

Just So EVERYONE KNOWS! If you intend to flash Safestrap prepped ROMs with these new Recoveries, you need to first BEFORE ANYTHING, You must mount /system and then you can treat your ROM the same as any other ROM in the past via Safestrap.




 

If you're really feeling brazen and are only using a Moto, Nexus, or HTC device. You could use fastboot to achieve the same deal. I find it to be a lot more work. But others for some reason find it to be easier. IDK? Anyway download the same set of Razr HD or Razr M. Only this time you will need an additional package that includes not only ADB files but also the Fastboot binary. Download that here. UNZIP this to your desktop and place the recovery images into this folder!

Next, I would like you to press and hold Shift and RIGHT click on the ADB-Fastboot folder. Select from the contextual menu "Open Command window here". This will open a command line for you, already browsed to the folder on your desktop. Now, the easy part.

Ensure you're phone is plugged into your computer, that you have all the necessary drivers installed and that USB debugging mode it ticked in Settings>Developer Options>USB Debugging.
 

adb kill-server

Next, we will connect to your device:
 

adb wait-for-device

If it hangs at this point, then you are having communication issues with your PC. Check your drivers, your wire, or untick and then retick Usb debugging. If we want to be doubly sure you can run
 

adb devices

If you are given what looks like a serial number, then we are indeed connected. If it just says "List of Devices" but no serial number, you are not connected, go back a step.

Now, we need to start communicating with the shell on your phone. And we are going to want to be running as root so we can complete the process. So next we will type
 

adb shell
su

You may be prompted with a Superuser prompt on your phone, Grant it permission. You will now be met with a new prompt something like root@android:/# We will then move on and mount /system, remember, no ADB prefix to these commands:
 

mount -o rw,remount -t ext4 /dev/block/system /system

Now, depending on what ROM you are on, some people had trouble with the recovery removing a script that motorola puts in place to over write any custom recoveries you may flash. So we are going to get rid of this file before we move forward.
 

rm /system/ect/install-recovery.sh

Also, the "Patch" that is stored on your phone that the aforementioned script would have flashed to erase your custom recovery

mv /system/recovery-from-boot.p /system/recovery-from-boot.bak

Ok, now that that's gone we need to back out of shell and get back to your windows CMD line. (Note, depending on your set up, you may need to run the exit code twice. Once to get out of SU and again to completely exit shell. If you are back to your original C:\user\me\desktop\ADB prompt then there is no need to exit again or you will close you Windows CMD. So:

exit

From this point on, we need to be sure that the recovery of our choice is in our " C:\Users\me\desktop\ADB-Fastboot\ " folder. It's now time to reboot into our bootloader.

adb reboot bootloader

We will now issue 2 commands, one after the other to flash the new recovery. Again, I will use Clockworkmod as my example, but you will need to replace the commands with the recovery of your choosing.

fastboot erase recovery
fastboot flash recovery cwmrecovery.img

Next we will reboot our bootloader

fastboot reboot-bootloader

When this is finished, power down your device.
Next press and hold, Power & VOL- to boot ur phone up to the bootloader selection menu. From here, use Vol - to highlight "Recovery" and Vol + to select it. It is vital that you go into your new recovery BEFORE you boot up your device fully again.

Once you get booted up to your recovery of choice, you may now boot back into Android. You're done!


  • lownslow200sx, neckchop, BladeRunner and 8 others like this

Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!


#2 zooyork0721

zooyork0721

    All Around Man

  • Developer
  • 979 posts
  • Google+:gtalk/hangouts- zooyork0721
  • LocationNew York, NY
  • Current Device(s):OnePlus 8 Pro

Posted 10 April 2013 - 08:49 PM

awesome tucstwo :D Thank you! im sure this will help so many people
  • satman80 likes this

lr79yH0.png

en_app_rgb_wo_60.png


#3 BytecodeMe

BytecodeMe

    Private Pile

  • Superuser
  • 2,004 posts
  • Twitter:@BytecodeMe
  • LocationSan Diego, California
  • Current Device(s):Nexus 4, Droid Razr Maxx HD

Posted 10 April 2013 - 09:25 PM

Why not use fastboot binary to install the recovery? :ph34r:

I realize it accomplishes the same thing as using dd, but using the fastboot binary is a universal way of installation. I feel it would be more educational for someone to learn how to flash a recovery with fastboot, as the file path for the dd can change and dd in my opinion has a scary syntax.

/rant :D

byte3plusrainbowsmallllllllller.png


#4 satman80

satman80

    Gny. Sgt. Hartman

  • Administrator
  • 3,159 posts
  • LocationPluto
  • Current Device(s):Droid Razr HD Maxx, Moto X Developer Edition

Posted 11 April 2013 - 02:28 AM

Why not use fastboot binary to install the recovery? :ph34r:

I realize it accomplishes the same thing as using dd, but using the fastboot binary is a universal way of installation. I feel it would be more educational for someone to learn how to flash a recovery with fastboot, as the file path for the dd can change and dd in my opinion has a scary syntax.

/rant :D


I usually don't step in as he can speak for himself but he did say as (I Just read it) :ph34r:

"If anyone has any additional knowledge to add to this project, please let me post so I can adjust the code appropriately. if necessary. My door is always opened." :blink:

I think like me and everyone else he is asking for someone else to contribute or write/post info like this, so I am not sure why you are Ranting instead of posting knowledge and info you may have to contribute that may help others like me as well. (And yes I admit I don't know everything) and fastboot is not a secret either I hope :)



I hope others find info like this helpful because I post them as well, and I always ask for info to help others,, I hope this does not turn into a flaming topic and people add or help to stuff like this posted.. :)

Thank You,
Satman

Signature Made & Protected by zooyork0721

Posted Image

Site Rules and Guidelines


#5 SpyderMan

SpyderMan

    Member

  • Dedicated Supporter
  • PipPipPip
  • 535 posts
  • LocationBrooklyn, NY

Posted 11 April 2013 - 02:33 AM

tucs, great walk thru! Don't have an HD, but feel I could use this guide if I needed to, good contextual explanations & clarity.

I read this just for the sake of understanding more about what unlocked bootloaders means for us…

just a bit unsure of what you put in that last part- about needing to Mount system if using SS based roms…

tia
  • satman80 likes this
Posted Image

Sig Created by Thach

#6 vtwinbmx

vtwinbmx

    Droid Elite

  • Developer
  • 2,486 posts
  • LocationOhio

Posted 11 April 2013 - 02:57 AM

Great write up tucs
  • satman80 likes this

vtc.png


#7 Guest_ckeathley_*

Guest_ckeathley_*
  • Guests

Posted 11 April 2013 - 07:39 AM

I am at the # sign and nothing can be typed after that. Any idea?

#8 dvgb131

dvgb131

    Member

  • Members
  • PipPip
  • 156 posts
  • Twitter:dvgb173
  • LocationAlbany
  • Current Device(s):Razr Maxx HD

Posted 11 April 2013 - 09:20 AM

I am at the # sign and nothing can be typed after that. Any idea?

I had that problem too.
Start over and this time type:
Adb shell <cr>
Su <cr>

Credit to tucstwo

Doug B.


Doug B.

#9 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 11 April 2013 - 11:13 AM

Why not use fastboot binary to install the recovery? :ph34r:

I realize it accomplishes the same thing as using dd, but using the fastboot binary is a universal way of installation. I feel it would be more educational for someone to learn how to flash a recovery with fastboot, as the file path for the dd can change and dd in my opinion has a scary syntax.

/rant :D

I find fastboot (for this process) to just be extra steps and (in my mind) more of a dangerous tool. You can acidentally erase or format the wrong things. In reality, you could do that either way. I figure, why reboot more than once if you don't have to?


I had that problem too.
Start over and this time type:
Adb shell <cr>
Su <cr>

Credit to tucstwo

Doug B.

I went ahead and edited my write up to put the shell and su cmds as 2 separate commands so certain people don't run into problems.

Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!


#10 Guest_ckeathley_*

Guest_ckeathley_*
  • Guests

Posted 11 April 2013 - 11:34 AM

I manually deleted the file the rm command was suppose to remove using root explorer then did the fast boot process to flash the recovery. Fixed. Thanks all

#11 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 11 April 2013 - 03:11 PM

Why not use fastboot binary to install the recovery? :ph34r:

I realize it accomplishes the same thing as using dd, but using the fastboot binary is a universal way of installation. I feel it would be more educational for someone to learn how to flash a recovery with fastboot, as the file path for the dd can change and dd in my opinion has a scary syntax.

/rant :D


Edit ....err addition: The other reason I think this method is better is because fastboot is not universal. This script (other than the locations for the /dev/block/) would work on pretty much any OEM, even Samsung which doesn't use Fastboot protocol.

Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!


#12 BytecodeMe

BytecodeMe

    Private Pile

  • Superuser
  • 2,004 posts
  • Twitter:@BytecodeMe
  • LocationSan Diego, California
  • Current Device(s):Nexus 4, Droid Razr Maxx HD

Posted 11 April 2013 - 05:25 PM

Edit ....err addition: The other reason I think this method is better is because fastboot is not universal. This script (other than the locations for the /dev/block/) would work on pretty much any OEM, even Samsung which doesn't use Fastboot protocol.


I see. Not to be difficult but this would work for all Snapdragon devices(note "msm" when dding the recovery).

I understand now why you chose to use dd, though fastboot is still my personal preference. It can get what 4 commands did in :

fastboot flash recovery {recoveryname}.img

I do agree fastboot is a more powerful and potentially more dangerous tool.


Sent from my XT912 using Tapatalk 2


byte3plusrainbowsmallllllllller.png


#13 TjNaps27

TjNaps27

    Member

  • Members
  • PipPip
  • 80 posts
  • Twitter:tjnaps27
  • Current Device(s):"Dan" Edition Razr Maxx HD

Posted 12 April 2013 - 04:31 AM

This is definitely a great tutorial. I'd love to learn more tho because I want to get away from one clicks. Tired of being a noob. Lol.
I have 2 questions involving fast boot.
I have an HD on 4.1.1 and I used a one click to put twrp 2.4. On it. Can use these fb commands to flash 2.5 over that?
And I'm curious about fastbooting to update my ROM to a 4.1.2 base. Can I just pull a 412 boot.IMG and
Fastboot flash boot boot.IMG
Then fastboot reboot-recovery
And using twrp to flash the new ROM. Will that only update kernel to 412 or are there more steps to it?
Thanks in advance

Sent from my "Dan" edition RAZR MAXX HD

#14 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 12 April 2013 - 05:49 AM

This is definitely a great tutorial. I'd love to learn more tho because I want to get away from one clicks. Tired of being a noob. Lol.
I have 2 questions involving fast boot.
I have an HD on 4.1.1 and I used a one click to put twrp 2.4. On it. Can use these fb commands to flash 2.5 over that?
And I'm curious about fastbooting to update my ROM to a 4.1.2 base. Can I just pull a 412 boot.IMG and
Fastboot flash boot boot.IMG
Then fastboot reboot-recovery
And using twrp to flash the new ROM. Will that only update kernel to 412 or are there more steps to it?
Thanks in advance

Sent from my "Dan" edition RAZR MAXX HD


yes, going into Fastboot and running fastboot flash recovery nameofrecovery.img will just over write the existing recovery in that partition. If you want to update to 4.1.2 fully, I would use RSD and flash the FXZ package, that will ensure everything is put into place. You will however, need to re-root and reflash you're recovery.

Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!


#15 TjNaps27

TjNaps27

    Member

  • Members
  • PipPip
  • 80 posts
  • Twitter:tjnaps27
  • Current Device(s):"Dan" Edition Razr Maxx HD

Posted 12 April 2013 - 08:04 AM

Thanks I'll probably try that later. But I more or less wanted to learn how to manually fastboot flash stuff to get a better understanding of what I'm actually doing.
Sooner or later I'd like to be more of the helper than the asker on this forum. Lol
Maybe tackle some ROM building some day.

Sent from my "Dan" edition RAZR MAXX HD


  • neckchop likes this

#16 gps4213

gps4213

    n00b

  • Members
  • Pip
  • 4 posts
  • LocationEugene OR
  • Current Device(s):Droid X2, Razr Maxx HD

Posted 23 April 2013 - 04:20 AM

This is a great write up. Thank you, I have found it enlightening.

 

The only snag is that you didn't mention that you need to be rooted to begin with.

 

X-D I wasn't even thinking when I typed in SU and got the reply that there was no su binary installed. :-)



#17 Warrior732MN

Warrior732MN

    Member

  • Members
  • PipPip
  • 48 posts
  • Current Device(s):Droid RAZR MAXX HD

Posted 24 April 2013 - 05:06 AM

Thanks for the great write up! Unlocked my phone and put TWRP on it this morning.



#18 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 29 May 2013 - 06:23 PM

Updated OP to include mattlgroffs most up to date version of CWM, 6.0.3.2  :)

Thanks Matt


Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!


#19 darrenbanks_mk

darrenbanks_mk

    n00b

  • Members
  • Pip
  • 9 posts
  • Locationsouth Ga
  • Current Device(s):Droid Razr Maxx HD

Posted 16 June 2013 - 08:09 AM

I'm having one problem. I go to delete the motorola recovery message file patch, but it says neither file is there, yet when i try to boot into cwm or twrp, i get overridden by motorola unlocked bootloader message. help!! Should I start from scratch (stock 4.0.4 and update my way into rooting at 4.1.2.) or just tinker with it?



#20 tomv5314

tomv5314

    Member

  • Members
  • PipPip
  • 243 posts
  • LocationMass.
  • Current Device(s):One Plus 7Pro 8GB Ram - 256 GB Rom - Pixel 2 XL- 128GB - Nexus 6P- 128GB - LG G3- LG-G2 -Razor Maxx HD unlocked- Bionic- Samsung Galaxy Tab S3--SM-T820

Posted 16 July 2013 - 11:01 PM

I am unlocked took update and lost root I get as far as adb shell su then I get system/bin/sh:can't execute:permission denied this is also what I get if try to use v6 recovery flasher also superuser app is still there says binary must be updated choose installation .. choose install.. error installing superuser. I have been messing with this for 5 hours. going crazy. please help.. tried both ways neither worked. did get serial number

One Plus 7 Pro --  8 GB Ram - 256 GB Rom





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users