2012-01-04 18:33:27 +01:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
2012-08-28 00:41:15 +02:00
|
|
|
|
2012-01-04 18:33:27 +01:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
# SELinux policy version.
|
2015-03-13 15:03:52 +01:00
|
|
|
# Must be <= /sys/fs/selinux/policyvers reported by the Android kernel.
|
2012-01-04 18:33:27 +01:00
|
|
|
# Must be within the compatibility range reported by checkpolicy -V.
|
2015-12-08 19:15:14 +01:00
|
|
|
POLICYVERS ?= 29
|
2012-01-04 18:33:27 +01:00
|
|
|
|
|
|
|
MLS_SENS=1
|
|
|
|
MLS_CATS=1024
|
|
|
|
|
2015-03-13 15:03:52 +01:00
|
|
|
ifdef BOARD_SEPOLICY_REPLACE
|
|
|
|
$(error BOARD_SEPOLICY_REPLACE is no longer supported; please remove from your BoardConfig.mk or other .mk file.)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef BOARD_SEPOLICY_IGNORE
|
|
|
|
$(error BOARD_SEPOLICY_IGNORE is no longer supported; please remove from your BoardConfig.mk or other .mk file.)
|
|
|
|
endif
|
2012-10-18 03:09:52 +02:00
|
|
|
|
2015-04-01 16:14:56 +02:00
|
|
|
ifdef BOARD_SEPOLICY_UNION
|
|
|
|
$(warning BOARD_SEPOLICY_UNION is no longer required - all files found in BOARD_SEPOLICY_DIRS are implicitly unioned; please remove from your BoardConfig.mk or other .mk file.)
|
|
|
|
endif
|
|
|
|
|
2015-07-16 20:28:02 +02:00
|
|
|
ifdef BOARD_SEPOLICY_M4DEFS
|
|
|
|
LOCAL_ADDITIONAL_M4DEFS := $(addprefix -D, $(BOARD_SEPOLICY_M4DEFS))
|
|
|
|
endif
|
|
|
|
|
2015-04-01 16:14:56 +02:00
|
|
|
# Builds paths for all policy files found in BOARD_SEPOLICY_DIRS.
|
2012-10-18 03:09:52 +02:00
|
|
|
# $(1): the set of policy name paths to build
|
2015-08-11 00:40:52 +02:00
|
|
|
build_policy = $(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(LOCAL_PATH) $(BOARD_SEPOLICY_DIRS)), $(sort $(wildcard $(file)))))
|
2012-03-06 17:12:41 +01:00
|
|
|
|
2015-12-11 11:39:19 +01:00
|
|
|
# Add a file containing only a newline in-between each policy configuration
|
|
|
|
# 'contexts' file. This will allow OEM policy configuration files without a
|
|
|
|
# final newline (0x0A) to be built correctly by the m4(1) macro processor.
|
|
|
|
# $(1): the set of contexts file names.
|
|
|
|
# $(2): the file containing only 0x0A.
|
|
|
|
add_nl = $(foreach entry, $(1), $(subst $(entry), $(entry) $(2), $(entry)))
|
|
|
|
|
2014-07-26 04:11:52 +02:00
|
|
|
sepolicy_build_files := security_classes \
|
|
|
|
initial_sids \
|
|
|
|
access_vectors \
|
|
|
|
global_macros \
|
2014-11-06 00:30:41 +01:00
|
|
|
neverallow_macros \
|
2014-07-26 04:11:52 +02:00
|
|
|
mls_macros \
|
|
|
|
mls \
|
|
|
|
policy_capabilities \
|
|
|
|
te_macros \
|
|
|
|
attributes \
|
2015-06-06 00:28:55 +02:00
|
|
|
ioctl_macros \
|
2014-07-26 04:11:52 +02:00
|
|
|
*.te \
|
|
|
|
roles \
|
|
|
|
users \
|
|
|
|
initial_sid_contexts \
|
|
|
|
fs_use \
|
|
|
|
genfs_contexts \
|
|
|
|
port_contexts
|
|
|
|
|
2012-01-18 02:51:09 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-12-11 11:39:19 +01:00
|
|
|
LOCAL_MODULE := sectxfile_nl
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
|
|
|
|
# Create a file containing newline only to add between context config files
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
$(LOCAL_BUILT_MODULE): $(all_fcfiles_with_nl) $(all_pcfiles_with_nl) $(all_svcfiles_with_nl)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) echo > $@
|
|
|
|
|
|
|
|
built_nl := $(LOCAL_BUILT_MODULE)
|
|
|
|
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2012-01-18 02:51:09 +01:00
|
|
|
LOCAL_MODULE := sepolicy
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
sepolicy_policy.conf := $(intermediates)/policy.conf
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
2015-07-16 20:28:02 +02:00
|
|
|
$(sepolicy_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2015-06-27 16:22:34 +02:00
|
|
|
$(sepolicy_policy.conf): $(call build_policy, $(sepolicy_build_files))
|
2012-01-18 02:51:09 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2015-07-16 20:28:02 +02:00
|
|
|
$(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
|
|
|
|
-D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
|
2014-01-11 10:31:03 +01:00
|
|
|
-D target_build_variant=$(TARGET_BUILD_VARIANT) \
|
|
|
|
-s $^ > $@
|
2013-03-27 11:30:25 +01:00
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2015-06-27 16:22:34 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(sepolicy_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy
|
2012-01-18 02:51:09 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2012-04-10 00:31:03 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@ $<
|
2013-03-27 11:30:25 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $(dir $<)/$(notdir $@).dontaudit $<.dontaudit
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2012-10-26 04:01:31 +02:00
|
|
|
built_sepolicy := $(LOCAL_BUILT_MODULE)
|
2012-01-18 02:51:09 +01:00
|
|
|
sepolicy_policy.conf :=
|
2012-10-02 18:46:37 +02:00
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := sepolicy.recovery
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := eng
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
sepolicy_policy_recovery.conf := $(intermediates)/policy_recovery.conf
|
|
|
|
$(sepolicy_policy_recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(sepolicy_policy_recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
2015-07-16 20:28:02 +02:00
|
|
|
$(sepolicy_policy_recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2015-06-27 16:22:34 +02:00
|
|
|
$(sepolicy_policy_recovery.conf): $(call build_policy, $(sepolicy_build_files))
|
2014-05-29 22:40:15 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-07-16 20:28:02 +02:00
|
|
|
$(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
|
|
|
|
-D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
|
2014-05-29 22:40:15 +02:00
|
|
|
-D target_build_variant=$(TARGET_BUILD_VARIANT) \
|
|
|
|
-D target_recovery=true \
|
|
|
|
-s $^ > $@
|
|
|
|
|
2015-06-27 16:22:34 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(sepolicy_policy_recovery.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy
|
2014-05-29 22:40:15 +02:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@ $<
|
|
|
|
|
|
|
|
built_sepolicy_recovery := $(LOCAL_BUILT_MODULE)
|
|
|
|
sepolicy_policy_recovery.conf :=
|
|
|
|
|
2014-07-26 04:11:52 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := general_sepolicy.conf
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
exp_sepolicy_build_files :=\
|
2015-08-11 00:40:52 +02:00
|
|
|
$(foreach file, $(addprefix $(LOCAL_PATH)/, $(sepolicy_build_files)), $(sort $(wildcard $(file))))
|
2014-07-26 04:11:52 +02:00
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_MLS_CATS := $(MLS_CATS)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(exp_sepolicy_build_files)
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
|
|
|
|
-D target_build_variant=user \
|
|
|
|
-s $^ > $@
|
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
|
|
|
|
2015-06-30 01:31:23 +02:00
|
|
|
built_general_sepolicy.conf := $(LOCAL_BUILT_MODULE)
|
2014-07-26 04:11:52 +02:00
|
|
|
exp_sepolicy_build_files :=
|
|
|
|
|
|
|
|
##################################
|
2012-10-02 18:46:37 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-06-30 01:31:23 +02:00
|
|
|
LOCAL_MODULE := sepolicy.general
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_BUILT_SEPOLICY.CONF := $(built_general_sepolicy.conf)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(built_general_sepolicy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@ $(PRIVATE_BUILT_SEPOLICY.CONF)
|
|
|
|
|
|
|
|
built_general_sepolicy := $(LOCAL_BUILT_MODULE)
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-08-06 18:43:52 +02:00
|
|
|
LOCAL_MODULE := file_contexts.bin
|
2012-01-18 02:51:09 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
|
2012-03-06 17:12:41 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2015-06-29 20:16:18 +02:00
|
|
|
all_fc_files := file_contexts
|
2015-09-18 21:05:51 +02:00
|
|
|
ifneq ($(filter address,$(SANITIZE_TARGET)),)
|
2015-06-29 20:16:18 +02:00
|
|
|
all_fc_files := $(all_fc_files) file_contexts_asan
|
2015-06-13 02:18:20 +02:00
|
|
|
endif
|
2015-06-29 20:16:18 +02:00
|
|
|
all_fc_files := $(call build_policy, $(all_fc_files))
|
2015-12-11 11:39:19 +01:00
|
|
|
all_fcfiles_with_nl := $(call add_nl, $(all_fc_files), $(built_nl))
|
2012-10-02 18:46:37 +02:00
|
|
|
|
2015-08-06 18:43:52 +02:00
|
|
|
file_contexts.tmp := $(intermediates)/file_contexts.tmp
|
2015-12-11 11:39:19 +01:00
|
|
|
$(file_contexts.tmp): PRIVATE_FC_FILES := $(all_fcfiles_with_nl)
|
2015-08-06 18:43:52 +02:00
|
|
|
$(file_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2015-12-11 11:39:19 +01:00
|
|
|
$(file_contexts.tmp): $(all_fc_files) $(all_fcfiles_with_nl) $(built_nl)
|
2012-03-06 17:12:41 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2015-07-16 20:28:02 +02:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_FC_FILES) > $@
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2015-09-25 19:18:44 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(file_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc
|
2015-08-06 18:43:52 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-09-25 19:18:44 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $<
|
2015-08-06 18:43:52 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $<
|
|
|
|
|
2014-03-20 14:35:08 +01:00
|
|
|
built_fc := $(LOCAL_BUILT_MODULE)
|
2015-06-29 20:16:18 +02:00
|
|
|
all_fc_files :=
|
2015-08-06 18:43:52 +02:00
|
|
|
file_contexts.tmp :=
|
2012-08-16 19:55:05 +02:00
|
|
|
|
2015-03-12 22:45:03 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-08-06 18:43:52 +02:00
|
|
|
LOCAL_MODULE := general_file_contexts.bin
|
2015-03-12 22:45:03 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2015-08-06 18:43:52 +02:00
|
|
|
general_file_contexts.tmp := $(intermediates)/general_file_contexts.tmp
|
2015-09-25 19:18:44 +02:00
|
|
|
$(general_file_contexts.tmp): $(addprefix $(LOCAL_PATH)/, file_contexts)
|
2015-03-12 22:45:03 +01:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $< > $@
|
|
|
|
|
2015-09-25 19:18:44 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(general_file_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc
|
2015-08-06 18:43:52 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-09-25 19:18:44 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $<
|
2015-08-06 18:43:52 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $<
|
|
|
|
|
|
|
|
general_file_contexts.tmp :=
|
2015-03-12 22:45:03 +01:00
|
|
|
|
2012-01-18 02:51:09 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := seapp_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
|
2012-08-16 19:55:05 +02:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2015-06-04 06:57:47 +02:00
|
|
|
all_sc_files := $(call build_policy, seapp_contexts)
|
2012-08-16 19:55:05 +02:00
|
|
|
|
2012-10-26 04:01:31 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2015-06-04 06:57:47 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(all_sc_files)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(built_sepolicy) $(all_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp
|
2012-08-28 00:41:15 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-06-30 22:53:51 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES)
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2014-03-20 14:35:08 +01:00
|
|
|
built_sc := $(LOCAL_BUILT_MODULE)
|
2015-06-04 06:57:47 +02:00
|
|
|
all_sc_files :=
|
2014-03-20 14:35:08 +01:00
|
|
|
|
2015-03-12 20:46:36 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := general_seapp_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2015-06-04 06:57:47 +02:00
|
|
|
all_sc_files := $(addprefix $(LOCAL_PATH)/, seapp_contexts)
|
2015-03-12 20:46:36 +01:00
|
|
|
|
2015-06-30 01:31:23 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy)
|
2015-06-04 06:57:47 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SC_FILE := $(all_sc_files)
|
2015-06-30 01:31:23 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(built_general_sepolicy) $(all_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp
|
2015-03-12 20:46:36 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2015-06-30 22:53:51 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILE)
|
2015-03-12 20:46:36 +01:00
|
|
|
|
2015-06-04 06:57:47 +02:00
|
|
|
all_sc_files :=
|
2015-03-12 20:46:36 +01:00
|
|
|
|
2015-06-25 20:59:30 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := general_seapp_neverallows
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): $(addprefix $(LOCAL_PATH)/, seapp_contexts)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
- $(hide) grep -ie '^neverallow' $< > $@
|
|
|
|
|
|
|
|
|
2012-04-04 16:11:16 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := property_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2015-07-30 20:44:26 +02:00
|
|
|
all_pc_files := $(call build_policy, property_contexts)
|
2015-12-11 11:39:19 +01:00
|
|
|
all_pcfiles_with_nl := $(call add_nl, $(all_pc_files), $(built_nl))
|
2015-07-30 20:44:26 +02:00
|
|
|
|
2015-09-29 22:52:37 +02:00
|
|
|
property_contexts.tmp := $(intermediates)/property_contexts.tmp
|
2015-12-11 11:39:19 +01:00
|
|
|
$(property_contexts.tmp): PRIVATE_PC_FILES := $(all_pcfiles_with_nl)
|
2015-09-29 22:52:37 +02:00
|
|
|
$(property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2015-12-11 11:39:19 +01:00
|
|
|
$(property_contexts.tmp): $(all_pc_files) $(all_pcfiles_with_nl) $(built_nl)
|
2015-09-29 22:52:37 +02:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@
|
|
|
|
|
2013-01-23 20:04:50 +01:00
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2015-09-29 22:52:37 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(property_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
2012-04-04 16:11:16 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-09-29 22:52:37 +02:00
|
|
|
$(hide) $(ACP) $< $@
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $<
|
2012-04-04 16:11:16 +02:00
|
|
|
|
2014-03-20 14:35:08 +01:00
|
|
|
built_pc := $(LOCAL_BUILT_MODULE)
|
2015-07-30 20:44:26 +02:00
|
|
|
all_pc_files :=
|
2015-09-29 22:52:37 +02:00
|
|
|
property_contexts.tmp :=
|
2014-03-20 14:35:08 +01:00
|
|
|
|
2014-06-06 00:52:02 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-03-12 22:45:03 +01:00
|
|
|
LOCAL_MODULE := general_property_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
2015-03-13 14:36:57 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2015-09-29 22:52:37 +02:00
|
|
|
general_property_contexts.tmp := $(intermediates)/general_property_contexts.tmp
|
|
|
|
$(general_property_contexts.tmp): $(addprefix $(LOCAL_PATH)/, property_contexts)
|
2015-09-29 22:52:37 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-10-01 23:25:09 +02:00
|
|
|
$(hide) m4 -s $< > $@
|
2015-09-29 22:52:37 +02:00
|
|
|
|
2015-09-29 22:52:37 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(general_property_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(ACP) $< $@
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $<
|
|
|
|
|
|
|
|
general_property_contexts.tmp :=
|
2015-03-12 22:45:03 +01:00
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2014-06-06 00:52:02 +02:00
|
|
|
LOCAL_MODULE := service_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2015-07-30 20:44:26 +02:00
|
|
|
all_svc_files := $(call build_policy, service_contexts)
|
2015-12-11 11:39:19 +01:00
|
|
|
all_svcfiles_with_nl := $(call add_nl, $(all_svc_files), $(built_nl))
|
2014-06-06 00:52:02 +02:00
|
|
|
|
2015-09-29 23:17:38 +02:00
|
|
|
service_contexts.tmp := $(intermediates)/service_contexts.tmp
|
2015-12-11 11:39:19 +01:00
|
|
|
$(service_contexts.tmp): PRIVATE_SVC_FILES := $(all_svcfiles_with_nl)
|
2015-09-29 23:17:38 +02:00
|
|
|
$(service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2015-12-11 11:39:19 +01:00
|
|
|
$(service_contexts.tmp): $(all_svc_files) $(all_svcfiles_with_nl) $(built_nl)
|
2015-09-29 23:17:38 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-10-01 23:22:16 +02:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
|
2015-09-29 23:17:38 +02:00
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $<
|
|
|
|
$(hide) $(ACP) $< $@
|
2014-06-06 00:52:02 +02:00
|
|
|
|
|
|
|
built_svc := $(LOCAL_BUILT_MODULE)
|
2015-07-30 20:44:26 +02:00
|
|
|
all_svc_files :=
|
2015-09-29 23:17:38 +02:00
|
|
|
service_contexts.tmp :=
|
2014-06-06 00:52:02 +02:00
|
|
|
|
2012-07-30 15:33:03 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-03-12 22:45:03 +01:00
|
|
|
LOCAL_MODULE := general_service_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2015-09-29 23:17:38 +02:00
|
|
|
general_service_contexts.tmp := $(intermediates)/general_service_contexts.tmp
|
|
|
|
$(general_service_contexts.tmp): $(addprefix $(LOCAL_PATH)/, service_contexts)
|
2015-09-29 23:17:38 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-10-01 23:22:16 +02:00
|
|
|
$(hide) m4 -s $< > $@
|
2015-09-29 23:17:38 +02:00
|
|
|
|
2015-09-29 23:17:38 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(general_service_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $<
|
|
|
|
$(hide) $(ACP) $< $@
|
|
|
|
|
|
|
|
general_service_contexts.tmp :=
|
2015-03-12 22:45:03 +01:00
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2013-03-27 13:35:39 +01:00
|
|
|
LOCAL_MODULE := mac_permissions.xml
|
2012-07-30 15:33:03 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/security
|
|
|
|
|
2012-11-30 23:59:09 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2012-07-30 15:33:03 +02:00
|
|
|
|
2013-03-26 19:19:12 +01:00
|
|
|
# Build keys.conf
|
|
|
|
mac_perms_keys.tmp := $(intermediates)/keys.tmp
|
2015-07-16 20:28:02 +02:00
|
|
|
$(mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2015-06-27 16:22:34 +02:00
|
|
|
$(mac_perms_keys.tmp): $(call build_policy, keys.conf)
|
2013-03-26 19:19:12 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2015-07-16 20:28:02 +02:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
|
2013-03-26 19:19:12 +01:00
|
|
|
|
2015-07-30 20:44:26 +02:00
|
|
|
all_mac_perms_files := $(call build_policy, $(LOCAL_MODULE))
|
2012-07-30 15:33:03 +02:00
|
|
|
|
2015-07-30 20:44:26 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_mac_perms_files)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py $(all_mac_perms_files)
|
2013-03-26 19:19:12 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2013-10-25 21:25:36 +02:00
|
|
|
$(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \
|
2015-07-30 20:44:26 +02:00
|
|
|
$(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
|
2013-03-26 19:19:12 +01:00
|
|
|
|
2013-03-27 13:35:39 +01:00
|
|
|
mac_perms_keys.tmp :=
|
2015-07-30 20:44:26 +02:00
|
|
|
all_mac_perms_files :=
|
|
|
|
|
2012-06-20 17:58:01 +02:00
|
|
|
##################################
|
2014-03-20 14:35:08 +01:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := selinux_version
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2015-06-27 16:22:34 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(built_sepolicy) $(built_pc) $(built_fc) $(built_sc) $(built_svc)
|
2014-03-20 14:35:08 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2015-07-17 22:08:41 +02:00
|
|
|
$(hide) echo -n $(BUILD_FINGERPRINT_FROM_FILE) > $@
|
2014-03-20 14:35:08 +01:00
|
|
|
|
|
|
|
##################################
|
2012-10-18 03:09:52 +02:00
|
|
|
|
|
|
|
build_policy :=
|
2014-07-26 04:11:52 +02:00
|
|
|
sepolicy_build_files :=
|
2014-03-20 14:35:08 +01:00
|
|
|
built_sepolicy :=
|
|
|
|
built_sc :=
|
|
|
|
built_fc :=
|
|
|
|
built_pc :=
|
2014-06-06 00:52:02 +02:00
|
|
|
built_svc :=
|
2015-06-30 01:31:23 +02:00
|
|
|
built_general_sepolicy :=
|
|
|
|
built_general_sepolicy.conf :=
|
2015-12-11 11:39:19 +01:00
|
|
|
built_nl :=
|
2012-11-01 19:33:04 +01:00
|
|
|
|
|
|
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|