twrp.cpp: Split up Partition Setup

 * Fixes starting gui prior Decryption

Change-Id: If6343e37c33f774bf4be1ad81789667f85b69dd4
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 17b2c5e..88e2dbd 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -346,8 +346,8 @@
 	TWPartition* odm = PartitionManager.Find_Partition_By_Path("/odm");
 	if (!parse_userdata) {
 
-		if (ven) ven->Mount(true);
-		if (odm) odm->Mount(true);
+		if (ven) ven->Mount(Display_Error);
+		if (odm) odm->Mount(Display_Error);
 		if (TWFunc::Find_Fstab(Fstab_Filename)) {
 			string service;
 			LOGINFO("Fstab: %s\n", Fstab_Filename.c_str());
@@ -369,13 +369,10 @@
 			LOGINFO("Unable to parse vendor fstab\n");
 		}
 	}
-	if (ven) ven->UnMount(true);
-	if (odm) odm->UnMount(true);
+	if (ven) ven->UnMount(Display_Error);
+	if (odm) odm->UnMount(Display_Error);
 	LOGINFO("Done processing fstab files\n");
 
-	if (recovery_mode) {
-		Setup_Fstab_Partitions(Display_Error);
-	}
 	return true;
 }
 
@@ -411,9 +408,9 @@
 		TWPartition* ven = PartitionManager.Find_Partition_By_Path("/vendor");
 		if (sys) {
 			if (sys->Get_Super_Status()) {
-				sys->Mount(true);
+				sys->Mount(Display_Error);
 				if (ven) {
-					ven->Mount(true);
+					ven->Mount(Display_Error);
 				}
 	#ifdef TW_EXCLUDE_APEX
 				LOGINFO("Apex is disabled in this build\n");
@@ -431,9 +428,9 @@
 		}
 	#ifndef USE_VENDOR_LIBS
 		if (ven)
-			ven->UnMount(true);
+			ven->UnMount(Display_Error);
 		if (sys)
-			sys->UnMount(true);
+			sys->UnMount(Display_Error);
 	#endif
 
 		if (!datamedia && !settings_partition && Find_Partition_By_Path("/sdcard") == NULL && Find_Partition_By_Path("/internal_sd") == NULL && Find_Partition_By_Path("/internal_sdcard") == NULL && Find_Partition_By_Path("/emmc") == NULL) {
diff --git a/twrp.cpp b/twrp.cpp
index 02f88e9..500014a 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -407,6 +407,8 @@
 	printf("Starting the UI...\n");
 	gui_init();
 
+	if (!startup.Get_Fastboot_Mode()) PartitionManager.Setup_Fstab_Partitions(true);
+
 	// Load up all the resources
 	gui_loadResources();