friendlier backup names. Remove option to format anything but boot. 1.7.8.4

This commit is contained in:
Koushik K. Dutta 2010-03-27 15:26:11 -07:00
parent c0970934e2
commit 6a26e7c23f
3 changed files with 30 additions and 11 deletions

View File

@ -8,8 +8,8 @@ commands_recovery_local_path := $(LOCAL_PATH)
# LOCAL_CPP_EXTENSION := .c
LOCAL_SRC_FILES := \
extendedcommands.c \
nandroid.c \
extendedcommands.c \
nandroid.c \
legacy.c \
commands.c \
recovery.c \
@ -26,7 +26,7 @@ LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
RECOVERY_VERSION := ClockworkMod Recovery v1.7.8.3
RECOVERY_VERSION := ClockworkMod Recovery v1.7.8.4
LOCAL_CFLAGS := -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)

View File

@ -772,9 +772,19 @@ cmd_backup_rom(const char *name, void *cookie, int argc, const char *argv[],
{
case 0:
{
struct timeval tp;
gettimeofday(&tp, NULL);
sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec);
char backup_path[PATH_MAX];
time_t t = time(NULL);
struct tm *tmp = localtime(&t);
if (tmp == NULL)
{
struct timeval tp;
gettimeofday(&tp, NULL);
sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec);
}
else
{
strftime(backup_path, sizeof(backup_path), "/sdcard/clockworkmod/backup/%F.%H.%M.%S", tmp);
}
backup_name = backup_path;
}
break;

View File

@ -399,7 +399,7 @@ int confirm_format()
}
#define MOUNTABLE_COUNT 4
#define MTD_COUNT 4
#define MTD_COUNT 1
void show_partition_menu()
{
@ -417,10 +417,10 @@ void show_partition_menu()
};
string mtds[MTD_COUNT][2] = {
{ "format boot", "boot" },
{ "format system", "system" },
{ "format data", "data" },
{ "format cache", "cache" },
{ "format boot", "boot" }
};
for (;;)
@ -636,10 +636,19 @@ void show_nandroid_menu()
{
case 0:
{
struct timeval tp;
gettimeofday(&tp, NULL);
char backup_path[PATH_MAX];
sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec);
time_t t = time(NULL);
struct tm *tmp = localtime(&t);
if (tmp == NULL)
{
struct timeval tp;
gettimeofday(&tp, NULL);
sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec);
}
else
{
strftime(backup_path, sizeof(backup_path), "/sdcard/clockworkmod/backup/%F.%H.%M.%S", tmp);
}
nandroid_backup(backup_path);
}
break;