aboutsummaryrefslogtreecommitdiffstats
path: root/bmlutils
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2010-12-21 15:14:21 -0800
committerKoushik Dutta <koushd@gmail.com>2010-12-21 15:14:21 -0800
commit03cf72a4f5897807da89cb06c03396cb892d457b (patch)
tree9f9e6179e44e8497e5975fc6f9a98c9e6ffbbf71 /bmlutils
parent745b5ff987eae4be3f9e2091a5abd9ce2b74991e (diff)
downloadbootable_recovery-03cf72a4f5897807da89cb06c03396cb892d457b.zip
bootable_recovery-03cf72a4f5897807da89cb06c03396cb892d457b.tar.gz
bootable_recovery-03cf72a4f5897807da89cb06c03396cb892d457b.tar.bz2
fix restore
Change-Id: I97d2bb16b364e701e9c37567b5c07e30be00fafb
Diffstat (limited to 'bmlutils')
-rw-r--r--bmlutils/bmlutils.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c
index 1cc28b2..f63bc78 100644
--- a/bmlutils/bmlutils.c
+++ b/bmlutils/bmlutils.c
@@ -23,6 +23,7 @@
extern int __system(const char *command);
#define BML_UNLOCK_ALL 0x8A29 ///< unlock all partition RO -> RW
+
static int restore_internal(const char* bml, const char* filename)
{
char buf[4096];
@@ -57,17 +58,17 @@ static int restore_internal(const char* bml, const char* filename)
int cmd_bml_restore_raw_partition(const char *partition, const char *filename)
{
- char *bml;
- if (strcmp(partition, "boot") == 0 || strcmp(partition, "recovery") == 0)
- bml = "/dev/block/bml7";
- else
+ 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;
- ret = restore_internal("/dev/block/bml8", filename);
+ if (strcmp(partition, "recovery") == 0)
+ ret = restore_internal("/dev/block/bml8", filename);
return ret;
}