fix erroneous detection of device flash type when device is explicitly provided. fix bugs in mount generation.
Change-Id: I54a35390550b1384f12c4b12267029d77bef8fa3
This commit is contained in:
parent
92796ec949
commit
67fa0c375f
@ -26,7 +26,7 @@ LOCAL_MODULE := recovery
|
||||
|
||||
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
||||
|
||||
RECOVERY_VERSION := ClockworkMod Recovery v3.0.1.4
|
||||
RECOVERY_VERSION := ClockworkMod Recovery v3.0.1.9
|
||||
LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
|
||||
RECOVERY_API_VERSION := 2
|
||||
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
|
||||
|
@ -519,7 +519,7 @@ void show_partition_menu()
|
||||
|
||||
for (i = 0; i < num_volumes; ++i) {
|
||||
Volume* v = &device_volumes[i];
|
||||
if(strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) != 0)
|
||||
if(strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) != 0 && strcmp("emmc", v->fs_type) != 0 && strcmp("bml", v->fs_type) != 0)
|
||||
{
|
||||
sprintf(&mount_menue[mountable_volumes].mount, "mount %s", v->mount_point);
|
||||
sprintf(&mount_menue[mountable_volumes].unmount, "unmount %s", v->mount_point);
|
||||
@ -529,7 +529,7 @@ void show_partition_menu()
|
||||
format_menue[formatable_volumes].v = &device_volumes[i];
|
||||
++formatable_volumes;
|
||||
}
|
||||
else if (strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) == 0)
|
||||
else if (strcmp("ramdisk", v->fs_type) != 0 && strcmp("misc", v->mount_point) != 0 && strcmp("mtd", v->fs_type) == 0)
|
||||
{
|
||||
sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point);
|
||||
format_menue[formatable_volumes].v = &device_volumes[i];
|
||||
|
@ -69,9 +69,21 @@ __system(const char *command)
|
||||
return (pid == -1 ? -1 : pstat);
|
||||
}
|
||||
|
||||
int restore_raw_partition(const char *partition, const char *filename)
|
||||
static int detect_partition(const char *partition)
|
||||
{
|
||||
int type = device_flash_type();
|
||||
if (strstr(partition, "/dev/block/mtd") != NULL)
|
||||
type = MTD;
|
||||
else if (strstr(partition, "/dev/block/mmc") != NULL)
|
||||
type = MMC;
|
||||
else if (strstr(partition, "/dev/block/bml") != NULL)
|
||||
type = BML;
|
||||
|
||||
return type;
|
||||
}
|
||||
int restore_raw_partition(const char *partition, const char *filename)
|
||||
{
|
||||
int type = detect_partition(partition);
|
||||
switch (type) {
|
||||
case MTD:
|
||||
return cmd_mtd_restore_raw_partition(partition, filename);
|
||||
@ -86,7 +98,7 @@ int restore_raw_partition(const char *partition, const char *filename)
|
||||
|
||||
int backup_raw_partition(const char *partition, const char *filename)
|
||||
{
|
||||
int type = device_flash_type();
|
||||
int type = detect_partition(partition);
|
||||
switch (type) {
|
||||
case MTD:
|
||||
return cmd_mtd_backup_raw_partition(partition, filename);
|
||||
@ -101,7 +113,7 @@ int backup_raw_partition(const char *partition, const char *filename)
|
||||
|
||||
int erase_raw_partition(const char *partition)
|
||||
{
|
||||
int type = device_flash_type();
|
||||
int type = detect_partition(partition);
|
||||
switch (type) {
|
||||
case MTD:
|
||||
return cmd_mtd_erase_raw_partition(partition);
|
||||
@ -116,7 +128,7 @@ int erase_raw_partition(const char *partition)
|
||||
|
||||
int erase_partition(const char *partition, const char *filesystem)
|
||||
{
|
||||
int type = device_flash_type();
|
||||
int type = detect_partition(partition);
|
||||
switch (type) {
|
||||
case MTD:
|
||||
return cmd_mtd_erase_partition(partition, filesystem);
|
||||
@ -131,7 +143,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 = device_flash_type();
|
||||
int type = detect_partition(partition);
|
||||
switch (type) {
|
||||
case MTD:
|
||||
return cmd_mtd_mount_partition(partition, mount_point, filesystem, read_only);
|
||||
|
@ -579,18 +579,23 @@ ERROR3:
|
||||
|
||||
int cmd_mmc_restore_raw_partition(const char *partition, const char *filename)
|
||||
{
|
||||
mmc_scan_partitions();
|
||||
const MmcPartition *p;
|
||||
p = mmc_find_partition_by_name(partition);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
return mmc_raw_copy(p, filename);
|
||||
if (partition[0] != '/') {
|
||||
mmc_scan_partitions();
|
||||
const MmcPartition *p;
|
||||
p = mmc_find_partition_by_name(partition);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
return mmc_raw_copy(p, filename);
|
||||
}
|
||||
else {
|
||||
return mmc_raw_dump_internal(filename, partition);
|
||||
}
|
||||
}
|
||||
|
||||
int cmd_mmc_backup_raw_partition(const char *partition, const char *filename)
|
||||
{
|
||||
mmc_scan_partitions();
|
||||
if (partition[0] != '/') {
|
||||
mmc_scan_partitions();
|
||||
const MmcPartition *p;
|
||||
p = mmc_find_partition_by_name(partition);
|
||||
if (p == NULL)
|
||||
@ -604,13 +609,6 @@ int cmd_mmc_backup_raw_partition(const char *partition, const char *filename)
|
||||
|
||||
int cmd_mmc_erase_raw_partition(const char *partition)
|
||||
{
|
||||
mmc_scan_partitions();
|
||||
const MmcPartition *p;
|
||||
p = mmc_find_partition_by_name(partition);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
|
||||
// TODO: implement raw wipe
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user