From 56c1b3b5762e87bef00b6fc316a4fd83a6f799c7 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 13 Sep 2010 15:08:49 -0700 Subject: [PATCH] add support for bml dumping Change-Id: I9dd7fd8552d4efce533c23541f3612c01e3bd90b --- bmlutils/bmlutils.c | 6 ++++++ nandroid.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c index b264e0a..d886898 100644 --- a/bmlutils/bmlutils.c +++ b/bmlutils/bmlutils.c @@ -31,3 +31,9 @@ int write_raw_image(const char* partition, const char* filename) { sprintf(tmp, "/sbin/redbend_ua restore %s %s", filename, BOARD_BOOT_DEVICE); return __system(tmp); } + +int read_raw_image(const char* partition, const char* filename) { + char tmp[PATH_MAX]; + sprintf(tmp, "dd if=/dev/block/bml7 of=%s", filename); + return __system(tmp); +} diff --git a/nandroid.c b/nandroid.c index 6bf6e91..b47a269 100644 --- a/nandroid.c +++ b/nandroid.c @@ -48,6 +48,10 @@ int write_raw_image(const char* partition, const char* filename) { sprintf(tmp, "flash_image boot %s", filename); return __system(tmp); } + +int read_raw_image(const char* partition, const char* filename) { + return dump_image(partition, filename, NULL); +} #endif int print_and_error(char* message) { @@ -144,13 +148,13 @@ int nandroid_backup(const char* backup_path) #ifndef BOARD_RECOVERY_IGNORE_BOOTABLES ui_print("Backing up boot...\n"); sprintf(tmp, "%s/%s", backup_path, "boot.img"); - ret = dump_image("boot", tmp, NULL); + ret = read_raw_image("boot", tmp); if (0 != ret) return print_and_error("Error while dumping boot image!\n"); ui_print("Backing up recovery...\n"); sprintf(tmp, "%s/%s", backup_path, "recovery.img"); - ret = dump_image("recovery", tmp, NULL); + ret = read_raw_image("recovery", tmp); if (0 != ret) return print_and_error("Error while dumping recovery image!\n"); #endif