Mount system as read-only by default

Mounting system as rw can prevent future OTA updates. The purpose
of this patch set is to prevent TWRP from mounting sytem as rw on
the first boot. Device maintainers should update their twrp.fstab
files on these devices to include an additional line:
/system_image emmc /dev/block/../system

This line will allow TWRP to create a raw system image backup to
ensure that the user can return to an original state for future
OTA updates.

Change-Id: I8929d85bc3a5b96cc564bc7f734b58d5612ec833
This commit is contained in:
Ethan Yonker
2015-05-18 10:23:03 -05:00
parent f746dbb054
commit eb32b1ff00
13 changed files with 459 additions and 7 deletions

View File

@@ -852,6 +852,8 @@ void DataManager::SetDefaultValues()
mConstValues.insert(make_pair("tw_has_mtp", "0"));
mConstValues.insert(make_pair("tw_mtp_enabled", "0"));
#endif
mValues.insert(make_pair("tw_mount_system_ro", make_pair("1", 1)));
mValues.insert(make_pair("tw_never_show_system_ro_page", make_pair("0", 1)));
pthread_mutex_unlock(&m_valuesLock);
}