summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-07-21 14:25:47 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-07-21 14:25:47 +0100
commit806fc566fd4544cfcd3334aa1a992bab0f6d277c (patch)
treef1617e3542cc29aa226ef32afa0ddbb07d8406c6
parent1a18b8bce5d8ae0ed5f8e8e6aeb4541486da64bb (diff)
downloadsystem_core-806fc566fd4544cfcd3334aa1a992bab0f6d277c.zip
system_core-806fc566fd4544cfcd3334aa1a992bab0f6d277c.tar.gz
system_core-806fc566fd4544cfcd3334aa1a992bab0f6d277c.tar.bz2
fs_mgr: Drop the context mount option from non-selinux builds
This will require that transitioning devices have context as the last mount option, since everything after it will be ignored Change-Id: Ic5cc7f5632cc3d62459dfaaf7719d662737e1641
-rw-r--r--fs_mgr/Android.mk4
-rw-r--r--fs_mgr/fs_mgr.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/fs_mgr/Android.mk b/fs_mgr/Android.mk
index 7c66f6a..48b11b6 100644
--- a/fs_mgr/Android.mk
+++ b/fs_mgr/Android.mk
@@ -3,6 +3,10 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+ifeq ($(HAVE_SELINUX),true)
+LOCAL_CFLAGS += -DHAVE_SELINUX
+endif
+
LOCAL_SRC_FILES:= fs_mgr.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index 99adb81..848743c 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -456,6 +456,15 @@ int fs_mgr_mount_all(char *fstab_file)
}
for (i = 0; fstab[i].blk_dev; i++) {
+#ifndef HAVE_SELINUX
+ char *contextpos = strstr(fstab[i].fs_options,",context=");
+
+ /* This makes it mandatory that context is the LAST mount option */
+ if (contextpos != NULL) {
+ *contextpos='\0';
+ }
+#endif
+
if (fstab[i].fs_mgr_flags & MF_WAIT) {
wait_for_file(fstab[i].blk_dev, WAIT_TIMEOUT);
}