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