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!