seapp_contexts.mk 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. include $(CLEAR_VARS)
  2. LOCAL_MODULE := plat_seapp_contexts
  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. plat_sc_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY))
  8. $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
  9. $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(plat_sc_files)
  10. $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(plat_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp
  11. @mkdir -p $(dir $@)
  12. $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES)
  13. built_plat_sc := $(LOCAL_BUILT_MODULE)
  14. plat_sc_files :=
  15. ##################################
  16. include $(CLEAR_VARS)
  17. LOCAL_MODULE := product_seapp_contexts
  18. LOCAL_MODULE_CLASS := ETC
  19. LOCAL_MODULE_TAGS := optional
  20. LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc/selinux
  21. include $(BUILD_SYSTEM)/base_rules.mk
  22. product_sc_files := $(call build_policy, seapp_contexts, $(PRODUCT_PRIVATE_POLICY))
  23. plat_sc_neverallow_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY))
  24. $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
  25. $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(product_sc_files)
  26. $(LOCAL_BUILT_MODULE): PRIVATE_SC_NEVERALLOW_FILES := $(plat_sc_neverallow_files)
  27. $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(product_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp $(plat_sc_neverallow_files)
  28. @mkdir -p $(dir $@)
  29. $(hide) grep -ihe '^neverallow' $(PRIVATE_SC_NEVERALLOW_FILES) > [email protected]
  30. $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) [email protected]
  31. product_sc_files :=
  32. plat_sc_neverallow_files :=
  33. ##################################
  34. include $(CLEAR_VARS)
  35. LOCAL_MODULE := vendor_seapp_contexts
  36. LOCAL_MODULE_CLASS := ETC
  37. LOCAL_MODULE_TAGS := optional
  38. LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
  39. include $(BUILD_SYSTEM)/base_rules.mk
  40. vendor_sc_files := $(call build_policy, seapp_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
  41. plat_sc_neverallow_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY) $(PRODUCT_PRIVATE_POLICY))
  42. $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
  43. $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(vendor_sc_files)
  44. $(LOCAL_BUILT_MODULE): PRIVATE_SC_NEVERALLOW_FILES := $(plat_sc_neverallow_files)
  45. $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(vendor_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp $(plat_sc_neverallow_files)
  46. @mkdir -p $(dir $@)
  47. $(hide) grep -ihe '^neverallow' $(PRIVATE_SC_NEVERALLOW_FILES) > [email protected]
  48. $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) [email protected]
  49. built_vendor_sc := $(LOCAL_BUILT_MODULE)
  50. vendor_sc_files :=
  51. ##################################
  52. include $(CLEAR_VARS)
  53. LOCAL_MODULE := odm_seapp_contexts
  54. LOCAL_MODULE_CLASS := ETC
  55. LOCAL_MODULE_TAGS := optional
  56. LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc/selinux
  57. include $(BUILD_SYSTEM)/base_rules.mk
  58. odm_sc_files := $(call build_policy, seapp_contexts, $(BOARD_ODM_SEPOLICY_DIRS))
  59. plat_sc_neverallow_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY) $(PRODUCT_PRIVATE_POLICY))
  60. $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
  61. $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(odm_sc_files)
  62. $(LOCAL_BUILT_MODULE): PRIVATE_SC_NEVERALLOW_FILES := $(plat_sc_neverallow_files)
  63. $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(odm_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp $(plat_sc_neverallow_files)
  64. @mkdir -p $(dir $@)
  65. $(hide) grep -ihe '^neverallow' $(PRIVATE_SC_NEVERALLOW_FILES) > [email protected]
  66. $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) [email protected]
  67. built_odm_sc := $(LOCAL_BUILT_MODULE)
  68. odm_sc_files :=
  69. ##################################
  70. include $(CLEAR_VARS)
  71. LOCAL_MODULE := plat_seapp_neverallows
  72. LOCAL_MODULE_CLASS := ETC
  73. LOCAL_MODULE_TAGS := tests
  74. include $(BUILD_SYSTEM)/base_rules.mk
  75. $(LOCAL_BUILT_MODULE): $(plat_sc_neverallow_files)
  76. @mkdir -p $(dir $@)
  77. - $(hide) grep -ihe '^neverallow' $< > $@
  78. plat_sc_neverallow_files :=