From 195e06be59d1868b00544634da673a0eae3b103e Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 29 May 2011 19:33:42 -0700 Subject: [PATCH] allow flashing only bml8 if explicitly specified. Change-Id: Ie0d282105413b3a448436c9ee69206718e924754 --- bmlutils/bmlutils.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c index 9f8ee2f..d81cf11 100644 --- a/bmlutils/bmlutils.c +++ b/bmlutils/bmlutils.c @@ -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; }