summaryrefslogtreecommitdiffstats
path: root/partitionmanager.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-07-03 21:55:19 +0200
committerDees_Troy <dees_troy@teamw.in>2013-07-03 21:55:35 +0200
commitd93bda5916b2466b3e9b4123f7da7c6fb298daa4 (patch)
tree99d8b7817bf3fe3f525a2aabcaca53569c84485a /partitionmanager.cpp
parentupdate to newest exfat changes (diff)
downloadandroid_bootable_recovery-d93bda5916b2466b3e9b4123f7da7c6fb298daa4.tar
android_bootable_recovery-d93bda5916b2466b3e9b4123f7da7c6fb298daa4.tar.gz
android_bootable_recovery-d93bda5916b2466b3e9b4123f7da7c6fb298daa4.tar.bz2
android_bootable_recovery-d93bda5916b2466b3e9b4123f7da7c6fb298daa4.tar.lz
android_bootable_recovery-d93bda5916b2466b3e9b4123f7da7c6fb298daa4.tar.xz
android_bootable_recovery-d93bda5916b2466b3e9b4123f7da7c6fb298daa4.tar.zst
android_bootable_recovery-d93bda5916b2466b3e9b4123f7da7c6fb298daa4.zip
Diffstat (limited to 'partitionmanager.cpp')
-rw-r--r--partitionmanager.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index dd2dfd2c4..fc76c1ada 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -245,7 +245,7 @@ int TWPartitionManager::Mount_By_Path(string Path, bool Display_Error) {
bool found = false;
string Local_Path = TWFunc::Get_Root_Path(Path);
- if (Local_Path == "/tmp")
+ if (Local_Path == "/tmp" || Local_Path == "/")
return true;
// Iterate through all partitions
@@ -1869,3 +1869,25 @@ void TWPartitionManager::Get_Partition_List(string ListType, std::vector<Partiti
int TWPartitionManager::Fstab_Processed(void) {
return Partitions.size();
}
+
+void TWPartitionManager::Output_Storage_Fstab(void) {
+ std::vector<TWPartition*>::iterator iter;
+ char storage_partition[255];
+ string Temp;
+ FILE *fp = fopen("/cache/recovery/storage.fstab", "w");
+
+ if (fp == NULL) {
+ LOGERR("Unable to open '/cache/recovery/storage.fstab'.\n");
+ return;
+ }
+
+ // Iterate through all partitions
+ for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
+ if ((*iter)->Is_Storage) {
+ Temp = (*iter)->Storage_Path + ";" + (*iter)->Storage_Name + ";\n";
+ strcpy(storage_partition, Temp.c_str());
+ fwrite(storage_partition, sizeof(storage_partition[0]), strlen(storage_partition) / sizeof(storage_partition[0]), fp);
+ }
+ }
+ fclose(fp);
+} \ No newline at end of file