Adding module for selinux bug metadata feature

Concatenates all 'bug_map' files and places the file on device under
/system/etc/selinux/bug_mappings

Bug: 34997782
Test: the file appears properly on device when bug_map files are present
Change-Id: I12d6c90983932f7d5e1d1f7586fa30a5edd7b0c5
This commit is contained in:
Max Bires 2017-08-15 13:10:08 -07:00
parent 6f11fa2edd
commit ab7732d8e1

View file

@ -215,6 +215,12 @@ LOCAL_REQUIRED_MODULES += \
nonplat_file_contexts \
plat_file_contexts \
ifneq ($(TARGET_BUILD_VARIANT), user)
LOCAL_REQUIRED_MODULES += \
selinux_denial_metadata \
endif
ifneq ($(with_asan),true)
LOCAL_REQUIRED_MODULES += \
sepolicy_tests \
@ -657,6 +663,24 @@ file_contexts.device.sorted.tmp :=
file_contexts.device.tmp :=
file_contexts.local.tmp :=
##################################
ifneq ($(TARGET_BUILD_VARIANT), user)
include $(CLEAR_VARS)
LOCAL_MODULE := selinux_denial_metadata
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
include $(BUILD_SYSTEM)/base_rules.mk
bug_files := $(call build_policy, bug_map, $(LOCAL_PATH) $(PLAT_PRIVATE_POLICY) $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(PLAT_PUBLIC_POLICY))
$(LOCAL_BUILT_MODULE) : $(bug_files)
@mkdir -p $(dir $@)
cat $^ > $@
bug_files :=
endif
##################################
include $(CLEAR_VARS)