summaryrefslogtreecommitdiffstats
path: root/fs_mgr
diff options
context:
space:
mode:
authorGeremy Condra <gcondra@google.com>2014-04-02 13:42:06 -0700
committerGeremy Condra <gcondra@google.com>2014-04-02 18:07:22 -0700
commitcd642fc0b5ab4c17428bc35b670815e037a3a0af (patch)
tree27dec0887a0a561d060850b6608a68894c638b9b /fs_mgr
parent136317b1314521924cdab52ef1ed780095de3096 (diff)
downloadsystem_core-cd642fc0b5ab4c17428bc35b670815e037a3a0af.zip
system_core-cd642fc0b5ab4c17428bc35b670815e037a3a0af.tar.gz
system_core-cd642fc0b5ab4c17428bc35b670815e037a3a0af.tar.bz2
fs_mgr: disable verified partitions on debuggable devices.
This checks ro.debuggable to determine whether a device is in the debuggable state or not, disabling verification if it is. Eventually we'd like to narrow this down to only devices which need to disable it, but we aren't there yet. Change-Id: I06a329fe5449deab6bae595877dbb1f200850241
Diffstat (limited to 'fs_mgr')
-rw-r--r--fs_mgr/fs_mgr.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index 9ac68cd..c91033a 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -234,6 +234,15 @@ static int fs_match(char *in1, char *in2)
return ret;
}
+static int device_is_debuggable() {
+ int ret = -1;
+ char value[PROP_VALUE_MAX];
+ ret = __system_property_get("ro.debuggable", value);
+ if (ret < 0)
+ return ret;
+ return strcmp(value, "1") ? 0 : 1;
+}
+
int fs_mgr_mount_all(struct fstab *fstab)
{
int i = 0;
@@ -268,7 +277,8 @@ int fs_mgr_mount_all(struct fstab *fstab)
fstab->recs[i].mount_point);
}
- if (fstab->recs[i].fs_mgr_flags & MF_VERIFY) {
+ if ((fstab->recs[i].fs_mgr_flags & MF_VERIFY) &&
+ !device_is_debuggable()) {
if (fs_mgr_setup_verity(&fstab->recs[i]) < 0) {
ERROR("Could not set up verified partition, skipping!");
continue;
@@ -373,7 +383,8 @@ int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device,
fstab->recs[i].mount_point);
}
- if (fstab->recs[i].fs_mgr_flags & MF_VERIFY) {
+ if ((fstab->recs[i].fs_mgr_flags & MF_VERIFY) &&
+ !device_is_debuggable()) {
if (fs_mgr_setup_verity(&fstab->recs[i]) < 0) {
ERROR("Could not set up verified partition, skipping!");
continue;