[Android Software/Hacking General [Developers Only]] meltwater:
Topic Three: Low Level Basics

Part Three: Backups, ROMs and Flashbacks

This topic is very specific to this particular tablet, perhaps even down to this particular “fake” version of the M701 tablet, however similar principles will apply to other tablets hopefully.

The aim here is to allow us to take a full backup of the device, so that at a later date we can try flashing new ROMs. Unlike the backups which you can perform using apps such as Titanium Backup, we want to backup the entire tablet including the Android boot/system/data/cache itself. This should allow us to flash the tablet back to it's current state even if we change ROMs etc.

In order to do this we will install ClockworkMod Recovery v2.5.1.3 which allows for full backup of the tablet storage and system, by replacing the recovery mode partition of the tablet. I am sure there are plenty of threads around which cover backing up of Android, so I'll not go into too much detail (particularly since I am still learning about it at the moment), but hopefully the info will be useful for some.

Source threads:

AndroidTablets.net - Gingerbread Recovery Mode

Team Telechips - ClockworkMod Recovery

Android Police - How to fully Backup and Restore your Android Phone

Addictivetips - What Is ClockworkMod Recovery And How To Use It On Android

Addictivetips - Android Partitions Explained: boot, system, recovery, data, cache & misc

Using Recovery Mode:

To enter recovery mode, switch the unit off and then switch back on while holding down left-side of the rocker switch. Instead of booting into android, it will boot into recovery mode.

Alternatively, you can connect to adb and type the following:

adb shell reboot recovery

The stock recovery mode has limited options:

(Click Image For Larger Version)

It only allows you to update from the sdcard, or wipe data off the tablet (there is no option to back anything up). This is why we need to replace it with a custom one, because flashing any new ROM will replace what you currently have.

Flashing Recovery Mode:

There are two ways you can achieve this:

You can flash the recovery partition directly within the recovery mode:

Put the M701GB-recovery-signed.zip file on to the root of the sdcard and rename to update.zip

Then select update from within recovery mode.

(Click Image For Larger Version)

This method presents a problem, if like me, the image file you try is not correct (thus stopping your recovery mode from working!). My recovery was broken and unable to boot, but it appears the tablet is able to boot into the system partition independently of the recovery partition, so it was still able to boot into Android normally.

Therefore I suggest the following method from OffWorld, which uses adb directly.

How To ADB style (OffWorlds method):

Download and unzip, put somewhere (ex: "androidstuff" )

Boot tablet, connect USB, open ADB

adb remount
adb push /androidstuff/M701GB-recovery-signed/recovery.img /sdcard/
adb shell sync
adb shell flash_image recovery /sdcard/recovery.img

(You might see a memory error, it apparently doesn't matter)

adb shell sync
adb shell reboot recovery

For my particular device, I found that the recovery firmware suggested did not work (this is either because my device is a “fake” m701 device, or it could be the Gingerbread recovery is different to the one for the firmware I currently have on there). Fortunately using the above method I was able to try again, and I discovered the following image did!

Image from:

Team Telechips - ClockworkMod Recovery

(Click Image For Larger Version)

When you boot into ClockworkMod Recovery you can now breath easily again and you can now perform backups of your device. In theory at least, as long as you don’t destroy both the recovery partition and the main system partition at the same time, you should always be able to return to this current state.

(Click Image For Larger Version)

To navigate through the menus, right-hand rocker goes to next menu item, left-hand exits the current menu, and the Home ([]) button selects the current item.

Now it is worth familiarising yourself with ClockworkMod Recovery, again this has been covered elsewhere:

Addictivetips - What Is ClockworkMod Recovery And How To Use It On Android

If you read this, you will see how useful putting a custom recovery partition is and how to use the features for a range of needs. In particular, the possibility to move the cache and data partitions to the SD card could be useful, by using a sd-ext partition (but I'll try that another day!).

UPDATE (2Aug11):

I have since updated my firmware to Gingerbread, and I can confirm that using the previous package M701GB-recovery-signed.zip work fine with the new firmware.

Continued in Part Four: First Time Flasher!