Merge branch 'gingerbread' of git://github.com/CyanogenMod/android_bootable_recovery into gingerbread

This commit is contained in:
root 2011-05-27 03:00:05 +01:00
commit ef5994fe29
3 changed files with 16 additions and 7 deletions

View File

@ -414,7 +414,7 @@ int format_unknown_device(const char *device, const char* path, const char *fs_t
LOGI("Formatting unknown device.\n");
// device may simply be a name, like "system"
if (device[0] != '/')
if (get_flash_type(fs_type) != UNSUPPORTED)
return erase_raw_partition(fs_type, device);
// if this is SDEXT:, don't worry about it if it does not exist.

View File

@ -70,6 +70,19 @@ __system(const char *command)
return (pid == -1 ? -1 : pstat);
}
int get_flash_type(const char* partitionType) {
printf("get_flash_type partitionType: %s\n", partitionType);
int type = UNSUPPORTED;
if (strcmp(partitionType, "mtd") == 0)
type = MTD;
else if (strcmp(partitionType, "emmc") == 0)
type = MMC;
else if (strcmp(partitionType, "bml") == 0)
type = BML;
printf("get_flash_type type: %d\n", type);
return type;
}
static int detect_partition(const char *partitionType, const char *partition)
{
int type = device_flash_type();
@ -81,12 +94,7 @@ static int detect_partition(const char *partitionType, const char *partition)
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;
type = get_flash_type(partitionType);
}
printf("partitionType: %s\n", partitionType);

View File

@ -39,6 +39,7 @@ extern int cmd_bml_mount_partition(const char *partition, const char *mount_poin
extern int cmd_bml_get_partition_device(const char *partition, char *device);
extern int device_flash_type();
extern int get_flash_type(const char* fs_type);
enum flash_type {
UNSUPPORTED = -1,