diff --git a/Android.mk b/Android.mk index c990d4ddbca61cb591ab4a67acd14e294a895bed..fb6abc29f35a60dcd7d9e39d2307a87d885363b4 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 9ba3f952feadbf13af01a436a34bb05f8bd45092..891f5f027596fff5d45eed0c750858eefc99a21a 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -38,7 +38,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