summaryrefslogtreecommitdiffstats
path: root/partitionmanager.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-05-28 16:44:41 +0200
committerEthan Yonker <dees_troy@teamw.in>2015-05-28 16:47:25 +0200
commita2719156c236c8be02403ef028490f001d393d8e (patch)
treef61805a35f33ae82216d0123dc72488ef8ea2fc1 /partitionmanager.cpp
parentMount system as read-only by default (diff)
downloadandroid_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.gz
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.bz2
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.lz
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.xz
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.zst
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.zip
Diffstat (limited to 'partitionmanager.cpp')
-rw-r--r--partitionmanager.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 055f73697..572cd7c93 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1259,6 +1259,34 @@ int TWPartitionManager::Repair_By_Path(string Path, bool Display_Error) {
return false;
}
+int TWPartitionManager::Resize_By_Path(string Path, bool Display_Error) {
+ std::vector<TWPartition*>::iterator iter;
+ int ret = false;
+ bool found = false;
+ string Local_Path = TWFunc::Get_Root_Path(Path);
+
+ if (Local_Path == "/tmp" || Local_Path == "/")
+ return true;
+
+ // Iterate through all partitions
+ for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
+ if ((*iter)->Mount_Point == Local_Path || (!(*iter)->Symlink_Mount_Point.empty() && (*iter)->Symlink_Mount_Point == Local_Path)) {
+ ret = (*iter)->Resize();
+ found = true;
+ } else if ((*iter)->Is_SubPartition && (*iter)->SubPartition_Of == Local_Path) {
+ (*iter)->Resize();
+ }
+ }
+ if (found) {
+ return ret;
+ } else if (Display_Error) {
+ LOGERR("Resize: Unable to find partition for path '%s'\n", Local_Path.c_str());
+ } else {
+ LOGINFO("Resize: Unable to find partition for path '%s'\n", Local_Path.c_str());
+ }
+ return false;
+}
+
void TWPartitionManager::Update_System_Details(void) {
std::vector<TWPartition*>::iterator iter;
int data_size = 0;