• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1include $(CLEAR_VARS)
2
3LOCAL_MODULE := plat_service_contexts
4LOCAL_MODULE_CLASS := ETC
5LOCAL_MODULE_TAGS := optional
6LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
7
8include $(BUILD_SYSTEM)/base_rules.mk
9
10plat_svcfiles := $(call build_policy, service_contexts, $(PLAT_PRIVATE_POLICY))
11
12plat_service_contexts.tmp := $(intermediates)/plat_service_contexts.tmp
13$(plat_service_contexts.tmp): PRIVATE_SVC_FILES := $(plat_svcfiles)
14$(plat_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
15$(plat_service_contexts.tmp): $(plat_svcfiles)
16	@mkdir -p $(dir $@)
17	$(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
18
19$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
20$(LOCAL_BUILT_MODULE): $(plat_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
21	@mkdir -p $(dir $@)
22	sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
23	$(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
24
25built_plat_svc := $(LOCAL_BUILT_MODULE)
26plat_svcfiles :=
27plat_service_contexts.tmp :=
28
29##################################
30include $(CLEAR_VARS)
31
32LOCAL_MODULE := product_service_contexts
33LOCAL_MODULE_CLASS := ETC
34LOCAL_MODULE_TAGS := optional
35LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc/selinux
36
37include $(BUILD_SYSTEM)/base_rules.mk
38
39product_svcfiles := $(call build_policy, service_contexts, $(PRODUCT_PRIVATE_POLICY))
40
41product_service_contexts.tmp := $(intermediates)/product_service_contexts.tmp
42$(product_service_contexts.tmp): PRIVATE_SVC_FILES := $(product_svcfiles)
43$(product_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
44$(product_service_contexts.tmp): $(product_svcfiles)
45	@mkdir -p $(dir $@)
46	$(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
47
48$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
49$(LOCAL_BUILT_MODULE): $(product_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc
50	@mkdir -p $(dir $@)
51	sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
52	$(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
53
54product_svcfiles :=
55product_service_contexts.tmp :=
56
57##################################
58# nonplat_service_contexts is only allowed on non-full-treble devices
59ifneq ($(PRODUCT_SEPOLICY_SPLIT),true)
60
61include $(CLEAR_VARS)
62
63LOCAL_MODULE := vendor_service_contexts
64LOCAL_MODULE_CLASS := ETC
65LOCAL_MODULE_TAGS := optional
66LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
67
68include $(BUILD_SYSTEM)/base_rules.mk
69
70vendor_svcfiles := $(call build_policy, service_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
71
72vendor_service_contexts.tmp := $(intermediates)/vendor_service_contexts.tmp
73$(vendor_service_contexts.tmp): PRIVATE_SVC_FILES := $(vendor_svcfiles)
74$(vendor_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
75$(vendor_service_contexts.tmp): $(vendor_svcfiles)
76	@mkdir -p $(dir $@)
77	$(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
78
79$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
80$(LOCAL_BUILT_MODULE): $(vendor_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
81	@mkdir -p $(dir $@)
82	sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
83	$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
84
85built_vendor_svc := $(LOCAL_BUILT_MODULE)
86vendor_svcfiles :=
87vendor_service_contexts.tmp :=
88
89endif
90