add support for bml dumping

Change-Id: I9dd7fd8552d4efce533c23541f3612c01e3bd90b
This commit is contained in:
Koushik Dutta 2010-09-13 15:08:49 -07:00
parent 68df48c28f
commit 56c1b3b576
2 changed files with 12 additions and 2 deletions

View File

@ -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);
}

View File

@ -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