Automatically detect /datadata from recovery.fstab. Remove BOARD_HAS_DATADATA.

Change-Id: I28d3c7a6beaacd77c67c5af0ae3464acfd2572e3
This commit is contained in:
Koushik Dutta 2010-12-18 22:37:49 -08:00
parent 5d80817f2b
commit 5460f0c746
5 changed files with 22 additions and 15 deletions

View File

@ -30,7 +30,7 @@ LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_SDCARD_DEVICE_PRIMARY BOARD_SDCARD_DEVICE_SECONDARY BOARD_SDEXT_DEVICE BOARD_SDEXT_FILESYSTEM BOARD_DATA_DEVICE BOARD_DATA_FILESYSTEM BOARD_DATADATA_DEVICE BOARD_DATADATA_FILESYSTEM BOARD_CACHE_DEVICE BOARD_CACHE_FILESYSTEM BOARD_SYSTEM_DEVICE BOARD_SYSTEM_FILESYSTEM BOARD_HAS_DATADATA BOARD_DATA_FILESYSTEM_OPTIONS BOARD_DATADATA_FILESYSTEM_OPTIONS BOARD_CACHE_FILESYSTEM_OPTIONS BOARD_SYSTEM_FILESYSTEM_OPTIONS BOARD_HAS_MTD_CACHE BOARD_USES_BMLUTILS BOARD_USES_MMCUTILS BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_RECOVERY_IGNORE_BOOTABLES BOARD_HAS_SDCARD_INTERNAL BOARD_SDCARD_DEVICE_INTERNAL BOARD_HIJACK_RECOVERY_PATH
BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_MTD_CACHE BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_RECOVERY_IGNORE_BOOTABLES
$(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
$(if $($(board_define)), \

View File

@ -904,9 +904,9 @@ void create_fstab()
}
write_fstab_root("/cache", file);
write_fstab_root("/data", file);
#ifdef BOARD_HAS_DATADATA
write_fstab_root("/datadata", file);
#endif
if (has_datadata()) {
write_fstab_root("/datadata", file);
}
write_fstab_root("/system", file);
write_fstab_root("/sdcard", file);
write_fstab_root("/sd-ext", file);
@ -962,3 +962,8 @@ int is_path_mounted(const char* path) {
}
return 0;
}
int has_datadata() {
Volume *vol = volume_for_path("/datadata");
return vol != NULL;
}

View File

@ -44,3 +44,5 @@ void
wipe_battery_stats();
void create_fstab();
int has_datadata();

View File

@ -147,10 +147,10 @@ int nandroid_backup(const char* backup_path)
if (0 != (ret = nandroid_backup_partition(backup_path, "/data")))
return ret;
#ifdef BOARD_HAS_DATADATA
if (0 != (ret = nandroid_backup_partition(backup_path, "/datadata")))
return ret;
#endif
if (has_datadata()) {
if (0 != (ret = nandroid_backup_partition(backup_path, "/datadata")))
return ret;
}
struct stat st;
if (0 != stat("/sdcard/.android_secure", &st))
@ -291,10 +291,10 @@ 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 BOARD_HAS_DATADATA
if (restore_data && 0 != (ret = nandroid_restore_partition(backup_path, "/datadata")))
return ret;
#endif
if (has_datadata()) {
if (restore_data && 0 != (ret = nandroid_restore_partition(backup_path, "/datadata")))
return ret;
}
if (restore_data && 0 != (ret = nandroid_restore_partition_extended(backup_path, "/sdcard/.android_secure", 0)))
return ret;

View File

@ -680,9 +680,9 @@ wipe_data(int confirm) {
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
#ifdef BOARD_HAS_DATADATA
erase_volume("/datadata");
#endif
if (has_datadata()) {
erase_volume("/datadata");
}
erase_volume("/sd-ext");
erase_volume("/sdcard/.android_secure");
ui_print("Data wipe complete.\n");