aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2011-05-26 11:14:15 -0700
committerKoushik Dutta <koushd@gmail.com>2011-05-26 11:14:15 -0700
commit8a6bc7742303fee29c22694a46b6109fb46adbd6 (patch)
tree88cb2881c4acef48aeb563187648dad385d51d5b
parentd79b7541f3ba5fc1c162da1aa7b28544ab85c170 (diff)
downloadbootable_recovery-8a6bc7742303fee29c22694a46b6109fb46adbd6.zip
bootable_recovery-8a6bc7742303fee29c22694a46b6109fb46adbd6.tar.gz
bootable_recovery-8a6bc7742303fee29c22694a46b6109fb46adbd6.tar.bz2
test
Change-Id: I25bd6846aea09247459c89ba98e6ac34c3debaa3
-rw-r--r--Android.mk2
-rw-r--r--extendedcommands.c2
-rw-r--r--flashutils/dump_image.c2
-rw-r--r--flashutils/erase_image.c2
-rw-r--r--flashutils/flash_image.c2
-rw-r--r--flashutils/flashutils.c32
-rw-r--r--flashutils/flashutils.h6
-rw-r--r--nandroid.c4
8 files changed, 32 insertions, 20 deletions
diff --git a/Android.mk b/Android.mk
index 13ce859..5322222 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,7 +26,7 @@ LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
-RECOVERY_VERSION := ClockworkMod Recovery v3.1.0.2
+RECOVERY_VERSION := ClockworkMod Recovery v3.2.0.0
LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
diff --git a/extendedcommands.c b/extendedcommands.c
index 2e3fa51..3dbba60 100644
--- a/extendedcommands.c
+++ b/extendedcommands.c
@@ -422,7 +422,7 @@ int format_unknown_device(const char *device, const char* path, const char *fs_t
// device may simply be a name, like "system"
if (device[0] != '/')
- return erase_raw_partition(device);
+ return erase_raw_partition(fs_type, device);
// if this is SDEXT:, don't worry about it if it does not exist.
if (0 == strcmp(path, "/sd-ext"))
diff --git a/flashutils/dump_image.c b/flashutils/dump_image.c
index 4db1f74..64c4e1c 100644
--- a/flashutils/dump_image.c
+++ b/flashutils/dump_image.c
@@ -146,5 +146,5 @@ int main(int argc, char **argv)
return 2;
}
- return backup_raw_partition(argv[1], argv[2]);
+ return backup_raw_partition(NULL, argv[1], argv[2]);
}
diff --git a/flashutils/erase_image.c b/flashutils/erase_image.c
index c495255..b09a424 100644
--- a/flashutils/erase_image.c
+++ b/flashutils/erase_image.c
@@ -99,5 +99,5 @@ int main(int argc, char **argv)
return 2;
}
- return erase_raw_partition(argv[1]);
+ return erase_raw_partition(NULL, argv[1]);
}
diff --git a/flashutils/flash_image.c b/flashutils/flash_image.c
index 3966c42..e9fa570 100644
--- a/flashutils/flash_image.c
+++ b/flashutils/flash_image.c
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
return 2;
}
- int ret = restore_raw_partition(argv[1], argv[2]);
+ int ret = restore_raw_partition(NULL, argv[1], argv[2]);
if (ret != 0)
fprintf(stderr, "failed with error: %d\n", ret);
return ret;
diff --git a/flashutils/flashutils.c b/flashutils/flashutils.c
index 7504e4a..7dc750c 100644
--- a/flashutils/flashutils.c
+++ b/flashutils/flashutils.c
@@ -69,7 +69,7 @@ __system(const char *command)
return (pid == -1 ? -1 : pstat);
}
-static int detect_partition(const char *partition)
+static int detect_partition(const char *partitionType, const char *partition)
{
int type = device_flash_type();
if (strstr(partition, "/dev/block/mtd") != NULL)
@@ -78,12 +78,24 @@ static int detect_partition(const char *partition)
type = MMC;
else if (strstr(partition, "/dev/block/bml") != NULL)
type = BML;
-
+
+ if (partitionType != NULL) {
+ if (strstr(partitionType, "mtd") != NULL)
+ type = MTD;
+ else if (strstr(partitionType, "emmc") != NULL)
+ type = MMC;
+ else if (strstr(partitionType, "bml") != NULL)
+ type = BML;
+ }
+
+ printf("partitionType: %s\n", partitionType);
+ printf("partition: %s\n", partition);
+ printf("detected type: %d\n", type);
return type;
}
-int restore_raw_partition(const char *partition, const char *filename)
+int restore_raw_partition(const char* partitionType, const char *partition, const char *filename)
{
- int type = detect_partition(partition);
+ int type = detect_partition(partitionType, partition);
switch (type) {
case MTD:
return cmd_mtd_restore_raw_partition(partition, filename);
@@ -96,9 +108,9 @@ int restore_raw_partition(const char *partition, const char *filename)
}
}
-int backup_raw_partition(const char *partition, const char *filename)
+int backup_raw_partition(const char* partitionType, const char *partition, const char *filename)
{
- int type = detect_partition(partition);
+ int type = detect_partition(partitionType, partition);
switch (type) {
case MTD:
return cmd_mtd_backup_raw_partition(partition, filename);
@@ -112,9 +124,9 @@ int backup_raw_partition(const char *partition, const char *filename)
}
}
-int erase_raw_partition(const char *partition)
+int erase_raw_partition(const char* partitionType, const char *partition)
{
- int type = detect_partition(partition);
+ int type = detect_partition(partitionType, partition);
switch (type) {
case MTD:
return cmd_mtd_erase_raw_partition(partition);
@@ -129,7 +141,7 @@ int erase_raw_partition(const char *partition)
int erase_partition(const char *partition, const char *filesystem)
{
- int type = detect_partition(partition);
+ int type = detect_partition(NULL, partition);
switch (type) {
case MTD:
return cmd_mtd_erase_partition(partition, filesystem);
@@ -144,7 +156,7 @@ int erase_partition(const char *partition, const char *filesystem)
int mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only)
{
- int type = detect_partition(partition);
+ int type = detect_partition(NULL, partition);
switch (type) {
case MTD:
return cmd_mtd_mount_partition(partition, mount_point, filesystem, read_only);
diff --git a/flashutils/flashutils.h b/flashutils/flashutils.h
index d5dadcb..4c63c67 100644
--- a/flashutils/flashutils.h
+++ b/flashutils/flashutils.h
@@ -1,9 +1,9 @@
#ifndef FLASHUTILS_H
#define FLASHUTILS_H
-int restore_raw_partition(const char *partition, const char *filename);
-int backup_raw_partition(const char *partition, const char *filename);
-int erase_raw_partition(const char *partition);
+int restore_raw_partition(const char* partitionType, const char *partition, const char *filename);
+int backup_raw_partition(const char* partitionType, const char *partition, const char *filename);
+int erase_raw_partition(const char* partitionType, const char *partition);
int erase_partition(const char *partition, const char *filesystem);
int mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only);
int get_partition_device(const char *partition, char *device);
diff --git a/nandroid.c b/nandroid.c
index 933faa3..a55884d 100644
--- a/nandroid.c
+++ b/nandroid.c
@@ -115,7 +115,7 @@ int nandroid_backup_partition(const char* backup_path, const char* root) {
const char* name = basename(root);
sprintf(tmp, "%s/%s.img", backup_path, name);
ui_print("Backing up %s image...\n", name);
- if (0 != (ret = backup_raw_partition(vol->device, tmp))) {
+ if (0 != (ret = backup_raw_partition(vol->fs_type, vol->device, tmp))) {
ui_print("Error while backing up %s image!", name);
return ret;
}
@@ -294,7 +294,7 @@ int nandroid_restore_partition(const char* backup_path, const char* root) {
}
sprintf(tmp, "%s%s.img", backup_path, root);
ui_print("Restoring %s image...\n", name);
- if (0 != (ret = restore_raw_partition(vol->device, tmp))) {
+ if (0 != (ret = restore_raw_partition(vol->fs_type, vol->device, tmp))) {
ui_print("Error while flashing %s image!", name);
return ret;
}