diff --git a/fs_mgr/Android.mk b/fs_mgr/Android.mk index 7c66f6ab..48b11b69 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 99adb81d..848743c0 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); } diff --git a/init/init.c b/init/init.c index 40eae799..7c422a1c 100755 --- a/init/init.c +++ b/init/init.c @@ -174,8 +174,8 @@ void service_start(struct service *svc, const char *dynamic_args) pid_t pid; int needs_console; int n; -#ifdef HAVE_SELINUX char *scon = NULL; +#ifdef HAVE_SELINUX int rc; #endif /* starting a service removes it from the disabled or reset diff --git a/libcorkscrew/Android.mk b/libcorkscrew/Android.mk index 2786d8fe..69ca737a 100644 --- a/libcorkscrew/Android.mk +++ b/libcorkscrew/Android.mk @@ -51,7 +51,7 @@ endif LOCAL_SHARED_LIBRARIES += libdl libcutils libgccdemangle -LOCAL_CFLAGS += -std=gnu99 -Werror +LOCAL_CFLAGS += -std=gnu99 -Werror $(call cc-option,-Wno-error=unused-parameter) LOCAL_MODULE := libcorkscrew LOCAL_MODULE_TAGS := optional