super partition: mount super partitions using fs_mgr
We are now requiring fstab v2 for android-10+ trees. You can specify twrp flags using /etc/twrp.flags to label and annotate partitions. This patchset uses fs_mgr to load the super partition and build device mapper blocks off vendor and system depending on the slot in use. These are mapped to partitions in TWRP and allowed to be mounted read-only. The super partition is also mapped into a TWRP partition in order to backup the entire partition. You cannot backup individual device mapper blocks due to the device can only be read-only. Therefore you cannot write back to the device mapper. Change-Id: Icc1d895dcf96ad5ba03989c9bf759419d83673a3
This commit is contained in:
@@ -198,6 +198,10 @@ int main(int argc, char **argv) {
|
||||
return -1;
|
||||
}
|
||||
PartitionManager.Output_Partition_Logging();
|
||||
|
||||
if (PartitionManager.Get_Super_Status())
|
||||
PartitionManager.Setup_Super_Devices();
|
||||
|
||||
// Load up all the resources
|
||||
gui_loadResources();
|
||||
|
||||
@@ -374,23 +378,29 @@ int main(int argc, char **argv) {
|
||||
TWPartition* ven = PartitionManager.Find_Partition_By_Path("/vendor");
|
||||
|
||||
if (sys) {
|
||||
if ((DataManager::GetIntValue("tw_mount_system_ro") == 0 && sys->Check_Lifetime_Writes() == 0) || DataManager::GetIntValue("tw_mount_system_ro") == 2) {
|
||||
if (DataManager::GetIntValue("tw_never_show_system_ro_page") == 0) {
|
||||
DataManager::SetValue("tw_back", "main");
|
||||
if (gui_startPage("system_readonly", 1, 1) != 0) {
|
||||
LOGERR("Failed to start system_readonly GUI page.\n");
|
||||
if (sys->Get_Super_Status()) {
|
||||
if (!PartitionManager.Prepare_All_Super_Volumes()) {
|
||||
LOGERR("Unable to prepare super volumes.\n");
|
||||
}
|
||||
} else {
|
||||
if ((DataManager::GetIntValue("tw_mount_system_ro") == 0 && sys->Check_Lifetime_Writes() == 0) || DataManager::GetIntValue("tw_mount_system_ro") == 2) {
|
||||
if (DataManager::GetIntValue("tw_never_show_system_ro_page") == 0) {
|
||||
DataManager::SetValue("tw_back", "main");
|
||||
if (gui_startPage("system_readonly", 1, 1) != 0) {
|
||||
LOGERR("Failed to start system_readonly GUI page.\n");
|
||||
}
|
||||
} else if (DataManager::GetIntValue("tw_mount_system_ro") == 0) {
|
||||
sys->Change_Mount_Read_Only(false);
|
||||
if (ven)
|
||||
ven->Change_Mount_Read_Only(false);
|
||||
}
|
||||
} else if (DataManager::GetIntValue("tw_mount_system_ro") == 0) {
|
||||
} else if (DataManager::GetIntValue("tw_mount_system_ro") == 1) {
|
||||
// Do nothing, user selected to leave system read only
|
||||
} else {
|
||||
sys->Change_Mount_Read_Only(false);
|
||||
if (ven)
|
||||
ven->Change_Mount_Read_Only(false);
|
||||
}
|
||||
} else if (DataManager::GetIntValue("tw_mount_system_ro") == 1) {
|
||||
// Do nothing, user selected to leave system read only
|
||||
} else {
|
||||
sys->Change_Mount_Read_Only(false);
|
||||
if (ven)
|
||||
ven->Change_Mount_Read_Only(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user