do the md5 sum and check in the directory of the backup. otherwise it uses absolute paths, which doesnt allow you to rename the backup or move it.

This commit is contained in:
Koushik K. Dutta 2010-03-13 10:15:55 -08:00
parent 6da075c92b
commit face588f64
2 changed files with 4 additions and 3 deletions

View File

@ -26,7 +26,7 @@ LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
RECOVERY_API_VERSION := 1.6.7
RECOVERY_API_VERSION := 1.6.9
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
# This binary is in the recovery ramdisk, which is otherwise a copy of root.

View File

@ -117,7 +117,8 @@ int nandroid_backup(char* backup_path)
if (0 != ret)
return print_and_error("Error while making a yaffs2 image of cache!\n");
sprintf(tmp, "md5sum %s/*img > %s/nandroid.md5", backup_path, backup_path);
sprintf(tmp, "cd %s && md5sum *img > nandroid.md5", backup_path);
ui_print(tmp);
__system(tmp);
sync();
@ -139,7 +140,7 @@ int nandroid_restore(char* backup_path)
char tmp[PATH_MAX];
ui_print("Checking MD5 sums...\n");
sprintf(tmp, "md5sum -c %s/nandroid.md5", backup_path);
sprintf(tmp, "cd %s && md5sum -c nandroid.md5", backup_path);
if (0 != __system(tmp))
return print_and_error("MD5 mismatch!\n");