diff --git a/Android.mk b/Android.mk index 737d31ab9..cfb8f74ae 100644 --- a/Android.mk +++ b/Android.mk @@ -190,8 +190,6 @@ LOCAL_REQUIRED_MODULES += \ plat_sepolicy.cil \ plat_and_mapping_sepolicy.cil.sha256 \ secilc \ - nonplat_file_contexts \ - plat_file_contexts \ plat_sepolicy_vers.txt \ treble_sepolicy_tests @@ -199,12 +197,15 @@ LOCAL_REQUIRED_MODULES += \ ifneq ($(PRODUCT_PRECOMPILED_SEPOLICY),false) LOCAL_REQUIRED_MODULES += precompiled_sepolicy precompiled_sepolicy.plat_and_mapping.sha256 endif - else # Use monolithic SELinux policy -LOCAL_REQUIRED_MODULES += sepolicy \ - file_contexts.bin +LOCAL_REQUIRED_MODULES += sepolicy endif + +LOCAL_REQUIRED_MODULES += \ + nonplat_file_contexts \ + plat_file_contexts + include $(BUILD_PHONY_PACKAGE) ################################## @@ -703,7 +704,11 @@ include $(CLEAR_VARS) LOCAL_MODULE := plat_file_contexts LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_TAGS := optional +ifeq ($(PRODUCT_FULL_TREBLE),true) LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux +else +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +endif include $(BUILD_SYSTEM)/base_rules.mk @@ -733,7 +738,11 @@ include $(CLEAR_VARS) LOCAL_MODULE := nonplat_file_contexts LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_TAGS := optional +ifeq ($(PRODUCT_FULL_TREBLE),true) LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux +else +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +endif include $(BUILD_SYSTEM)/base_rules.mk diff --git a/private/file_contexts b/private/file_contexts index 1e678ff11..a15dcb375 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -40,7 +40,6 @@ /sdcard u:object_r:rootfs:s0 # SELinux policy files -/file_contexts\.bin u:object_r:file_contexts_file:s0 /nonplat_file_contexts u:object_r:file_contexts_file:s0 /plat_file_contexts u:object_r:file_contexts_file:s0 /mapping_sepolicy\.cil u:object_r:sepolicy_file:s0