[HD2 Android NAND Development] arif-ali:
Thanks for your extensive testing, will investigate the code further and see if I can spot anything

Here's the diff, for anyone who can spot the issue

diff --git a/Android.mk b/Android.mk
index 5322222..1d5a056 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,7 +26,7 @@ LOCAL_MODULE := recovery

LOCAL_FORCE_STATIC_EXECUTABLE := true

-RECOVERY_VERSION := ClockworkMod Recovery v3.2.0.0
+RECOVERY_VERSION := ClockworkMod Recovery v3.2.0.1
LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c
index 9f8ee2f..9ef04b4 100644
--- a/bmlutils/bmlutils.c
+++ b/bmlutils/bmlutils.c
@@ -58,16 +58,20 @@ static int restore_internal(const char* bml, const char* filename)

int cmd_bml_restore_raw_partition(const char *partition, const char *filename)
{
- if (strcmp(partition, "boot") != 0 && strcmp(partition, "recovery") != 0)
+ if (strcmp(partition, "boot") != 0 && strcmp(partition, "recovery") != 0 && strcmp(partition, "recoveryonly") != 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;
}
diff --git a/extendedcommands.c b/extendedcommands.c
index 6799b2d..cb44cb1 100644
--- a/extendedcommands.c
+++ b/extendedcommands.c
@@ -494,7 +494,7 @@ int is_safe_to_format(char* name)
{
char str[255];
char* partition;
- property_get("ro.recovery.format_ignore_partitions", str, "/misc,/radio,/bootloader,/recovery");
+ property_get("ro.cwm.forbid_format", str, "/misc,/radio,/bootloader,/recovery");

partition = strtok(str, ", ");
while (partition != NULL) {
@@ -641,8 +641,6 @@ int extendedcommand_file_exists()
return 0 == stat(EXTENDEDCOMMAND_SCRIPT, &file_info);
}

-void process_volumes();
-
int edify_main(int argc, char** argv) {
load_volume_table();
process_volumes();
diff --git a/extendedcommands.h b/extendedcommands.h
index a016b84..101552f 100644
--- a/extendedcommands.h
+++ b/extendedcommands.h
@@ -47,3 +47,13 @@ void create_fstab();
int has_datadata();

void handle_failure(int ret);
+
+void process_volumes();
+
+int extendedcommand_file_exists();
+
+void show_install_update_menu();
+
+int confirm_selection(const char* title, const char* confirm);
+
+int run_and_remove_extendedcommand();
diff --git a/flashutils/flashutils.c b/flashutils/flashutils.c
index 2addc72..27f0c66 100644
--- a/flashutils/flashutils.c
+++ b/flashutils/flashutils.c
@@ -71,7 +71,6 @@ __system(const char *command)
}

-
int edify_main(int argc, char** argv) {
load_volume_table();
process_volumes();
diff --git a/extendedcommands.h b/extendedcommands.h
index a016b84..101552f 100644
--- a/extendedcommands.h
+++ b/extendedcommands.h
@@ -47,3 +47,13 @@ void create_fstab();
int has_datadata();

+void process_volumes();
+
+int extendedcommand_file_exists();
+
+void show_install_update_menu();
+
+int confirm_selection(const char* title, const char* confirm);
+
+int run_and_remove_extendedcommand();
diff --git a/flashutils/flashutils.c b/flashutils/flashutils.c
index 2addc72..27f0c66 100644
--- a/flashutils/flashutils.c
+++ b/flashutils/flashutils.c
@@ -71,7 +71,6 @@ __system(const char *command)

int get_flash_type(const char* partitionType) {
- printf("get_flash_type partitionType: %s\n", partitionType);

type = MTD;
@@ -79,7 +78,6 @@

type = BML;
- printf("get_flash_type type: %d\n", type);

@@ -97,9 +95,6 @@ static int detect_partition(const char *partitionType, const char *partition)
type = get_flash_type(partitionType);
}

- printf("partitionType: %s\n", partitionType);
- printf("partition: %s\n", partition);
- printf("detected type: %d\n", type);
return type;
}
int restore_raw_partition(const char* partitionType, const char *partition, const char *filename)
diff --git a/updater/install.c b/updater/install.c
index d23ec64..8d2a5b1 100644
--- a/updater/install.c
+++ b/updater/install.c
@@ -36,6 +36,8 @@
#include "updater.h"
#include "applypatch/applypatch.h"

+#include "flashutils/flashutils.h"
+
#ifdef USE_EXT4
#include "make_ext4fs.h"
#endif
@@ -698,7 +700,7 @@ Value* WriteRawImageFn(const char* name, State* state, int argc, Expr* argv[]) {
goto done;
}

- if (0 == restore_raw_partition(partition, filename))
+ if (0 == restore_raw_partition(NULL, partition, filename))
result = strdup(partition);
else
result = strdup("");