From face588f64a8ac0a19016519bca027f625b96047 Mon Sep 17 00:00:00 2001 From: "Koushik K. Dutta" Date: Sat, 13 Mar 2010 10:15:55 -0800 Subject: [PATCH] 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. --- Android.mk | 2 +- nandroid.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Android.mk b/Android.mk index 1bed9df..b08d947 100644 --- a/Android.mk +++ b/Android.mk @@ -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. diff --git a/nandroid.c b/nandroid.c index 56971c0..2c984ac 100644 --- a/nandroid.c +++ b/nandroid.c @@ -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");