Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
William Roberts | f0e0a94 | 2012-08-27 15:41:15 -0700 | [diff] [blame] | 2 | |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 3 | include $(CLEAR_VARS) |
Jeff Vander Stoep | d4a3e9d | 2017-03-22 16:20:24 -0700 | [diff] [blame] | 4 | LOCAL_MODULE := selinux_policy |
| 5 | LOCAL_MODULE_TAGS := optional |
| 6 | # Include SELinux policy. We do this here because different modules |
| 7 | # need to be included based on the value of PRODUCT_FULL_TREBLE. This |
| 8 | # type of conditional inclusion cannot be done in top-level files such |
| 9 | # as build/target/product/embedded.mk. |
| 10 | # This conditional inclusion closely mimics the conditional logic |
| 11 | # inside init/init.cpp for loading SELinux policy from files. |
| 12 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 13 | # Use split SELinux policy |
| 14 | LOCAL_REQUIRED_MODULES += \ |
| 15 | mapping_sepolicy.cil \ |
| 16 | nonplat_sepolicy.cil \ |
| 17 | plat_sepolicy.cil \ |
Dan Cashman | 0e9c47c | 2017-04-04 14:27:41 -0700 | [diff] [blame] | 18 | plat_and_mapping_sepolicy.cil.sha256 \ |
Jeff Vander Stoep | d4a3e9d | 2017-03-22 16:20:24 -0700 | [diff] [blame] | 19 | secilc \ |
| 20 | nonplat_file_contexts \ |
| 21 | plat_file_contexts |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 22 | |
Jeff Vander Stoep | d4a3e9d | 2017-03-22 16:20:24 -0700 | [diff] [blame] | 23 | # Include precompiled policy, unless told otherwise |
| 24 | ifneq ($(PRODUCT_PRECOMPILED_SEPOLICY),false) |
Dan Cashman | 0e9c47c | 2017-04-04 14:27:41 -0700 | [diff] [blame] | 25 | LOCAL_REQUIRED_MODULES += precompiled_sepolicy precompiled_sepolicy.plat_and_mapping.sha256 |
Jeff Vander Stoep | d4a3e9d | 2017-03-22 16:20:24 -0700 | [diff] [blame] | 26 | endif |
| 27 | |
| 28 | else |
| 29 | # Use monolithic SELinux policy |
| 30 | LOCAL_REQUIRED_MODULES += sepolicy \ |
| 31 | file_contexts.bin |
| 32 | endif |
| 33 | include $(BUILD_PHONY_PACKAGE) |
| 34 | |
| 35 | include $(CLEAR_VARS) |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 36 | # SELinux policy version. |
Stephen Smalley | b4f1706 | 2015-03-13 10:03:52 -0400 | [diff] [blame] | 37 | # Must be <= /sys/fs/selinux/policyvers reported by the Android kernel. |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 38 | # Must be within the compatibility range reported by checkpolicy -V. |
Jeff Vander Stoep | 3a0ce49 | 2015-12-07 08:30:43 -0800 | [diff] [blame] | 39 | POLICYVERS ?= 30 |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 40 | |
| 41 | MLS_SENS=1 |
| 42 | MLS_CATS=1024 |
| 43 | |
Stephen Smalley | b4f1706 | 2015-03-13 10:03:52 -0400 | [diff] [blame] | 44 | ifdef BOARD_SEPOLICY_REPLACE |
| 45 | $(error BOARD_SEPOLICY_REPLACE is no longer supported; please remove from your BoardConfig.mk or other .mk file.) |
| 46 | endif |
| 47 | |
| 48 | ifdef BOARD_SEPOLICY_IGNORE |
| 49 | $(error BOARD_SEPOLICY_IGNORE is no longer supported; please remove from your BoardConfig.mk or other .mk file.) |
| 50 | endif |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 51 | |
Stephen Smalley | 8e0ca88 | 2015-04-01 10:14:56 -0400 | [diff] [blame] | 52 | ifdef BOARD_SEPOLICY_UNION |
| 53 | $(warning BOARD_SEPOLICY_UNION is no longer required - all files found in BOARD_SEPOLICY_DIRS are implicitly unioned; please remove from your BoardConfig.mk or other .mk file.) |
| 54 | endif |
Robert Craig | 6b0ff47 | 2014-01-29 13:10:58 -0500 | [diff] [blame] | 55 | |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 56 | ifdef BOARD_SEPOLICY_M4DEFS |
| 57 | LOCAL_ADDITIONAL_M4DEFS := $(addprefix -D, $(BOARD_SEPOLICY_M4DEFS)) |
| 58 | endif |
| 59 | |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 60 | # sepolicy is now divided into multiple portions: |
| 61 | # public - policy exported on which non-platform policy developers may write |
| 62 | # additional policy. types and attributes are versioned and included in |
| 63 | # delivered non-platform policy, which is to be combined with platform policy. |
| 64 | # private - platform-only policy required for platform functionality but which |
| 65 | # is not exported to vendor policy developers and as such may not be assumed |
| 66 | # to exist. |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 67 | # vendor - vendor-only policy required for vendor functionality. This policy can |
| 68 | # reference the public policy but cannot reference the private policy. This |
| 69 | # policy is for components which are produced from the core/non-vendor tree and |
| 70 | # placed into a vendor partition. |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 71 | # mapping - This contains policy statements which map the attributes |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 72 | # exposed in the public policy of previous versions to the concrete types used |
| 73 | # in this policy to ensure that policy targeting attributes from public |
| 74 | # policy from an older platform version continues to work. |
| 75 | |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 76 | # build process for device: |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 77 | # 1) convert policies to CIL: |
| 78 | # - private + public platform policy to CIL |
| 79 | # - mapping file to CIL (should already be in CIL form) |
| 80 | # - non-platform public policy to CIL |
| 81 | # - non-platform public + private policy to CIL |
| 82 | # 2) attributize policy |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 83 | # - run script which takes non-platform public and non-platform combined |
| 84 | # private + public policy and produces attributized and versioned |
| 85 | # non-platform policy |
| 86 | # 3) combine policy files |
| 87 | # - combine mapping, platform and non-platform policy. |
| 88 | # - compile output binary policy file |
| 89 | |
| 90 | PLAT_PUBLIC_POLICY := $(LOCAL_PATH)/public |
| 91 | PLAT_PRIVATE_POLICY := $(LOCAL_PATH)/private |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 92 | PLAT_VENDOR_POLICY := $(LOCAL_PATH)/vendor |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 93 | REQD_MASK_POLICY := $(LOCAL_PATH)/reqd_mask |
| 94 | |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 95 | # The current version of the platform sepolicy. |
| 96 | # TODO: This must be fetched from build system after b/36783775 |
| 97 | PLAT_PUBLIC_POLICY_CURRENT_VERSION := 100000.0 |
| 98 | |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 99 | # TODO: move to README when doing the README update and finalizing versioning. |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 100 | # BOARD_SEPOLICY_VERS must take the format "NN.m" and contain the sepolicy |
| 101 | # version identifier corresponding to the sepolicy on which the non-platform |
| 102 | # policy is to be based. If unspecified, this will build against the current |
| 103 | # public platform policy in tree |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 104 | # BOARD_SEPOLICY_VERS_DIR should contain the public platform policy which |
| 105 | # is associated with the given BOARD_SEPOLICY_VERS. The policy therein will be |
| 106 | # versioned according to the BOARD_SEPOLICY_VERS identifier and included as |
| 107 | # part of the non-platform policy to ensure removal of access in future |
| 108 | # platform policy does not break non-platform policy. |
| 109 | ifndef BOARD_SEPOLICY_VERS |
| 110 | $(warning BOARD_SEPOLICY_VERS not specified, assuming current platform version) |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 111 | # The default platform policy version. |
| 112 | BOARD_SEPOLICY_VERS := $(PLAT_PUBLIC_POLICY_CURRENT_VERSION) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 113 | BOARD_SEPOLICY_VERS_DIR := $(PLAT_PUBLIC_POLICY) |
| 114 | else |
| 115 | ifndef BOARD_SEPOLICY_VERS_DIR |
| 116 | $(error BOARD_SEPOLICY_VERS_DIR not specified for versioned sepolicy.) |
| 117 | endif |
| 118 | endif |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 119 | |
| 120 | ########################################################### |
| 121 | # Compute policy files to be used in policy build. |
| 122 | # $(1): files to include |
| 123 | # $(2): directories in which to find files |
| 124 | ########################################################### |
| 125 | |
| 126 | define build_policy |
| 127 | $(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(2)), $(sort $(wildcard $(file))))) |
| 128 | endef |
William Roberts | 29d1468 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 129 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 130 | # Builds paths for all policy files found in BOARD_SEPOLICY_DIRS. |
| 131 | # $(1): the set of policy name paths to build |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 132 | build_device_policy = $(call build_policy, $(1), $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS)) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 133 | |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 134 | # Add a file containing only a newline in-between each policy configuration |
| 135 | # 'contexts' file. This will allow OEM policy configuration files without a |
| 136 | # final newline (0x0A) to be built correctly by the m4(1) macro processor. |
| 137 | # $(1): the set of contexts file names. |
| 138 | # $(2): the file containing only 0x0A. |
| 139 | add_nl = $(foreach entry, $(1), $(subst $(entry), $(entry) $(2), $(entry))) |
| 140 | |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 141 | sepolicy_build_files := security_classes \ |
| 142 | initial_sids \ |
| 143 | access_vectors \ |
| 144 | global_macros \ |
Nick Kralevich | a17a266 | 2014-11-05 15:30:41 -0800 | [diff] [blame] | 145 | neverallow_macros \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 146 | mls_macros \ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 147 | mls_decl \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 148 | mls \ |
| 149 | policy_capabilities \ |
| 150 | te_macros \ |
| 151 | attributes \ |
Jeff Vander Stoep | cbaa2b7 | 2015-12-22 10:39:34 -0800 | [diff] [blame] | 152 | ioctl_defines \ |
Jeff Vander Stoep | de9b530 | 2015-06-05 15:28:55 -0700 | [diff] [blame] | 153 | ioctl_macros \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 154 | *.te \ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 155 | roles_decl \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 156 | roles \ |
| 157 | users \ |
| 158 | initial_sid_contexts \ |
| 159 | fs_use \ |
| 160 | genfs_contexts \ |
| 161 | port_contexts |
| 162 | |
Alex Klyubin | 7cda44f | 2017-03-21 14:28:53 -0700 | [diff] [blame] | 163 | # CIL files which contain workarounds for current limitation of human-readable |
| 164 | # module policy language. These files are appended to the CIL files produced |
| 165 | # from module language files. |
| 166 | sepolicy_build_cil_workaround_files := technical_debt.cil |
| 167 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 168 | my_target_arch := $(TARGET_ARCH) |
| 169 | ifneq (,$(filter mips mips64,$(TARGET_ARCH))) |
| 170 | my_target_arch := mips |
| 171 | endif |
| 172 | |
Jeff Vander Stoep | d2053bd | 2017-03-15 13:37:35 -0700 | [diff] [blame] | 173 | intermediates := $(TARGET_OUT_INTERMEDIATES)/ETC/sepolicy_intermediates |
| 174 | |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 175 | with_asan := false |
| 176 | ifneq (,$(filter address,$(SANITIZE_TARGET))) |
| 177 | with_asan := true |
| 178 | endif |
| 179 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 180 | ################################## |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 181 | # reqd_policy_mask - a policy.conf file which contains only the bare minimum |
| 182 | # policy necessary to use checkpolicy. This bare-minimum policy needs to be |
| 183 | # present in all policy.conf files, but should not necessarily be exported as |
| 184 | # part of the public policy. The rules generated by reqd_policy_mask will allow |
| 185 | # the compilation of public policy and subsequent removal of CIL policy that |
| 186 | # should not be exported. |
| 187 | |
| 188 | reqd_policy_mask.conf := $(intermediates)/reqd_policy_mask.conf |
| 189 | $(reqd_policy_mask.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 190 | $(reqd_policy_mask.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 191 | $(reqd_policy_mask.conf): PRIVATE_TGT_ARCH := $(my_target_arch) |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 192 | $(reqd_policy_mask.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 193 | $(reqd_policy_mask.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 194 | $(reqd_policy_mask.conf): $(call build_policy, $(sepolicy_build_files), $(REQD_MASK_POLICY)) |
| 195 | @mkdir -p $(dir $@) |
| 196 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 197 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 198 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 199 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 200 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 201 | -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \ |
Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 202 | -D target_full_treble=$(PRODUCT_FULL_TREBLE) \ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 203 | -s $^ > $@ |
| 204 | |
| 205 | reqd_policy_mask.cil := $(intermediates)/reqd_policy_mask.cil |
| 206 | $(reqd_policy_mask.cil): $(reqd_policy_mask.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy |
| 207 | @mkdir -p $(dir $@) |
| 208 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -C -M -c $(POLICYVERS) -o $@ $< |
| 209 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 210 | reqd_policy_mask.conf := |
| 211 | |
| 212 | ################################## |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 213 | # plat_pub_policy - policy that will be exported to be a part of non-platform |
| 214 | # policy corresponding to this platform version. This is a limited subset of |
| 215 | # policy that would not compile in checkpolicy on its own. To get around this |
| 216 | # limitation, add only the required files from private policy, which will |
| 217 | # generate CIL policy that will then be filtered out by the reqd_policy_mask. |
| 218 | plat_pub_policy.conf := $(intermediates)/plat_pub_policy.conf |
| 219 | $(plat_pub_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 220 | $(plat_pub_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 221 | $(plat_pub_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch) |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 222 | $(plat_pub_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 223 | $(plat_pub_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 224 | $(plat_pub_policy.conf): $(call build_policy, $(sepolicy_build_files), \ |
| 225 | $(BOARD_SEPOLICY_VERS_DIR) $(REQD_MASK_POLICY)) |
| 226 | @mkdir -p $(dir $@) |
| 227 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 228 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 229 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 230 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 231 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 232 | -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \ |
Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 233 | -D target_full_treble=$(PRODUCT_FULL_TREBLE) \ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 234 | -s $^ > $@ |
| 235 | |
| 236 | plat_pub_policy.cil := $(intermediates)/plat_pub_policy.cil |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 237 | $(plat_pub_policy.cil): PRIVATE_POL_CONF := $(plat_pub_policy.conf) |
| 238 | $(plat_pub_policy.cil): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil) |
| 239 | $(plat_pub_policy.cil): $(HOST_OUT_EXECUTABLES)/checkpolicy $(plat_pub_policy.conf) $(reqd_policy_mask.cil) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 240 | @mkdir -p $(dir $@) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 241 | $(hide) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF) |
| 242 | $(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 243 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 244 | plat_pub_policy.conf := |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 245 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 246 | ################################## |
| 247 | include $(CLEAR_VARS) |
| 248 | |
| 249 | LOCAL_MODULE := sectxfile_nl |
| 250 | LOCAL_MODULE_CLASS := ETC |
| 251 | LOCAL_MODULE_TAGS := optional |
| 252 | |
| 253 | # Create a file containing newline only to add between context config files |
| 254 | include $(BUILD_SYSTEM)/base_rules.mk |
| 255 | $(LOCAL_BUILT_MODULE): |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 256 | @mkdir -p $(dir $@) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 257 | $(hide) echo > $@ |
| 258 | |
| 259 | built_nl := $(LOCAL_BUILT_MODULE) |
| 260 | |
| 261 | ################################# |
| 262 | include $(CLEAR_VARS) |
| 263 | |
| 264 | LOCAL_MODULE := plat_sepolicy.cil |
| 265 | LOCAL_MODULE_CLASS := ETC |
| 266 | LOCAL_MODULE_TAGS := optional |
Alex Klyubin | 052b0bb | 2017-03-02 12:39:25 -0800 | [diff] [blame] | 267 | LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 268 | |
| 269 | include $(BUILD_SYSTEM)/base_rules.mk |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 270 | |
| 271 | # plat_policy.conf - A combination of the private and public platform policy |
| 272 | # which will ship with the device. The platform will always reflect the most |
| 273 | # recent platform version and is not currently being attributized. |
| 274 | plat_policy.conf := $(intermediates)/plat_policy.conf |
| 275 | $(plat_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 276 | $(plat_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 277 | $(plat_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch) |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 278 | $(plat_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 279 | $(plat_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 280 | $(plat_policy.conf): $(call build_policy, $(sepolicy_build_files), \ |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 281 | $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY)) |
| 282 | @mkdir -p $(dir $@) |
| 283 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 284 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 285 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Jorge Lucangeli Obes | 84db84e | 2016-11-18 08:42:35 -0500 | [diff] [blame] | 286 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 287 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 288 | -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \ |
Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 289 | -D target_full_treble=$(PRODUCT_FULL_TREBLE) \ |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 290 | -s $^ > $@ |
| 291 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
| 292 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 293 | plat_policy_nvr := $(intermediates)/plat_policy_nvr.cil |
Alex Klyubin | 7cda44f | 2017-03-21 14:28:53 -0700 | [diff] [blame] | 294 | $(plat_policy_nvr): PRIVATE_ADDITIONAL_CIL_FILES := \ |
| 295 | $(call build_policy, $(sepolicy_build_cil_workaround_files), $(PLAT_PRIVATE_POLICY)) |
| 296 | $(plat_policy_nvr): $(plat_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy \ |
| 297 | $(call build_policy, $(sepolicy_build_cil_workaround_files), $(PLAT_PRIVATE_POLICY)) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 298 | @mkdir -p $(dir $@) |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 299 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c $(POLICYVERS) -o $@ $< |
Alex Klyubin | 7cda44f | 2017-03-21 14:28:53 -0700 | [diff] [blame] | 300 | $(hide) cat $(PRIVATE_ADDITIONAL_CIL_FILES) >> $@ |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 301 | |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 302 | $(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(plat_policy_nvr) |
| 303 | $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(plat_policy_nvr) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 304 | @mkdir -p $(dir $@) |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 305 | # Strip out neverallow statements. They aren't needed on-device and their presence |
| 306 | # significantly slows down on-device compilation (e.g., from 400 ms to 6,400 ms on |
| 307 | # sailfish-eng). |
| 308 | grep -v '^(neverallow' $(PRIVATE_CIL_FILES) > $@ |
| 309 | # Confirm that the resulting policy compiles |
| 310 | $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -c $(POLICYVERS) $@ -o /dev/null -f /dev/null |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 311 | |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 312 | built_plat_cil := $(LOCAL_BUILT_MODULE) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 313 | plat_policy.conf := |
| 314 | |
| 315 | ################################# |
| 316 | include $(CLEAR_VARS) |
| 317 | |
| 318 | LOCAL_MODULE := mapping_sepolicy.cil |
| 319 | LOCAL_MODULE_CLASS := ETC |
| 320 | LOCAL_MODULE_TAGS := optional |
Dan Cashman | 0e9c47c | 2017-04-04 14:27:41 -0700 | [diff] [blame] | 321 | LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 322 | |
| 323 | include $(BUILD_SYSTEM)/base_rules.mk |
| 324 | |
| 325 | # auto-generate the mapping file for current platform policy, since it needs to |
| 326 | # track platform policy development |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 327 | current_mapping.cil := $(intermediates)/mapping/$(PLAT_PUBLIC_POLICY_CURRENT_VERSION).cil |
| 328 | $(current_mapping.cil) : PRIVATE_VERS := $(PLAT_PUBLIC_POLICY_CURRENT_VERSION) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 329 | $(current_mapping.cil) : $(plat_pub_policy.cil) $(HOST_OUT_EXECUTABLES)/version_policy |
| 330 | @mkdir -p $(dir $@) |
| 331 | $(hide) $(HOST_OUT_EXECUTABLES)/version_policy -b $< -m -n $(PRIVATE_VERS) -o $@ |
| 332 | |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 333 | |
| 334 | ifeq ($(BOARD_SEPOLICY_VERS), $(PLAT_PUBLIC_POLICY_CURRENT_VERSION)) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 335 | mapping_policy_nvr := $(current_mapping.cil) |
| 336 | else |
| 337 | mapping_policy_nvr := $(addsuffix /$(BOARD_SEPOLICY_VERS).cil, $(PLAT_PRIVATE_POLICY)/mapping) |
| 338 | endif |
| 339 | |
| 340 | $(LOCAL_BUILT_MODULE): $(mapping_policy_nvr) |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 341 | # Strip out neverallow statements. They aren't needed on-device and their presence |
| 342 | # significantly slows down on-device compilation (e.g., from 400 ms to 6,400 ms on |
| 343 | # sailfish-eng). |
| 344 | grep -v '^(neverallow' $< > $@ |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 345 | |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 346 | built_mapping_cil := $(LOCAL_BUILT_MODULE) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 347 | current_mapping.cil := |
| 348 | |
| 349 | ################################# |
| 350 | include $(CLEAR_VARS) |
| 351 | |
Dan Cashman | 0e9c47c | 2017-04-04 14:27:41 -0700 | [diff] [blame] | 352 | LOCAL_MODULE := plat_and_mapping_sepolicy.cil.sha256 |
| 353 | LOCAL_MODULE_CLASS := ETC |
| 354 | LOCAL_MODULE_TAGS := optional |
| 355 | LOCAL_MODULE_PATH = $(TARGET_OUT)/etc/selinux |
| 356 | |
| 357 | include $(BUILD_SYSTEM)/base_rules.mk |
| 358 | |
| 359 | $(LOCAL_BUILT_MODULE): $(built_plat_cil) $(built_mapping_cil) |
| 360 | cat $^ | sha256sum | cut -d' ' -f1 > $@ |
| 361 | |
| 362 | ################################# |
| 363 | include $(CLEAR_VARS) |
| 364 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 365 | LOCAL_MODULE := nonplat_sepolicy.cil |
| 366 | LOCAL_MODULE_CLASS := ETC |
| 367 | LOCAL_MODULE_TAGS := optional |
Alex Klyubin | 052b0bb | 2017-03-02 12:39:25 -0800 | [diff] [blame] | 368 | LOCAL_PROPRIETARY_MODULE := true |
| 369 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 370 | |
| 371 | include $(BUILD_SYSTEM)/base_rules.mk |
| 372 | |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 373 | # nonplat_policy.conf - A combination of the non-platform private, vendor and |
| 374 | # the exported platform policy associated with the version the non-platform |
| 375 | # policy targets. This needs attributization and to be combined with the |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 376 | # platform-provided policy. Like plat_pub_policy.conf, this needs to make use |
| 377 | # of the reqd_policy_mask files from private policy in order to use checkpolicy. |
| 378 | nonplat_policy.conf := $(intermediates)/nonplat_policy.conf |
| 379 | $(nonplat_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 380 | $(nonplat_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 381 | $(nonplat_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch) |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 382 | $(nonplat_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 383 | $(nonplat_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 384 | $(nonplat_policy.conf): $(call build_policy, $(sepolicy_build_files), \ |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 385 | $(BOARD_SEPOLICY_VERS_DIR) $(REQD_MASK_POLICY) $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS)) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 386 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 387 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 388 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
Nick Kralevich | 623975f | 2014-01-11 01:31:03 -0800 | [diff] [blame] | 389 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Jorge Lucangeli Obes | 84db84e | 2016-11-18 08:42:35 -0500 | [diff] [blame] | 390 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 391 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 392 | -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \ |
Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 393 | -D target_full_treble=$(PRODUCT_FULL_TREBLE) \ |
Nick Kralevich | 623975f | 2014-01-11 01:31:03 -0800 | [diff] [blame] | 394 | -s $^ > $@ |
Robert Craig | 65d4f44 | 2013-03-27 06:30:25 -0400 | [diff] [blame] | 395 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 396 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 397 | nonplat_policy_raw := $(intermediates)/nonplat_policy_raw.cil |
| 398 | $(nonplat_policy_raw): PRIVATE_POL_CONF := $(nonplat_policy.conf) |
| 399 | $(nonplat_policy_raw): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil) |
| 400 | $(nonplat_policy_raw): $(HOST_OUT_EXECUTABLES)/checkpolicy $(nonplat_policy.conf) \ |
| 401 | $(reqd_policy_mask.cil) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 402 | @mkdir -p $(dir $@) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 403 | $(hide) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF) |
| 404 | $(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 405 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 406 | nonplat_policy_nvr := $(intermediates)/nonplat_policy_nvr.cil |
| 407 | $(nonplat_policy_nvr) : PRIVATE_VERS := $(BOARD_SEPOLICY_VERS) |
| 408 | $(nonplat_policy_nvr) : PRIVATE_TGT_POL := $(nonplat_policy_raw) |
| 409 | $(nonplat_policy_nvr) : $(plat_pub_policy.cil) $(nonplat_policy_raw) \ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 410 | $(HOST_OUT_EXECUTABLES)/version_policy |
| 411 | @mkdir -p $(dir $@) |
| 412 | $(HOST_OUT_EXECUTABLES)/version_policy -b $< -t $(PRIVATE_TGT_POL) -n $(PRIVATE_VERS) -o $@ |
| 413 | |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 414 | $(LOCAL_BUILT_MODULE): PRIVATE_NONPLAT_CIL_FILES := $(nonplat_policy_nvr) |
| 415 | $(LOCAL_BUILT_MODULE): PRIVATE_DEP_CIL_FILES := $(built_plat_cil) $(built_mapping_cil) |
| 416 | $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(nonplat_policy_nvr) $(built_plat_cil) \ |
| 417 | $(built_mapping_cil) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 418 | @mkdir -p $(dir $@) |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 419 | # Strip out neverallow statements. They aren't needed on-device and their presence |
| 420 | # significantly slows down on-device compilation (e.g., from 400 ms to 6,400 ms on |
| 421 | # sailfish-eng). |
| 422 | grep -v '^(neverallow' $(PRIVATE_NONPLAT_CIL_FILES) > $@ |
| 423 | # Confirm that the resulting policy compiles combined with platform and mapping policies |
| 424 | $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -c $(POLICYVERS) \ |
| 425 | $(PRIVATE_DEP_CIL_FILES) $@ -o /dev/null -f /dev/null |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 426 | |
Alex Klyubin | 193dccd | 2017-03-07 14:05:57 -0800 | [diff] [blame] | 427 | built_nonplat_cil := $(LOCAL_BUILT_MODULE) |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 428 | nonplat_policy.conf := |
| 429 | nonplat_policy_raw := |
| 430 | |
| 431 | ################################# |
| 432 | include $(CLEAR_VARS) |
Alex Klyubin | 193dccd | 2017-03-07 14:05:57 -0800 | [diff] [blame] | 433 | |
| 434 | LOCAL_MODULE := precompiled_sepolicy |
| 435 | LOCAL_MODULE_CLASS := ETC |
| 436 | LOCAL_MODULE_TAGS := optional |
| 437 | LOCAL_PROPRIETARY_MODULE := true |
| 438 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
| 439 | |
| 440 | include $(BUILD_SYSTEM)/base_rules.mk |
| 441 | |
| 442 | $(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := \ |
| 443 | $(built_plat_cil) $(built_mapping_cil) $(built_nonplat_cil) |
| 444 | $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc \ |
| 445 | $(built_plat_cil) $(built_mapping_cil) $(built_nonplat_cil) |
| 446 | $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -c $(POLICYVERS) \ |
| 447 | $(PRIVATE_CIL_FILES) -o $@ -f /dev/null |
| 448 | |
| 449 | built_precompiled_sepolicy := $(LOCAL_BUILT_MODULE) |
| 450 | |
| 451 | ################################# |
Dan Cashman | 0e9c47c | 2017-04-04 14:27:41 -0700 | [diff] [blame] | 452 | # SHA-256 digest of the plat_sepolicy.cil and mapping_sepolicy.cil files against |
| 453 | # which precompiled_policy was built. |
Alex Klyubin | 193dccd | 2017-03-07 14:05:57 -0800 | [diff] [blame] | 454 | ################################# |
| 455 | include $(CLEAR_VARS) |
Dan Cashman | 0e9c47c | 2017-04-04 14:27:41 -0700 | [diff] [blame] | 456 | LOCAL_MODULE := precompiled_sepolicy.plat_and_mapping.sha256 |
Alex Klyubin | 193dccd | 2017-03-07 14:05:57 -0800 | [diff] [blame] | 457 | LOCAL_MODULE_CLASS := ETC |
| 458 | LOCAL_MODULE_TAGS := optional |
| 459 | LOCAL_PROPRIETARY_MODULE := true |
| 460 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
| 461 | |
| 462 | include $(BUILD_SYSTEM)/base_rules.mk |
| 463 | |
Dan Cashman | 0e9c47c | 2017-04-04 14:27:41 -0700 | [diff] [blame] | 464 | $(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(built_plat_cil) $(built_mapping_cil) |
| 465 | $(LOCAL_BUILT_MODULE): $(built_precompiled_sepolicy) $(built_plat_cil) $(built_mapping_cil) |
| 466 | cat $(PRIVATE_CIL_FILES) | sha256sum | cut -d' ' -f1 > $@ |
Alex Klyubin | 193dccd | 2017-03-07 14:05:57 -0800 | [diff] [blame] | 467 | |
| 468 | ################################# |
| 469 | include $(CLEAR_VARS) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 470 | # build this target so that we can still perform neverallow checks |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 471 | |
| 472 | LOCAL_MODULE := sepolicy |
| 473 | LOCAL_MODULE_CLASS := ETC |
| 474 | LOCAL_MODULE_TAGS := optional |
Daniel Cashman | 65d0134 | 2016-12-17 00:53:26 +0000 | [diff] [blame] | 475 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 476 | |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 477 | include $(BUILD_SYSTEM)/base_rules.mk |
| 478 | |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 479 | all_cil_files := \ |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 480 | $(plat_policy_nvr) \ |
| 481 | $(mapping_policy_nvr) \ |
| 482 | $(nonplat_policy_nvr) \ |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 483 | |
| 484 | $(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(all_cil_files) |
| 485 | $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $(all_cil_files) |
| 486 | @mkdir -p $(dir $@) |
William Roberts | 5d0c2e4 | 2017-03-23 11:26:29 -0700 | [diff] [blame] | 487 | $(hide) $< -M true -c $(POLICYVERS) $(PRIVATE_CIL_FILES) -o $@.tmp -f /dev/null |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 488 | $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains |
| 489 | $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \ |
| 490 | echo "==========" 1>&2; \ |
| 491 | echo "ERROR: permissive domains not allowed in user builds" 1>&2; \ |
| 492 | echo "List of invalid domains:" 1>&2; \ |
| 493 | cat $@.permissivedomains 1>&2; \ |
| 494 | exit 1; \ |
| 495 | fi |
| 496 | $(hide) mv $@.tmp $@ |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 497 | |
Ying Wang | d8b122c | 2012-10-25 19:01:31 -0700 | [diff] [blame] | 498 | built_sepolicy := $(LOCAL_BUILT_MODULE) |
dcashman | 2e00e63 | 2016-10-12 14:58:09 -0700 | [diff] [blame] | 499 | all_cil_files := |
Stephen Smalley | 01a58af | 2012-10-02 12:46:37 -0400 | [diff] [blame] | 500 | |
Alex Klyubin | 84aa742 | 2017-03-10 09:36:07 -0800 | [diff] [blame] | 501 | ################################# |
| 502 | include $(CLEAR_VARS) |
| 503 | |
| 504 | # keep concrete sepolicy for neverallow checks |
| 505 | |
| 506 | LOCAL_MODULE := sepolicy.recovery |
Alex Klyubin | ec78c37 | 2017-03-10 12:44:16 -0800 | [diff] [blame] | 507 | LOCAL_MODULE_STEM := sepolicy |
Alex Klyubin | 84aa742 | 2017-03-10 09:36:07 -0800 | [diff] [blame] | 508 | LOCAL_MODULE_CLASS := ETC |
| 509 | LOCAL_MODULE_TAGS := optional |
Alex Klyubin | ec78c37 | 2017-03-10 12:44:16 -0800 | [diff] [blame] | 510 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT) |
Alex Klyubin | 84aa742 | 2017-03-10 09:36:07 -0800 | [diff] [blame] | 511 | |
| 512 | include $(BUILD_SYSTEM)/base_rules.mk |
| 513 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 514 | plat_pub_policy.recovery.conf := $(intermediates)/plat_pub_policy.recovery.conf |
| 515 | $(plat_pub_policy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 516 | $(plat_pub_policy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
| 517 | $(plat_pub_policy.recovery.conf): PRIVATE_TGT_ARCH := $(my_target_arch) |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 518 | $(plat_pub_policy.recovery.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 519 | $(plat_pub_policy.recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 520 | $(plat_pub_policy.recovery.conf): $(call build_policy, $(sepolicy_build_files), \ |
| 521 | $(BOARD_SEPOLICY_VERS_DIR) $(REQD_MASK_POLICY)) |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 522 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 523 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 524 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 525 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Jorge Lucangeli Obes | 84db84e | 2016-11-18 08:42:35 -0500 | [diff] [blame] | 526 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 527 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 528 | -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 529 | -D target_recovery=true \ |
| 530 | -s $^ > $@ |
| 531 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 532 | plat_pub_policy.recovery.cil := $(intermediates)/plat_pub_policy.recovery.cil |
| 533 | $(plat_pub_policy.recovery.cil): PRIVATE_POL_CONF := $(plat_pub_policy.recovery.conf) |
| 534 | $(plat_pub_policy.recovery.cil): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil) |
| 535 | $(plat_pub_policy.recovery.cil): $(HOST_OUT_EXECUTABLES)/checkpolicy \ |
| 536 | $(plat_pub_policy.recovery.conf) $(reqd_policy_mask.cil) |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 537 | @mkdir -p $(dir $@) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 538 | $(hide) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF) |
| 539 | $(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@ |
| 540 | |
| 541 | plat_pub_policy.recovery.conf := |
| 542 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 543 | plat_policy.recovery.conf := $(intermediates)/plat_policy.recovery.conf |
| 544 | $(plat_policy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 545 | $(plat_policy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
| 546 | $(plat_policy.recovery.conf): PRIVATE_TGT_ARCH := $(my_target_arch) |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 547 | $(plat_policy.recovery.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 548 | $(plat_policy.recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 549 | $(plat_policy.recovery.conf): $(call build_policy, $(sepolicy_build_files), \ |
| 550 | $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY)) |
| 551 | @mkdir -p $(dir $@) |
| 552 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 553 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 554 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 555 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 556 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 557 | -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 558 | -D target_recovery=true \ |
| 559 | -s $^ > $@ |
| 560 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
| 561 | |
| 562 | plat_policy_nvr.recovery := $(intermediates)/plat_policy_nvr.recovery.cil |
| 563 | $(plat_policy_nvr.recovery): $(plat_policy.recovery.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy |
| 564 | @mkdir -p $(dir $@) |
| 565 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c $(POLICYVERS) -o $@ $< |
| 566 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 567 | plat_policy.recovery.conf := |
| 568 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 569 | # auto-generate the mapping file for current platform policy, since it needs to |
| 570 | # track platform policy development |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 571 | current_mapping.recovery.cil := $(intermediates)/mapping/$(PLAT_PUBLIC_POLICY_CURRENT_VERSION).recovery.cil |
| 572 | $(current_mapping.recovery.cil) : PRIVATE_VERS := $(PLAT_PUBLIC_POLICY_CURRENT_VERSION) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 573 | $(current_mapping.recovery.cil) : $(plat_pub_policy.recovery.cil) $(HOST_OUT_EXECUTABLES)/version_policy |
| 574 | @mkdir -p $(dir $@) |
| 575 | $(hide) $(HOST_OUT_EXECUTABLES)/version_policy -b $< -m -n $(PRIVATE_VERS) -o $@ |
| 576 | |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 577 | ifeq ($(BOARD_SEPOLICY_VERS), $(PLAT_PUBLIC_POLICY_CURRENT_VERSION)) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 578 | mapping_policy_nvr.recovery := $(current_mapping.recovery.cil) |
| 579 | else |
| 580 | mapping_policy_nvr.recovery := $(addsuffix /$(BOARD_SEPOLICY_VERS).recovery.cil, \ |
Sandeep Patil | 42f9598 | 2017-04-07 14:18:48 -0700 | [diff] [blame] | 581 | $(PLAT_PRIVATE_POLICY)/mapping) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 582 | endif |
| 583 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 584 | current_mapping.recovery.cil := |
| 585 | |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 586 | # nonplat_policy.recovery.conf - A combination of the non-platform private, |
| 587 | # vendor and the exported platform policy associated with the version the |
| 588 | # non-platform policy targets. This needs attributization and to be combined |
| 589 | # with the platform-provided policy. Like plat_pub_policy.recovery.conf, this |
| 590 | # needs to make use of the reqd_policy_mask files from private policy in order |
| 591 | # to use checkpolicy. |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 592 | nonplat_policy.recovery.conf := $(intermediates)/nonplat_policy.recovery.conf |
| 593 | $(nonplat_policy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 594 | $(nonplat_policy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
| 595 | $(nonplat_policy.recovery.conf): PRIVATE_TGT_ARCH := $(my_target_arch) |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 596 | $(nonplat_policy.recovery.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 597 | $(nonplat_policy.recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 598 | $(nonplat_policy.recovery.conf): $(call build_policy, $(sepolicy_build_files), \ |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 599 | $(BOARD_SEPOLICY_VERS_DIR) $(REQD_MASK_POLICY) $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS)) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 600 | @mkdir -p $(dir $@) |
| 601 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 602 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 603 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 604 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 605 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 606 | -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 607 | -D target_recovery=true \ |
| 608 | -s $^ > $@ |
| 609 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
| 610 | |
| 611 | nonplat_policy_raw.recovery := $(intermediates)/nonplat_policy_raw.recovery.cil |
| 612 | $(nonplat_policy_raw.recovery): PRIVATE_POL_CONF := $(nonplat_policy.recovery.conf) |
| 613 | $(nonplat_policy_raw.recovery): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil) |
| 614 | $(nonplat_policy_raw.recovery): $(HOST_OUT_EXECUTABLES)/checkpolicy $(nonplat_policy.recovery.conf) \ |
| 615 | $(reqd_policy_mask.cil) |
| 616 | @mkdir -p $(dir $@) |
| 617 | $(hide) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF) |
| 618 | $(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@ |
| 619 | |
| 620 | nonplat_policy_nvr.recovery := $(intermediates)/nonplat_policy_nvr.recovery.cil |
| 621 | $(nonplat_policy_nvr.recovery) : PRIVATE_VERS := $(BOARD_SEPOLICY_VERS) |
| 622 | $(nonplat_policy_nvr.recovery) : PRIVATE_TGT_POL := $(nonplat_policy_raw.recovery) |
| 623 | $(nonplat_policy_nvr.recovery) : $(plat_pub_policy.recovery.cil) $(nonplat_policy_raw.recovery) \ |
| 624 | $(HOST_OUT_EXECUTABLES)/version_policy |
| 625 | @mkdir -p $(dir $@) |
| 626 | $(HOST_OUT_EXECUTABLES)/version_policy -b $< -t $(PRIVATE_TGT_POL) -n $(PRIVATE_VERS) -o $@ |
| 627 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 628 | nonplat_policy.recovery.conf := |
| 629 | nonplat_policy_raw.recovery := |
| 630 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 631 | all_cil_files.recovery := \ |
| 632 | $(plat_policy_nvr.recovery) \ |
| 633 | $(mapping_policy_nvr.recovery) \ |
| 634 | $(nonplat_policy_nvr.recovery) \ |
| 635 | |
| 636 | $(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(all_cil_files.recovery) |
| 637 | $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $(all_cil_files.recovery) |
| 638 | @mkdir -p $(dir $@) |
William Roberts | 5d0c2e4 | 2017-03-23 11:26:29 -0700 | [diff] [blame] | 639 | $(hide) $< -M true -c $(POLICYVERS) $(PRIVATE_CIL_FILES) -o $@.tmp -f /dev/null |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 640 | $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains |
| 641 | $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \ |
| 642 | echo "==========" 1>&2; \ |
| 643 | echo "ERROR: permissive domains not allowed in user builds" 1>&2; \ |
| 644 | echo "List of invalid domains:" 1>&2; \ |
| 645 | cat $@.permissivedomains 1>&2; \ |
| 646 | exit 1; \ |
| 647 | fi |
| 648 | $(hide) mv $@.tmp $@ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 649 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 650 | all_cil_files.recovery := |
Alex Klyubin | 84aa742 | 2017-03-10 09:36:07 -0800 | [diff] [blame] | 651 | plat_pub_policy.recovery.cil := |
| 652 | plat_policy_nvr.recovery := |
| 653 | mapping_policy_nvr.recovery := |
| 654 | nonplat_policy_nvr.recovery := |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 655 | |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 656 | ################################## |
Alex Klyubin | 446279a | 2017-04-06 14:45:50 -0700 | [diff] [blame] | 657 | # SELinux policy embedded into CTS. |
| 658 | # CTS checks neverallow rules of this policy against the policy of the device under test. |
| 659 | ################################## |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 660 | include $(CLEAR_VARS) |
| 661 | |
| 662 | LOCAL_MODULE := general_sepolicy.conf |
| 663 | LOCAL_MODULE_CLASS := ETC |
| 664 | LOCAL_MODULE_TAGS := tests |
| 665 | |
| 666 | include $(BUILD_SYSTEM)/base_rules.mk |
| 667 | |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 668 | $(LOCAL_BUILT_MODULE): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 669 | $(LOCAL_BUILT_MODULE): PRIVATE_MLS_CATS := $(MLS_CATS) |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 670 | $(LOCAL_BUILT_MODULE): PRIVATE_TGT_ARCH := $(my_target_arch) |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 671 | $(LOCAL_BUILT_MODULE): $(call build_policy, $(sepolicy_build_files), \ |
| 672 | $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY)) |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 673 | mkdir -p $(dir $@) |
| 674 | $(hide) m4 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 675 | -D target_build_variant=user \ |
Jorge Lucangeli Obes | 84db84e | 2016-11-18 08:42:35 -0500 | [diff] [blame] | 676 | -D target_with_dexpreopt=$(WITH_DEXPREOPT) \ |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 677 | -D target_arch=$(PRIVATE_TGT_ARCH) \ |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 678 | -D target_with_asan=false \ |
Alex Klyubin | 446279a | 2017-04-06 14:45:50 -0700 | [diff] [blame] | 679 | -D target_full_treble=cts \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 680 | -s $^ > $@ |
| 681 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
| 682 | |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 683 | ################################## |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 684 | # TODO - remove this. Keep around until we get the filesystem creation stuff taken care of. |
| 685 | # |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 686 | include $(CLEAR_VARS) |
| 687 | |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 688 | LOCAL_MODULE := file_contexts.bin |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 689 | LOCAL_MODULE_CLASS := ETC |
| 690 | LOCAL_MODULE_TAGS := optional |
| 691 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 692 | |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 693 | include $(BUILD_SYSTEM)/base_rules.mk |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 694 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 695 | # The file_contexts.bin is built in the following way: |
| 696 | # 1. Collect all file_contexts files in THIS repository and process them with |
| 697 | # m4 into a tmp file called file_contexts.local.tmp. |
| 698 | # 2. Collect all device specific file_contexts files and process them with m4 |
| 699 | # into a tmp file called file_contexts.device.tmp. |
| 700 | # 3. Run checkfc -e (allow no device fc entries ie empty) and fc_sort on |
| 701 | # file_contexts.device.tmp and output to file_contexts.device.sorted.tmp. |
| 702 | # 4. Concatenate file_contexts.local.tmp and file_contexts.device.tmp into |
| 703 | # file_contexts.concat.tmp. |
| 704 | # 5. Run checkfc and sefcontext_compile on file_contexts.concat.tmp to produce |
| 705 | # file_contexts.bin. |
| 706 | # |
| 707 | # Note: That a newline file is placed between each file_context file found to |
| 708 | # ensure a proper build when an fc file is missing an ending newline. |
William Roberts | 29d1468 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 709 | |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 710 | local_fc_files := $(PLAT_PRIVATE_POLICY)/file_contexts |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 711 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 712 | local_fc_files := $(local_fc_files) $(PLAT_PRIVATE_POLICY)/file_contexts_asan |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 713 | endif |
| 714 | local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl)) |
| 715 | |
| 716 | file_contexts.local.tmp := $(intermediates)/file_contexts.local.tmp |
| 717 | $(file_contexts.local.tmp): $(local_fcfiles_with_nl) |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 718 | @mkdir -p $(dir $@) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 719 | $(hide) m4 -s $^ > $@ |
| 720 | |
| 721 | device_fc_files := $(call build_device_policy, file_contexts) |
| 722 | device_fcfiles_with_nl := $(call add_nl, $(device_fc_files), $(built_nl)) |
| 723 | |
| 724 | file_contexts.device.tmp := $(intermediates)/file_contexts.device.tmp |
| 725 | $(file_contexts.device.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 726 | $(file_contexts.device.tmp): $(device_fcfiles_with_nl) |
| 727 | @mkdir -p $(dir $@) |
| 728 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@ |
| 729 | |
| 730 | file_contexts.device.sorted.tmp := $(intermediates)/file_contexts.device.sorted.tmp |
| 731 | $(file_contexts.device.sorted.tmp): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 732 | $(file_contexts.device.sorted.tmp): $(file_contexts.device.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/fc_sort $(HOST_OUT_EXECUTABLES)/checkfc |
| 733 | @mkdir -p $(dir $@) |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 734 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e $(PRIVATE_SEPOLICY) $< |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 735 | $(hide) $(HOST_OUT_EXECUTABLES)/fc_sort $< $@ |
| 736 | |
| 737 | file_contexts.concat.tmp := $(intermediates)/file_contexts.concat.tmp |
| 738 | $(file_contexts.concat.tmp): $(file_contexts.local.tmp) $(file_contexts.device.sorted.tmp) |
| 739 | @mkdir -p $(dir $@) |
| 740 | $(hide) m4 -s $^ > $@ |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 741 | |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 742 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 743 | $(LOCAL_BUILT_MODULE): $(file_contexts.concat.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 744 | @mkdir -p $(dir $@) |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 745 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $< |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 746 | $(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $< |
| 747 | |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 748 | built_fc := $(LOCAL_BUILT_MODULE) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 749 | local_fc_files := |
| 750 | local_fcfiles_with_nl := |
| 751 | device_fc_files := |
| 752 | device_fcfiles_with_nl := |
| 753 | file_contexts.concat.tmp := |
| 754 | file_contexts.device.sorted.tmp := |
| 755 | file_contexts.device.tmp := |
| 756 | file_contexts.local.tmp := |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 757 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 758 | ################################## |
| 759 | include $(CLEAR_VARS) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 760 | |
Alex Klyubin | ec78c37 | 2017-03-10 12:44:16 -0800 | [diff] [blame] | 761 | LOCAL_MODULE := file_contexts.bin.recovery |
| 762 | LOCAL_MODULE_STEM := file_contexts.bin |
| 763 | LOCAL_MODULE_CLASS := ETC |
| 764 | LOCAL_MODULE_TAGS := optional |
| 765 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT) |
| 766 | |
| 767 | include $(BUILD_SYSTEM)/base_rules.mk |
| 768 | |
| 769 | $(LOCAL_BUILT_MODULE): $(built_fc) |
| 770 | $(hide) cp -f $< $@ |
| 771 | |
| 772 | ################################## |
| 773 | include $(CLEAR_VARS) |
| 774 | |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 775 | LOCAL_MODULE := plat_file_contexts |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 776 | LOCAL_MODULE_CLASS := ETC |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 777 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | 0cb417a | 2017-03-08 14:12:54 -0800 | [diff] [blame] | 778 | LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 779 | |
| 780 | include $(BUILD_SYSTEM)/base_rules.mk |
| 781 | |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 782 | local_fc_files := $(PLAT_PRIVATE_POLICY)/file_contexts |
| 783 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
| 784 | local_fc_files += $(PLAT_PRIVATE_POLICY)/file_contexts_asan |
| 785 | endif |
Alex Klyubin | e4665d7 | 2017-01-19 19:58:34 -0800 | [diff] [blame] | 786 | local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl)) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 787 | |
Alex Klyubin | e4665d7 | 2017-01-19 19:58:34 -0800 | [diff] [blame] | 788 | $(LOCAL_BUILT_MODULE): PRIVATE_FC_FILES := $(local_fcfiles_with_nl) |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 789 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
Alex Klyubin | e4665d7 | 2017-01-19 19:58:34 -0800 | [diff] [blame] | 790 | $(LOCAL_BUILT_MODULE): PRIVATE_FC_SORT := $(HOST_OUT_EXECUTABLES)/fc_sort |
| 791 | $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/checkfc $(HOST_OUT_EXECUTABLES)/fc_sort \ |
| 792 | $(local_fcfiles_with_nl) $(built_sepolicy) |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 793 | @mkdir -p $(dir $@) |
Alex Klyubin | e4665d7 | 2017-01-19 19:58:34 -0800 | [diff] [blame] | 794 | $(hide) m4 -s $(PRIVATE_FC_FILES) > $@.tmp |
| 795 | $(hide) $< $(PRIVATE_SEPOLICY) $@.tmp |
| 796 | $(hide) $(PRIVATE_FC_SORT) $@.tmp $@ |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 797 | |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 798 | built_plat_fc := $(LOCAL_BUILT_MODULE) |
| 799 | local_fc_files := |
Alex Klyubin | e4665d7 | 2017-01-19 19:58:34 -0800 | [diff] [blame] | 800 | local_fcfiles_with_nl := |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 801 | |
| 802 | ################################## |
| 803 | include $(CLEAR_VARS) |
| 804 | |
| 805 | LOCAL_MODULE := nonplat_file_contexts |
| 806 | LOCAL_MODULE_CLASS := ETC |
| 807 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | 0cb417a | 2017-03-08 14:12:54 -0800 | [diff] [blame] | 808 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 809 | |
| 810 | include $(BUILD_SYSTEM)/base_rules.mk |
| 811 | |
| 812 | nonplat_fc_files := $(call build_device_policy, file_contexts) |
| 813 | nonplat_fcfiles_with_nl := $(call add_nl, $(nonplat_fc_files), $(built_nl)) |
| 814 | |
| 815 | $(LOCAL_BUILT_MODULE): PRIVATE_FC_FILES := $(nonplat_fcfiles_with_nl) |
| 816 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 817 | $(LOCAL_BUILT_MODULE): PRIVATE_FC_SORT := $(HOST_OUT_EXECUTABLES)/fc_sort |
| 818 | $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/checkfc $(HOST_OUT_EXECUTABLES)/fc_sort \ |
Alex Klyubin | e4665d7 | 2017-01-19 19:58:34 -0800 | [diff] [blame] | 819 | $(nonplat_fcfiles_with_nl) $(built_sepolicy) |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 820 | @mkdir -p $(dir $@) |
| 821 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_FC_FILES) > $@.tmp |
| 822 | $(hide) $< $(PRIVATE_SEPOLICY) $@.tmp |
| 823 | $(hide) $(PRIVATE_FC_SORT) $@.tmp $@ |
| 824 | |
| 825 | built_nonplat_fc := $(LOCAL_BUILT_MODULE) |
| 826 | nonplat_fc_files := |
| 827 | nonplat_fcfiles_with_nl := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 828 | |
| 829 | ################################## |
| 830 | include $(CLEAR_VARS) |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 831 | LOCAL_MODULE := plat_seapp_contexts |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 832 | LOCAL_MODULE_CLASS := ETC |
| 833 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 834 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 835 | LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux |
| 836 | else |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 837 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 838 | endif |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 839 | |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 840 | include $(BUILD_SYSTEM)/base_rules.mk |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 841 | |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 842 | plat_sc_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY)) |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 843 | |
Ying Wang | d8b122c | 2012-10-25 19:01:31 -0700 | [diff] [blame] | 844 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 845 | $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(plat_sc_files) |
| 846 | $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(plat_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp |
William Roberts | f0e0a94 | 2012-08-27 15:41:15 -0700 | [diff] [blame] | 847 | @mkdir -p $(dir $@) |
William Roberts | 99fe8df | 2015-06-30 13:53:51 -0700 | [diff] [blame] | 848 | $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 849 | |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 850 | built_plat_sc := $(LOCAL_BUILT_MODULE) |
| 851 | plat_sc_files := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 852 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 853 | ################################## |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 854 | include $(CLEAR_VARS) |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 855 | LOCAL_MODULE := nonplat_seapp_contexts |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 856 | LOCAL_MODULE_CLASS := ETC |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 857 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 858 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 859 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
| 860 | else |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 861 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 862 | endif |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 863 | |
| 864 | include $(BUILD_SYSTEM)/base_rules.mk |
| 865 | |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 866 | nonplat_sc_files := $(call build_policy, seapp_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY)) |
Jeff Vander Stoep | 87ae5f7 | 2017-03-06 22:53:09 -0800 | [diff] [blame] | 867 | plat_sc_neverallow_files := $(addprefix $(PLAT_PRIVATE_POLICY)/, seapp_contexts) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 868 | |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 869 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 870 | $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(nonplat_sc_files) |
Jeff Vander Stoep | 87ae5f7 | 2017-03-06 22:53:09 -0800 | [diff] [blame] | 871 | $(LOCAL_BUILT_MODULE): PRIVATE_SC_NEVERALLOW_FILES := $(plat_sc_neverallow_files) |
| 872 | $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(nonplat_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp $(plat_sc_neverallow_files) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 873 | @mkdir -p $(dir $@) |
Xin Li | ec6f393 | 2017-03-14 16:51:13 -0700 | [diff] [blame] | 874 | $(hide) grep -ie '^neverallow' $(PRIVATE_SC_NEVERALLOW_FILES) > $@.tmp |
| 875 | $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) $@.tmp |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 876 | |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 877 | built_nonplat_sc := $(LOCAL_BUILT_MODULE) |
| 878 | nonplat_sc_files := |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 879 | |
| 880 | ################################## |
| 881 | include $(CLEAR_VARS) |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 882 | LOCAL_MODULE := plat_seapp_neverallows |
William Roberts | 4ee7131 | 2015-06-25 11:59:30 -0700 | [diff] [blame] | 883 | LOCAL_MODULE_CLASS := ETC |
| 884 | LOCAL_MODULE_TAGS := tests |
| 885 | |
| 886 | include $(BUILD_SYSTEM)/base_rules.mk |
| 887 | |
Jeff Vander Stoep | 87ae5f7 | 2017-03-06 22:53:09 -0800 | [diff] [blame] | 888 | $(LOCAL_BUILT_MODULE): $(plat_sc_neverallow_files) |
William Roberts | 4ee7131 | 2015-06-25 11:59:30 -0700 | [diff] [blame] | 889 | @mkdir -p $(dir $@) |
| 890 | - $(hide) grep -ie '^neverallow' $< > $@ |
| 891 | |
Jeff Vander Stoep | 87ae5f7 | 2017-03-06 22:53:09 -0800 | [diff] [blame] | 892 | plat_sc_neverallow_files := |
William Roberts | 4ee7131 | 2015-06-25 11:59:30 -0700 | [diff] [blame] | 893 | |
| 894 | ################################## |
| 895 | include $(CLEAR_VARS) |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 896 | |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 897 | LOCAL_MODULE := plat_property_contexts |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 898 | LOCAL_MODULE_CLASS := ETC |
| 899 | LOCAL_MODULE_TAGS := optional |
Alex Klyubin | 9d59041 | 2017-03-08 13:10:05 -0800 | [diff] [blame] | 900 | |
| 901 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 902 | LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux |
| 903 | else |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 904 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Alex Klyubin | 9d59041 | 2017-03-08 13:10:05 -0800 | [diff] [blame] | 905 | endif |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 906 | |
| 907 | include $(BUILD_SYSTEM)/base_rules.mk |
| 908 | |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 909 | plat_pcfiles := $(call build_policy, property_contexts, $(PLAT_PRIVATE_POLICY)) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 910 | |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 911 | plat_property_contexts.tmp := $(intermediates)/plat_property_contexts.tmp |
| 912 | $(plat_property_contexts.tmp): PRIVATE_PC_FILES := $(plat_pcfiles) |
| 913 | $(plat_property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 914 | $(plat_property_contexts.tmp): $(plat_pcfiles) |
William Roberts | 7f81b33 | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 915 | @mkdir -p $(dir $@) |
Colin Cross | 9eb6c87 | 2015-10-01 21:25:09 +0000 | [diff] [blame] | 916 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@ |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 917 | |
| 918 | |
| 919 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 920 | $(LOCAL_BUILT_MODULE): $(plat_property_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 921 | @mkdir -p $(dir $@) |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 922 | $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< | sort -u -o $@ |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 923 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@ |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 924 | |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 925 | built_plat_pc := $(LOCAL_BUILT_MODULE) |
| 926 | plat_pcfiles := |
| 927 | plat_property_contexts.tmp := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 928 | |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 929 | ################################## |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 930 | include $(CLEAR_VARS) |
| 931 | |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 932 | LOCAL_MODULE := nonplat_property_contexts |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 933 | LOCAL_MODULE_CLASS := ETC |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 934 | LOCAL_MODULE_TAGS := optional |
Alex Klyubin | 9d59041 | 2017-03-08 13:10:05 -0800 | [diff] [blame] | 935 | |
| 936 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 937 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
| 938 | else |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 939 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Alex Klyubin | 9d59041 | 2017-03-08 13:10:05 -0800 | [diff] [blame] | 940 | endif |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 941 | |
Stephen Smalley | c936173 | 2015-03-13 09:36:57 -0400 | [diff] [blame] | 942 | include $(BUILD_SYSTEM)/base_rules.mk |
| 943 | |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 944 | nonplat_pcfiles := $(call build_policy, property_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY)) |
Sandeep Patil | 262edc3 | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 945 | |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 946 | nonplat_property_contexts.tmp := $(intermediates)/nonplat_property_contexts.tmp |
| 947 | $(nonplat_property_contexts.tmp): PRIVATE_PC_FILES := $(nonplat_pcfiles) |
| 948 | $(nonplat_property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 949 | $(nonplat_property_contexts.tmp): $(nonplat_pcfiles) |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 950 | @mkdir -p $(dir $@) |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 951 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@ |
| 952 | |
| 953 | |
| 954 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 955 | $(LOCAL_BUILT_MODULE): $(nonplat_property_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc |
| 956 | @mkdir -p $(dir $@) |
| 957 | $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< | sort -u -o $@ |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 958 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@ |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 959 | |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 960 | built_nonplat_pc := $(LOCAL_BUILT_MODULE) |
| 961 | nonplat_pcfiles := |
| 962 | nonplat_property_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 963 | |
| 964 | ################################## |
| 965 | include $(CLEAR_VARS) |
| 966 | |
Alex Klyubin | ec78c37 | 2017-03-10 12:44:16 -0800 | [diff] [blame] | 967 | LOCAL_MODULE := plat_property_contexts.recovery |
| 968 | LOCAL_MODULE_STEM := plat_property_contexts |
| 969 | LOCAL_MODULE_CLASS := ETC |
| 970 | LOCAL_MODULE_TAGS := optional |
| 971 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT) |
| 972 | |
| 973 | include $(BUILD_SYSTEM)/base_rules.mk |
| 974 | |
| 975 | $(LOCAL_BUILT_MODULE): $(built_plat_pc) |
| 976 | $(hide) cp -f $< $@ |
| 977 | |
| 978 | ################################## |
| 979 | include $(CLEAR_VARS) |
| 980 | |
| 981 | LOCAL_MODULE := nonplat_property_contexts.recovery |
| 982 | LOCAL_MODULE_STEM := nonplat_property_contexts |
| 983 | LOCAL_MODULE_CLASS := ETC |
| 984 | LOCAL_MODULE_TAGS := optional |
| 985 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT) |
| 986 | |
| 987 | include $(BUILD_SYSTEM)/base_rules.mk |
| 988 | |
| 989 | $(LOCAL_BUILT_MODULE): $(built_nonplat_pc) |
| 990 | $(hide) cp -f $< $@ |
| 991 | |
| 992 | ################################## |
| 993 | include $(CLEAR_VARS) |
| 994 | |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 995 | LOCAL_MODULE := plat_service_contexts |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 996 | LOCAL_MODULE_CLASS := ETC |
| 997 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 998 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 999 | LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux |
| 1000 | else |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 1001 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 1002 | endif |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 1003 | |
| 1004 | include $(BUILD_SYSTEM)/base_rules.mk |
| 1005 | |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1006 | plat_svcfiles := $(call build_policy, service_contexts, $(PLAT_PRIVATE_POLICY)) |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 1007 | |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1008 | plat_service_contexts.tmp := $(intermediates)/plat_service_contexts.tmp |
| 1009 | $(plat_service_contexts.tmp): PRIVATE_SVC_FILES := $(plat_svcfiles) |
| 1010 | $(plat_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 1011 | $(plat_service_contexts.tmp): $(plat_svcfiles) |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 1012 | @mkdir -p $(dir $@) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 1013 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@ |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 1014 | |
| 1015 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1016 | $(LOCAL_BUILT_MODULE): $(plat_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 1017 | @mkdir -p $(dir $@) |
William Roberts | c9fce3f | 2016-04-06 11:53:04 -0700 | [diff] [blame] | 1018 | sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 1019 | $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@ |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 1020 | |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1021 | built_plat_svc := $(LOCAL_BUILT_MODULE) |
| 1022 | plat_svcfiles := |
| 1023 | plat_service_contexts.tmp := |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 1024 | |
| 1025 | ################################## |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 1026 | include $(CLEAR_VARS) |
| 1027 | |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1028 | LOCAL_MODULE := nonplat_service_contexts |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 1029 | LOCAL_MODULE_CLASS := ETC |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1030 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 1031 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 1032 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
| 1033 | else |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1034 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Jeff Vander Stoep | 4e3a4c7 | 2017-03-08 22:28:03 -0800 | [diff] [blame] | 1035 | endif |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 1036 | |
| 1037 | include $(BUILD_SYSTEM)/base_rules.mk |
| 1038 | |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 1039 | nonplat_svcfiles := $(call build_policy, service_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY)) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 1040 | |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1041 | nonplat_service_contexts.tmp := $(intermediates)/nonplat_service_contexts.tmp |
| 1042 | $(nonplat_service_contexts.tmp): PRIVATE_SVC_FILES := $(nonplat_svcfiles) |
| 1043 | $(nonplat_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 1044 | $(nonplat_service_contexts.tmp): $(nonplat_svcfiles) |
| 1045 | @mkdir -p $(dir $@) |
| 1046 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@ |
| 1047 | |
| 1048 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 1049 | $(LOCAL_BUILT_MODULE): $(nonplat_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 1050 | @mkdir -p $(dir $@) |
William Roberts | c9fce3f | 2016-04-06 11:53:04 -0700 | [diff] [blame] | 1051 | sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
dcashman | 0779155 | 2016-12-07 11:27:47 -0800 | [diff] [blame] | 1052 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@ |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 1053 | |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1054 | built_nonplat_svc := $(LOCAL_BUILT_MODULE) |
| 1055 | nonplat_svcfiles := |
| 1056 | nonplat_service_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 1057 | |
| 1058 | ################################## |
| 1059 | include $(CLEAR_VARS) |
| 1060 | |
Martijn Coenen | 6676c23 | 2017-03-31 17:29:53 -0700 | [diff] [blame] | 1061 | LOCAL_MODULE := vndservice_contexts |
| 1062 | LOCAL_MODULE_CLASS := ETC |
| 1063 | LOCAL_MODULE_TAGS := optional |
| 1064 | ifeq ($(PRODUCT_FULL_TREBLE),true) |
| 1065 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
| 1066 | else |
| 1067 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 1068 | endif |
| 1069 | |
| 1070 | include $(BUILD_SYSTEM)/base_rules.mk |
| 1071 | |
| 1072 | vnd_svcfiles := $(call build_policy, vndservice_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY)) |
| 1073 | |
| 1074 | vndservice_contexts.tmp := $(intermediates)/vndservice_contexts.tmp |
| 1075 | $(vndservice_contexts.tmp): PRIVATE_SVC_FILES := $(vnd_svcfiles) |
| 1076 | $(vndservice_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 1077 | $(vndservice_contexts.tmp): $(vnd_svcfiles) |
| 1078 | @mkdir -p $(dir $@) |
| 1079 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@ |
| 1080 | |
| 1081 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 1082 | $(LOCAL_BUILT_MODULE): $(vndservice_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
| 1083 | @mkdir -p $(dir $@) |
| 1084 | sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
Martijn Coenen | ee97662 | 2017-04-07 10:08:55 -0700 | [diff] [blame] | 1085 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e -v $(PRIVATE_SEPOLICY) $@ |
Martijn Coenen | 6676c23 | 2017-03-31 17:29:53 -0700 | [diff] [blame] | 1086 | |
| 1087 | vnd_svcfiles := |
| 1088 | vndservice_contexts.tmp := |
| 1089 | ################################## |
| 1090 | include $(CLEAR_VARS) |
| 1091 | |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1092 | LOCAL_MODULE := plat_mac_permissions.xml |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 1093 | LOCAL_MODULE_CLASS := ETC |
| 1094 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | bba9e7b | 2017-03-10 15:51:23 -0800 | [diff] [blame] | 1095 | LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 1096 | |
William Roberts | 2c8a55d | 2012-11-30 14:59:09 -0800 | [diff] [blame] | 1097 | include $(BUILD_SYSTEM)/base_rules.mk |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 1098 | |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 1099 | # Build keys.conf |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1100 | plat_mac_perms_keys.tmp := $(intermediates)/plat_keys.tmp |
| 1101 | $(plat_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 1102 | $(plat_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_PRIVATE_POLICY)) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 1103 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 1104 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@ |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 1105 | |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1106 | all_plat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_PRIVATE_POLICY)) |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 1107 | |
Shinichiro Hamaji | ef0c14d | 2016-05-13 16:04:58 +0900 | [diff] [blame] | 1108 | # Should be synced with keys.conf. |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1109 | all_plat_keys := platform media shared testkey |
| 1110 | all_plat_keys := $(all_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem) |
Shinichiro Hamaji | ef0c14d | 2016-05-13 16:04:58 +0900 | [diff] [blame] | 1111 | |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1112 | $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_plat_mac_perms_files) |
| 1113 | $(LOCAL_BUILT_MODULE): $(plat_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \ |
| 1114 | $(all_plat_mac_perms_files) $(all_plat_keys) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 1115 | @mkdir -p $(dir $@) |
Nick Kralevich | c3c9052 | 2013-10-25 12:25:36 -0700 | [diff] [blame] | 1116 | $(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \ |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 1117 | $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 1118 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 1119 | all_mac_perms_files := |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1120 | all_plat_keys := |
| 1121 | plat_mac_perms_keys.tmp := |
| 1122 | |
| 1123 | ################################## |
| 1124 | include $(CLEAR_VARS) |
| 1125 | |
| 1126 | LOCAL_MODULE := nonplat_mac_permissions.xml |
| 1127 | LOCAL_MODULE_CLASS := ETC |
| 1128 | LOCAL_MODULE_TAGS := optional |
Jeff Vander Stoep | bba9e7b | 2017-03-10 15:51:23 -0800 | [diff] [blame] | 1129 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1130 | |
| 1131 | include $(BUILD_SYSTEM)/base_rules.mk |
| 1132 | |
| 1133 | # Build keys.conf |
| 1134 | nonplat_mac_perms_keys.tmp := $(intermediates)/nonplat_keys.tmp |
| 1135 | $(nonplat_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 1136 | $(nonplat_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY)) |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1137 | @mkdir -p $(dir $@) |
| 1138 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@ |
| 1139 | |
Alex Klyubin | 5596172 | 2017-01-30 18:44:59 -0800 | [diff] [blame] | 1140 | all_nonplat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY)) |
dcashman | 90b3b94 | 2016-12-14 13:47:55 -0800 | [diff] [blame] | 1141 | |
| 1142 | $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_nonplat_mac_perms_files) |
| 1143 | $(LOCAL_BUILT_MODULE): $(nonplat_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \ |
| 1144 | $(all_nonplat_mac_perms_files) |
| 1145 | @mkdir -p $(dir $@) |
| 1146 | $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES) |
| 1147 | |
| 1148 | nonplat_mac_perms_keys.tmp := |
| 1149 | all_nonplat_mac_perms_files := |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 1150 | |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 1151 | ################################## |
rpcraig | 47cd396 | 2012-10-17 21:09:52 -0400 | [diff] [blame] | 1152 | |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 1153 | add_nl := |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 1154 | build_device_policy := |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 1155 | build_policy := |
dcashman | d225b69 | 2016-12-12 09:29:04 -0800 | [diff] [blame] | 1156 | built_plat_fc := |
| 1157 | built_nonplat_fc := |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 1158 | built_nl := |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 1159 | built_plat_cil := |
Alex Klyubin | 8f7173b | 2017-02-25 14:47:53 -0800 | [diff] [blame] | 1160 | built_mapping_cil := |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 1161 | built_plat_pc := |
Alex Klyubin | 193dccd | 2017-03-07 14:05:57 -0800 | [diff] [blame] | 1162 | built_nonplat_cil := |
Sandeep Patil | a86316e | 2016-12-27 16:08:44 -0800 | [diff] [blame] | 1163 | built_nonplat_pc := |
Dan Cashman | 9c03807 | 2016-12-22 07:15:18 -0800 | [diff] [blame] | 1164 | built_nonplat_sc := |
| 1165 | built_plat_sc := |
Alex Klyubin | 193dccd | 2017-03-07 14:05:57 -0800 | [diff] [blame] | 1166 | built_precompiled_sepolicy := |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 1167 | built_sepolicy := |
Sandeep Patil | a058b56 | 2016-12-27 15:10:48 -0800 | [diff] [blame] | 1168 | built_plat_svc := |
| 1169 | built_nonplat_svc := |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 1170 | mapping_policy_nvr := |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 1171 | my_target_arch := |
| 1172 | nonplat_policy_nvr := |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 1173 | plat_policy_nvr := |
dcashman | 1faa644 | 2016-11-28 07:20:28 -0800 | [diff] [blame] | 1174 | plat_pub_policy.cil := |
| 1175 | reqd_policy_mask.cil := |
Dan Cashman | 1c04027 | 2016-12-15 15:28:44 -0800 | [diff] [blame] | 1176 | sepolicy_build_files := |
Alex Klyubin | 7cda44f | 2017-03-21 14:28:53 -0700 | [diff] [blame] | 1177 | sepolicy_build_cil_workaround_files := |
Jeff Vander Stoep | 7443484 | 2017-03-13 12:22:15 -0700 | [diff] [blame] | 1178 | with_asan := |
Alice Chu | cdfb06f | 2012-11-01 11:33:04 -0700 | [diff] [blame] | 1179 | |
| 1180 | include $(call all-makefiles-under,$(LOCAL_PATH)) |