From 8b5e1856b3c15272a9cfc53ba617e3361afce973 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 14 Jun 2010 22:04:22 -0700 Subject: [PATCH] support DATADATA --- Android.mk | 6 +++++- nandroid.c | 12 +++++++++++- roots.c | 11 +++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Android.mk b/Android.mk index 2c5da9c..0fb6fd0 100644 --- a/Android.mk +++ b/Android.mk @@ -26,7 +26,7 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true -RECOVERY_VERSION := ClockworkMod Recovery v1.8.2.8 +RECOVERY_VERSION := ClockworkMod Recovery v2.0.0.0 LOCAL_CFLAGS := -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) @@ -67,6 +67,10 @@ ifdef BOARD_CACHE_FILESYSTEM LOCAL_CFLAGS += -DCACHE_FILESYSTEM=\"$(BOARD_CACHE_FILESYSTEM)\" endif +ifdef BOARD_HAS_DATADATA + LOCAL_CFLAGS += -DHAS_DATADATA +endif + # This binary is in the recovery ramdisk, which is otherwise a copy of root. # It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses # a (redundant) copy of the binary in /system/bin for user builds. diff --git a/nandroid.c b/nandroid.c index ab20a60..e9234da 100644 --- a/nandroid.c +++ b/nandroid.c @@ -145,6 +145,11 @@ int nandroid_backup(const char* backup_path) if (0 != (ret = nandroid_backup_partition(backup_path, "DATA:"))) return ret; +#ifdef HAS_DATADATA + if (0 != (ret = nandroid_backup_partition(backup_path, "DATADATA:"))) + return ret; +#endif + if (0 != (ret = nandroid_backup_partition(backup_path, "CACHE:"))) return ret; @@ -156,7 +161,7 @@ int nandroid_backup(const char* backup_path) else { if (0 != ensure_root_path_mounted("SDEXT:")) - ui_print("Could not mount sd-ext. sd-ext backup may not be supported on this device. Skipping backup of sd-ext."); + ui_print("Could not mount sd-ext. sd-ext backup may not be supported on this device. Skipping backup of sd-ext.\n"); else if (0 != (ret = nandroid_backup_partition(backup_path, "SDEXT:"))) return ret; } @@ -252,6 +257,11 @@ int nandroid_restore(const char* backup_path, int restore_boot, int restore_syst if (restore_data && 0 != (ret = nandroid_restore_partition(backup_path, "DATA:"))) return ret; + +#ifdef HAS_DATADATA + if (restore_data && 0 != (ret = nandroid_restore_partition(backup_path, "DATADATA:"))) + return ret; +#endif if (restore_cache && 0 != (ret = nandroid_restore_partition(backup_path, "CACHE:"))) return ret; diff --git a/roots.c b/roots.c index 22988eb..b2df224 100644 --- a/roots.c +++ b/roots.c @@ -60,6 +60,14 @@ static const char g_package_file[] = "@\0g_package_file"; #define DATA_FILESYSTEM "yaffs2" #endif +#ifndef DATADATA_DEVICE +#define DATADATA_DEVICE g_mtd_device +#endif + +#ifndef DATADATA_FILESYSTEM +#define DATADATA_FILESYSTEM "yaffs2" +#endif + #ifndef CACHE_DEVICE #define CACHE_DEVICE g_mtd_device #endif @@ -72,6 +80,9 @@ static RootInfo g_roots[] = { { "BOOT:", g_mtd_device, NULL, "boot", NULL, g_raw }, { "CACHE:", CACHE_DEVICE, NULL, "cache", "/cache", CACHE_FILESYSTEM }, { "DATA:", DATA_DEVICE, NULL, "userdata", "/data", DATA_FILESYSTEM }, +#ifdef HAS_DATADATA + { "DATADATA:", DATADATA_DEVICE, NULL, "datadata", "/datadata", DATADATA_FILESYSTEM }, +#endif { "MISC:", g_mtd_device, NULL, "misc", NULL, g_raw }, { "PACKAGE:", NULL, NULL, NULL, NULL, g_package_file }, { "RECOVERY:", g_mtd_device, NULL, "recovery", "/", g_raw },