Droid X Recovery (and Droid 2 too!)



Well, this was a bitch.

Caveats:
This is not a *real* recovery. The way this recovery works is by hijacking portions of your boot process during system initialization and starting into recovery instead. So, if you hose your system *COMPLETELY* you will need to SBF. Specifically, if your logwrapper, logwrapper.bin, or hijack binary are missing from /system/bin, you will be screwed.

Do I have to be rooted to run this?
Yes.

So can we now install custom ROMs?
Yes, but you can't replace the kernel or boot image. But really, once you have access to /system, anything is possible. It will just take a little hackery.

How does this work?
When your device boots up, there is a init.rc script in your boot image that runs various components found in /system. The Droid X recovery bootstrap mimics the "logwrapper" binary. The hijacker then looks for "/data/.recovery_mode", and if it finds it, it unmounts /system to prevent android from starting. It then starts up recovery instead.

How do I boot into recovery?
You can manually create the /data/.recovery_mode via a terminal file and simply reboot, and you will be in recovery. Or you can use the handy Droid X Recovery Bootstrap application to reboot into recovery.

What if my phone won't boot? How do I get into recovery without the app?
When the hijacker runs, it will automatically create the "/data/.recovery_mode" file after it finishes. This tells the system that the next time it boots, it should boot into recovery. But, when the system starts, the Droid X Recovery Bootstrap will then delete that file when Android is fully started, to prevent you from booting into recovery. So what does this mean? If you fail to boot, simply pull your battery, and your next boot will be into recovery (unless your /system is *really* hosed, in which case you need to SBF).

How do I fix my phone if I really mess it up?
Use an SBF. Google it. http://twitter.com/b16a2smith/status/21544626803

Why does the Droid X Recovery Bootstrap start on boot?
As mentioned above, it needs to log that your phone booted successfully and recovery mode is not necessary. It also replaces your "adb daemon" with one that has root permissions, allowing for easier usage of the adb command.

Will this work with ROM Manager?
Yep! But you must run the Bootstrap app and leave it installed.

Is this open source?
Yep.
Recovery: http://github.com/koush/android_bootable_recovery
Droid X Bootstrap: http://github.com/koush/DroidXBootstrap
Droid X Hijack: http://github.com/koush/android_vendor_motorola_droidx

OK STOP TALKING, WHERE DO I GET IT?
You can donate and grab it for $2 off the Android Market (search for Droid X Recovery Bootstrap or Droid 2 Recovery Bootstrap), or you can download it for free here:
Droid X Recovery Bootstrap
Droid 2 Recovery Bootstrap