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 | |
| 10 | # Build keys.conf |
| 11 | plat_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 | |
| 17 | all_plat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_PRIVATE_POLICY)) |
| 18 | |
| 19 | # Should be synced with keys.conf. |
| 20 | all_plat_keys := platform media shared testkey |
| 21 | all_plat_keys := $(all_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem) |
| 22 | |
| 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 | |
| 30 | all_mac_perms_files := |
| 31 | all_plat_keys := |
| 32 | plat_mac_perms_keys.tmp := |
| 33 | |
| 34 | ################################## |
| 35 | include $(CLEAR_VARS) |
| 36 | |
| 37 | LOCAL_MODULE := product_mac_permissions.xml |
| 38 | LOCAL_MODULE_CLASS := ETC |
| 39 | LOCAL_MODULE_TAGS := optional |
| 40 | LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc/selinux |
| 41 | |
| 42 | include $(BUILD_SYSTEM)/base_rules.mk |
| 43 | |
| 44 | # Build keys.conf |
| 45 | product_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 | |
| 51 | all_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 | |
| 59 | product_mac_perms_keys.tmp := |
| 60 | all_product_mac_perms_files := |
| 61 | |
| 62 | ################################## |
| 63 | include $(CLEAR_VARS) |
| 64 | |
| 65 | LOCAL_MODULE := vendor_mac_permissions.xml |
| 66 | LOCAL_MODULE_CLASS := ETC |
| 67 | LOCAL_MODULE_TAGS := optional |
| 68 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
| 69 | |
| 70 | include $(BUILD_SYSTEM)/base_rules.mk |
| 71 | |
| 72 | # Build keys.conf |
| 73 | vendor_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 | |
| 79 | all_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 | |
| 87 | vendor_mac_perms_keys.tmp := |
| 88 | all_vendor_mac_perms_files := |
| 89 | |
| 90 | ################################## |
| 91 | include $(CLEAR_VARS) |
| 92 | |
| 93 | LOCAL_MODULE := odm_mac_permissions.xml |
| 94 | LOCAL_MODULE_CLASS := ETC |
| 95 | LOCAL_MODULE_TAGS := optional |
| 96 | LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc/selinux |
| 97 | |
| 98 | include $(BUILD_SYSTEM)/base_rules.mk |
| 99 | |
| 100 | # Build keys.conf |
| 101 | odm_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 | |
| 107 | all_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 | |
| 115 | odm_mac_perms_keys.tmp := |
| 116 | all_odm_mac_perms_files := |