Fix graphics corruption on some devices. BML restore needs to unlock first.
Change-Id: Ib6ede1dee0a0a4494319cfdb1613be2e89260874
diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c
index 5709cc5..92bd929 100644
--- a/bmlutils/bmlutils.c
+++ b/bmlutils/bmlutils.c
@@ -21,9 +21,14 @@
#include <sys/wait.h>
extern int __system(const char *command);
+#define BML_UNLOCK_ALL 0x8A29 ///< unlock all partition RO -> RW
int cmd_bml_restore_raw_partition(const char *partition, const char *filename)
{
+ printf("bml restore\n");
+ int fd = open("/dev/block/bml7", O_RDWR | O_LARGEFILE);
+ return ioctl(fd, BML_UNLOCK_ALL, 0);
+
char tmp[PATH_MAX];
sprintf("dd if=%s of=/dev/block/bml7 bs=4096", filename);
return __system(tmp);