mac_permissions.mk 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. include $(CLEAR_VARS)
  2. LOCAL_MODULE := plat_mac_permissions.xml
  3. LOCAL_MODULE_CLASS := ETC
  4. LOCAL_MODULE_TAGS := optional
  5. LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
  6. include $(BUILD_SYSTEM)/base_rules.mk
  7. # Build keys.conf
  8. plat_mac_perms_keys.tmp := $(intermediates)/plat_keys.tmp
  9. $(plat_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
  10. $(plat_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_PRIVATE_POLICY) $(PRODUCT_PRIVATE_POLICY))
  11. @mkdir -p $(dir $@)
  12. $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
  13. all_plat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_PRIVATE_POLICY))
  14. # Should be synced with keys.conf.
  15. all_plat_keys := platform media shared testkey
  16. all_plat_keys := $(all_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem)
  17. $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_plat_mac_perms_files)
  18. $(LOCAL_BUILT_MODULE): $(plat_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
  19. $(all_plat_mac_perms_files) $(all_plat_keys)
  20. @mkdir -p $(dir $@)
  21. $(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \
  22. $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
  23. all_mac_perms_files :=
  24. all_plat_keys :=
  25. plat_mac_perms_keys.tmp :=
  26. ##################################
  27. include $(CLEAR_VARS)
  28. LOCAL_MODULE := product_mac_permissions.xml
  29. LOCAL_MODULE_CLASS := ETC
  30. LOCAL_MODULE_TAGS := optional
  31. LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc/selinux
  32. include $(BUILD_SYSTEM)/base_rules.mk
  33. # Build keys.conf
  34. product_mac_perms_keys.tmp := $(intermediates)/product_keys.tmp
  35. $(product_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
  36. $(product_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PRODUCT_PRIVATE_POLICY) $(REQD_MASK_POLICY))
  37. @mkdir -p $(dir $@)
  38. $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
  39. all_product_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PRODUCT_PRIVATE_POLICY) $(REQD_MASK_POLICY))
  40. $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_product_mac_perms_files)
  41. $(LOCAL_BUILT_MODULE): $(product_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
  42. $(all_product_mac_perms_files)
  43. @mkdir -p $(dir $@)
  44. $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
  45. product_mac_perms_keys.tmp :=
  46. all_product_mac_perms_files :=
  47. ##################################
  48. include $(CLEAR_VARS)
  49. LOCAL_MODULE := vendor_mac_permissions.xml
  50. LOCAL_MODULE_CLASS := ETC
  51. LOCAL_MODULE_TAGS := optional
  52. LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
  53. include $(BUILD_SYSTEM)/base_rules.mk
  54. # Build keys.conf
  55. vendor_mac_perms_keys.tmp := $(intermediates)/vendor_keys.tmp
  56. $(vendor_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
  57. $(vendor_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
  58. @mkdir -p $(dir $@)
  59. $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
  60. all_vendor_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
  61. $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_vendor_mac_perms_files)
  62. $(LOCAL_BUILT_MODULE): $(vendor_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
  63. $(all_vendor_mac_perms_files)
  64. @mkdir -p $(dir $@)
  65. $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
  66. vendor_mac_perms_keys.tmp :=
  67. all_vendor_mac_perms_files :=
  68. ##################################
  69. include $(CLEAR_VARS)
  70. LOCAL_MODULE := odm_mac_permissions.xml
  71. LOCAL_MODULE_CLASS := ETC
  72. LOCAL_MODULE_TAGS := optional
  73. LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc/selinux
  74. include $(BUILD_SYSTEM)/base_rules.mk
  75. # Build keys.conf
  76. odm_mac_perms_keys.tmp := $(intermediates)/odm_keys.tmp
  77. $(odm_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
  78. $(odm_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(BOARD_ODM_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
  79. @mkdir -p $(dir $@)
  80. $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
  81. all_odm_mac_perms_files := $(call build_policy, mac_permissions.xml, $(BOARD_ODM_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
  82. $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_odm_mac_perms_files)
  83. $(LOCAL_BUILT_MODULE): $(odm_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
  84. $(all_odm_mac_perms_files)
  85. @mkdir -p $(dir $@)
  86. $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
  87. odm_mac_perms_keys.tmp :=
  88. all_odm_mac_perms_files :=