Treat /vendor like /system for read only

The vendor partition is verity checked just like system so we
should treat vendor as read only same as system.

Change-Id: Ida65c9f44d8610e52fcdcef0b4a50faf5c7110d2
This commit is contained in:
Ethan Yonker
2015-11-05 21:07:21 +02:00
committed by Dees Troy
parent 0543f06679
commit 1673e3d4ea
3 changed files with 30 additions and 0 deletions
+5
View File
@@ -345,6 +345,7 @@ int main(int argc, char **argv) {
#ifndef TW_OEM_BUILD
// Check if system has never been changed
TWPartition* sys = PartitionManager.Find_Partition_By_Path("/system");
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) {
@@ -354,11 +355,15 @@ int main(int argc, char **argv) {
}
} 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") == 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