diff --git a/Android.mk b/Android.mk index e16f226..6d94c17 100644 --- a/Android.mk +++ b/Android.mk @@ -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)), \ diff --git a/extendedcommands.c b/extendedcommands.c index 8ad69e2..762b15a 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -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; +} \ No newline at end of file diff --git a/extendedcommands.h b/extendedcommands.h index 650a519..e9d7cc4 100644 --- a/extendedcommands.h +++ b/extendedcommands.h @@ -44,3 +44,5 @@ void wipe_battery_stats(); void create_fstab(); + +int has_datadata(); \ No newline at end of file diff --git a/nandroid.c b/nandroid.c index 5d7b9d4..5d174a7 100644 --- a/nandroid.c +++ b/nandroid.c @@ -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; diff --git a/recovery.c b/recovery.c index bf0575a..e1641c0 100644 --- a/recovery.c +++ b/recovery.c @@ -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");