Fix multiple lun file USB mounting
Both the incorrect mount point and the incorrect lun file were being
passed as the second storage volume.
Change-Id: If9c7d92d1992ec022a2c89a82b2ea05c9150d635
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index b947d43..9d8c273 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1573,7 +1573,6 @@
int TWPartitionManager::usb_storage_enable(void) {
int has_dual, has_data_media;
char lun_file[255];
- string ext_path;
bool has_multiple_lun = false;
DataManager::GetValue(TW_HAS_DATA_MEDIA, has_data_media);
@@ -1608,9 +1607,10 @@
if (Mount1) {
if (!Open_Lun_File(Mount1->Mount_Point, lun_file))
return false;
+ sprintf(lun_file, CUSTOM_LUN_FILE, 1);
Mount2 = Find_Next_Storage(Mount1->Mount_Point, "/data");
if (Mount2) {
- Open_Lun_File(ext_path, lun_file);
+ Open_Lun_File(Mount2->Mount_Point, lun_file);
}
} else {
LOGERR("Unable to find storage partition to mount to USB\n");