Adopted Storage: Add support for mixed mode sdcards
* Adds support for mixed adopted storage + removable
storage partitioned sdcards.
* Also symlinks Adopted Storage datamedia folder to an
available /sdcardN (N being 2 through 9) folder.
* Requires a suitable entry in fstab, for example:
# Removable Storage
/sd_ext ext4 /dev/block/mmcblk1p2 /dev/block/mmcblk1
flags=storage;wipeingui;removable;encryptable=footer
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
flags=storage;wipeingui;removable;encryptable=footer
/sd_ext will be the mountpoint for adopted storage, and /sdcardN
will become symlinked to /sd_ext/data/media[/0]
* Fix adopted storage nickname being ""
* Output adopted partition info after successful decrypt
* Mimic single lun code for multi lun devices:
"Mount CurrentStoragePath if it's not /data"
Change-Id: I3874c09f1a1c3a81f04277e17f17cc03ecb4184a
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 01c1c9e..13a488c 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -2055,8 +2055,12 @@
Mount2 = Find_Next_Storage(Mount1->Mount_Point, true);
if (Mount2 && Mount2->Mount_Point != Mount1->Mount_Point) {
Open_Lun_File(Mount2->Mount_Point, lun_file);
+ // Mimic single lun code: Mount CurrentStoragePath if it's not /data
+ } else if (TWFunc::Get_Root_Path(DataManager::GetCurrentStoragePath()) != "/data") {
+ Open_Lun_File(DataManager::GetCurrentStoragePath(), lun_file);
}
- } else {
+ // Mimic single lun code: Mount CurrentStoragePath if it's not /data
+ } else if (TWFunc::Get_Root_Path(DataManager::GetCurrentStoragePath()) != "/data" && !Open_Lun_File(DataManager::GetCurrentStoragePath(), lun_file)) {
gui_err("unable_locate_storage=Unable to locate storage device.");
goto error_handle;
}