From b128f54d0daa749d301b99a6637f42aa35822a76 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Thu, 18 Jun 2009 15:07:14 -0700 Subject: add function for device-specific wipe data features Some devices want to do special things when recovery wipes data (eg, wipe data in their baseband processor as well). Add a hook in the device-specific recovery library that gets called when data is wiped. Also add an amend root for the "mbm" partition. --- recovery.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'recovery.c') diff --git a/recovery.c b/recovery.c index 8ad133948..499fda574 100644 --- a/recovery.c +++ b/recovery.c @@ -354,6 +354,7 @@ prompt_and_wait() case ITEM_WIPE_DATA: ui_print("\n-- Wiping data...\n"); + device_wipe_data(); erase_root("DATA:"); erase_root("CACHE:"); ui_print("Data wipe complete.\n"); @@ -463,10 +464,14 @@ main(int argc, char **argv) if (update_package != NULL) { status = install_package(update_package); if (status != INSTALL_SUCCESS) ui_print("Installation aborted.\n"); - } else if (wipe_data || wipe_cache) { - if (wipe_data && erase_root("DATA:")) status = INSTALL_ERROR; + } else if (wipe_data) { + if (device_wipe_data()) status = INSTALL_ERROR; + if (erase_root("DATA:")) status = INSTALL_ERROR; if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR; if (status != INSTALL_SUCCESS) ui_print("Data wipe failed.\n"); + } else if (wipe_cache) { + if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR; + if (status != INSTALL_SUCCESS) ui_print("Cache wipe failed.\n"); } else { status = INSTALL_ERROR; // No command specified } -- cgit v1.2.3