service_contexts.mk 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. include $(CLEAR_VARS)
  2. LOCAL_MODULE := plat_service_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_svcfiles := $(call build_policy, service_contexts, $(PLAT_PRIVATE_POLICY))
  8. plat_service_contexts.tmp := $(intermediates)/plat_service_contexts.tmp
  9. $(plat_service_contexts.tmp): PRIVATE_SVC_FILES := $(plat_svcfiles)
  10. $(plat_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
  11. $(plat_service_contexts.tmp): $(plat_svcfiles)
  12. @mkdir -p $(dir $@)
  13. $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
  14. $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
  15. $(LOCAL_BUILT_MODULE): $(plat_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
  16. @mkdir -p $(dir $@)
  17. sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
  18. $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
  19. built_plat_svc := $(LOCAL_BUILT_MODULE)
  20. plat_svcfiles :=
  21. plat_service_contexts.tmp :=
  22. ##################################
  23. include $(CLEAR_VARS)
  24. LOCAL_MODULE := product_service_contexts
  25. LOCAL_MODULE_CLASS := ETC
  26. LOCAL_MODULE_TAGS := optional
  27. LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc/selinux
  28. include $(BUILD_SYSTEM)/base_rules.mk
  29. product_svcfiles := $(call build_policy, service_contexts, $(PRODUCT_PRIVATE_POLICY))
  30. product_service_contexts.tmp := $(intermediates)/product_service_contexts.tmp
  31. $(product_service_contexts.tmp): PRIVATE_SVC_FILES := $(product_svcfiles)
  32. $(product_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
  33. $(product_service_contexts.tmp): $(product_svcfiles)
  34. @mkdir -p $(dir $@)
  35. $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
  36. $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
  37. $(LOCAL_BUILT_MODULE): $(product_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc
  38. @mkdir -p $(dir $@)
  39. sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
  40. $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
  41. product_svcfiles :=
  42. product_service_contexts.tmp :=
  43. ##################################
  44. # nonplat_service_contexts is only allowed on non-full-treble devices
  45. ifneq ($(PRODUCT_SEPOLICY_SPLIT),true)
  46. include $(CLEAR_VARS)
  47. LOCAL_MODULE := vendor_service_contexts
  48. LOCAL_MODULE_CLASS := ETC
  49. LOCAL_MODULE_TAGS := optional
  50. LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
  51. include $(BUILD_SYSTEM)/base_rules.mk
  52. vendor_svcfiles := $(call build_policy, service_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
  53. vendor_service_contexts.tmp := $(intermediates)/vendor_service_contexts.tmp
  54. $(vendor_service_contexts.tmp): PRIVATE_SVC_FILES := $(vendor_svcfiles)
  55. $(vendor_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
  56. $(vendor_service_contexts.tmp): $(vendor_svcfiles)
  57. @mkdir -p $(dir $@)
  58. $(hide) m4 --fatal-warnings -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
  59. $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
  60. $(LOCAL_BUILT_MODULE): $(vendor_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
  61. @mkdir -p $(dir $@)
  62. sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
  63. $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
  64. built_vendor_svc := $(LOCAL_BUILT_MODULE)
  65. vendor_svcfiles :=
  66. vendor_service_contexts.tmp :=
  67. endif