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; }