Fix bin:mtd_info

Change-Id: Ie96ff83a132a381219b7bcf609d1936e0c381148
diff --git a/mbtk/libmbtk_lib/src/mbtk_mtd.c b/mbtk/libmbtk_lib/src/mbtk_mtd.c
index 6129bc1..b17b27f 100755
--- a/mbtk/libmbtk_lib/src/mbtk_mtd.c
+++ b/mbtk/libmbtk_lib/src/mbtk_mtd.c
@@ -43,7 +43,9 @@
     char size_str[16];
     char name[32];
     char erase_size_str[16];
+    char name_temp[32];
     memset(buff, 0x0, 64);
+    memset(name_temp, 0x0, 32);
     while(fgets(buff, 64, fp)) {
         if(str_startwith(buff, "mtd")) {
             memset(size_str, 0x0, 16);
@@ -63,8 +65,29 @@
 
                 partition_list[index].partition_size = (uint32)strtoul(size_str, NULL, 16);
                 partition_list[index].erase_size = (uint32)strtoul(erase_size_str, NULL, 16);
-                if(index > 0) {
-                    partition_list[index].partition_start = partition_list[index - 1].partition_start + partition_list[index - 1].partition_size;
+                // XXX-sdtim or XXX-mount
+                ssize_t index_sdtim = str_indexof(partition_list[index].name, "-sdtim");
+                ssize_t index_mount = str_indexof(partition_list[index].name, "-mount");
+                if(index_sdtim > 0 || index_mount > 0) {
+                    if(index_sdtim > 0) {
+                        memcpy(name_temp, partition_list[index].name, index_sdtim);
+                    } else {
+                        memcpy(name_temp, partition_list[index].name, index_mount);
+                    }
+                    if(index > 0) {
+                        partition_list[index].partition_start = partition_list[index - 1].partition_start + partition_list[index - 1].partition_size;
+                    }
+                } else {
+                    if(strlen(name_temp) > 0) {
+                        memset(name_temp, 0x0, 32);
+                        if(index > 0) {
+                            partition_list[index].partition_start = partition_list[index - 2].partition_start;
+                        }
+                    } else {
+                        if(index > 0) {
+                            partition_list[index].partition_start = partition_list[index - 1].partition_start + partition_list[index - 1].partition_size;
+                        }
+                    }
                 }
                 partition_list[index].used = TRUE;
             } else {
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
index ea7e3ff..65c25d5 100755
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -6402,7 +6402,7 @@
             }
             else // Set band success.
             {
-                log_hex("BAND-2", &band_set_info, sizeof(band_set_info_t));
+                // log_hex("BAND-2", &band_set_info, sizeof(band_set_info_t));
                 band_set_success = TRUE;
                 if(band_area == MBTK_MODEM_BAND_AREA_CN) {
                     property_set("persist.mbtk.band_config", "CN");