Fix 'No OS' on System_Image restore after wipe
* When you format the system partition, it will remain
in a mounted state.
* Subsequently restoring a system_image (even though
successfully) the Update_System_Details() function
will not correctly update the system partition
details.
* Reproducible by:
1- Advanced wipe: System
2- Restore: System_Image
3- Reboot -> No OS prompt
* eg: [
~ # twrp get tw_min_system
tw_min_system = 50
~ # twrp get tw_backup_system_size
tw_backup_system_size = 8
~ # mount -o ro /system
~ # du -sh /system
3.5G /system
]
Change-Id: I99f75274816788dd38eccdd387f7ac691e1f3fab
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index f70159c..9b1c1c9 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -999,6 +999,7 @@
}
}
TWFunc::GUI_Operation_Text(TW_UPDATE_SYSTEM_DETAILS_TEXT, gui_parse_text("{@updating_system_details}"));
+ UnMount_By_Path("/system", false);
Update_System_Details();
UnMount_Main_Partitions();
time(&rStop);