blob: 86ea9ab4b4a9dac4b16278c3bd270ed17bf5e546 [file] [log] [blame]
Tri Vo8b3016b2019-01-07 16:43:31 -08001include $(CLEAR_VARS)
2
3LOCAL_MODULE := plat_mac_permissions.xml
4LOCAL_MODULE_CLASS := ETC
5LOCAL_MODULE_TAGS := optional
6LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
7
8include $(BUILD_SYSTEM)/base_rules.mk
9
10# Build keys.conf
11plat_mac_perms_keys.tmp := $(intermediates)/plat_keys.tmp
12$(plat_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
13$(plat_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_PRIVATE_POLICY) $(PRODUCT_PRIVATE_POLICY))
14 @mkdir -p $(dir $@)
15 $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
16
17all_plat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_PRIVATE_POLICY))
18
19# Should be synced with keys.conf.
Dan Willemsen3afe2352019-06-10 02:08:46 +000020all_plat_keys := platform media networkstack shared testkey
Dan Willemsen9d06a8f2019-05-28 21:20:08 +000021all_plat_keys := $(all_plat_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem)
Tri Vo8b3016b2019-01-07 16:43:31 -080022
23$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_plat_mac_perms_files)
24$(LOCAL_BUILT_MODULE): $(plat_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
25$(all_plat_mac_perms_files) $(all_plat_keys)
26 @mkdir -p $(dir $@)
27 $(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \
28 $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
29
30all_mac_perms_files :=
31all_plat_keys :=
32plat_mac_perms_keys.tmp :=
33
34##################################
35include $(CLEAR_VARS)
36
37LOCAL_MODULE := product_mac_permissions.xml
38LOCAL_MODULE_CLASS := ETC
39LOCAL_MODULE_TAGS := optional
40LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc/selinux
41
42include $(BUILD_SYSTEM)/base_rules.mk
43
44# Build keys.conf
45product_mac_perms_keys.tmp := $(intermediates)/product_keys.tmp
46$(product_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
47$(product_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PRODUCT_PRIVATE_POLICY) $(REQD_MASK_POLICY))
48 @mkdir -p $(dir $@)
49 $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
50
51all_product_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PRODUCT_PRIVATE_POLICY) $(REQD_MASK_POLICY))
52
53$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_product_mac_perms_files)
54$(LOCAL_BUILT_MODULE): $(product_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
55$(all_product_mac_perms_files)
56 @mkdir -p $(dir $@)
57 $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
58
59product_mac_perms_keys.tmp :=
60all_product_mac_perms_files :=
61
62##################################
63include $(CLEAR_VARS)
64
65LOCAL_MODULE := vendor_mac_permissions.xml
66LOCAL_MODULE_CLASS := ETC
67LOCAL_MODULE_TAGS := optional
68LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
69
70include $(BUILD_SYSTEM)/base_rules.mk
71
72# Build keys.conf
73vendor_mac_perms_keys.tmp := $(intermediates)/vendor_keys.tmp
74$(vendor_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
75$(vendor_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
76 @mkdir -p $(dir $@)
77 $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
78
79all_vendor_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
80
81$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_vendor_mac_perms_files)
82$(LOCAL_BUILT_MODULE): $(vendor_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
83$(all_vendor_mac_perms_files)
84 @mkdir -p $(dir $@)
85 $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
86
87vendor_mac_perms_keys.tmp :=
88all_vendor_mac_perms_files :=
89
90##################################
91include $(CLEAR_VARS)
92
93LOCAL_MODULE := odm_mac_permissions.xml
94LOCAL_MODULE_CLASS := ETC
95LOCAL_MODULE_TAGS := optional
96LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc/selinux
97
98include $(BUILD_SYSTEM)/base_rules.mk
99
100# Build keys.conf
101odm_mac_perms_keys.tmp := $(intermediates)/odm_keys.tmp
102$(odm_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
103$(odm_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(BOARD_ODM_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
104 @mkdir -p $(dir $@)
105 $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
106
107all_odm_mac_perms_files := $(call build_policy, mac_permissions.xml, $(BOARD_ODM_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
108
109$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_odm_mac_perms_files)
110$(LOCAL_BUILT_MODULE): $(odm_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
111$(all_odm_mac_perms_files)
112 @mkdir -p $(dir $@)
113 $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
114
115odm_mac_perms_keys.tmp :=
116all_odm_mac_perms_files :=