partitionmanager: unmount oem & vendor asap
* mounted partitions overrides the services available in the ramdisk, causes chaos during decryption
* Fixes the often occured unmount vendor error
Change-Id: I60dac432fe9c1e3a8c90bf1dd63a7ac460c5d053
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 88e2dbd..2695b65 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -345,7 +345,6 @@
TWPartition* ven = PartitionManager.Find_Partition_By_Path("/vendor");
TWPartition* odm = PartitionManager.Find_Partition_By_Path("/odm");
if (!parse_userdata) {
-
if (ven) ven->Mount(Display_Error);
if (odm) odm->Mount(Display_Error);
if (TWFunc::Find_Fstab(Fstab_Filename)) {
@@ -364,13 +363,16 @@
Reset_Prop_From_Partition("external_storage.projid.enabled", "", ven, odm);
Reset_Prop_From_Partition("external_storage.casefold.enabled", "", ven, odm);
Reset_Prop_From_Partition("external_storage.sdcardfs.enabled", "", ven, odm);
+
+ if (ven) ven->UnMount(Display_Error);
+ if (odm) odm->UnMount(Display_Error);
goto parse;
} else {
+ if (ven) ven->UnMount(Display_Error);
+ if (odm) odm->UnMount(Display_Error);
LOGINFO("Unable to parse vendor fstab\n");
}
}
- if (ven) ven->UnMount(Display_Error);
- if (odm) odm->UnMount(Display_Error);
LOGINFO("Done processing fstab files\n");
return true;