allow flashing only bml8 if explicitly specified.

Change-Id: Ie0d282105413b3a448436c9ee69206718e924754
This commit is contained in:
Koushik Dutta 2011-05-29 19:33:42 -07:00
parent cf5195aa79
commit 195e06be59

View File

@ -61,13 +61,17 @@ int cmd_bml_restore_raw_partition(const char *partition, const char *filename)
if (strcmp(partition, "boot") != 0 && strcmp(partition, "recovery") != 0)
return 6;
// always restore boot, regardless of whether recovery or boot is flashed.
// this is because boot and recovery are the same on some samsung phones.
int ret = restore_internal("/dev/block/bml7", filename);
if (ret != 0)
return ret;
int ret = -1;
if (strcmp(partition, "recoveryonly") != 0) {
// always restore boot, regardless of whether recovery or boot is flashed.
// this is because boot and recovery are the same on some samsung phones.
// unless of course, recoveryonly is explictly chosen (bml8)
ret = restore_internal("/dev/block/bml7", filename);
if (ret != 0)
return ret;
}
if (strcmp(partition, "recovery") == 0)
if (strcmp(partition, "recovery") == 0 || strcmp(partition, "recoveryonly") == 0)
ret = restore_internal("/dev/block/bml8", filename);
return ret;
}