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) |
| 4 | |
| 5 | # SELinux policy version. |
Stephen Smalley | b4f1706 | 2015-03-13 10:03:52 -0400 | [diff] [blame] | 6 | # Must be <= /sys/fs/selinux/policyvers reported by the Android kernel. |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 7 | # Must be within the compatibility range reported by checkpolicy -V. |
Jeff Vander Stoep | 3a0ce49 | 2015-12-07 08:30:43 -0800 | [diff] [blame] | 8 | POLICYVERS ?= 30 |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 9 | |
| 10 | MLS_SENS=1 |
| 11 | MLS_CATS=1024 |
| 12 | |
Stephen Smalley | b4f1706 | 2015-03-13 10:03:52 -0400 | [diff] [blame] | 13 | ifdef BOARD_SEPOLICY_REPLACE |
| 14 | $(error BOARD_SEPOLICY_REPLACE is no longer supported; please remove from your BoardConfig.mk or other .mk file.) |
| 15 | endif |
| 16 | |
| 17 | ifdef BOARD_SEPOLICY_IGNORE |
| 18 | $(error BOARD_SEPOLICY_IGNORE is no longer supported; please remove from your BoardConfig.mk or other .mk file.) |
| 19 | endif |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 20 | |
Stephen Smalley | 8e0ca88 | 2015-04-01 10:14:56 -0400 | [diff] [blame] | 21 | ifdef BOARD_SEPOLICY_UNION |
| 22 | $(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.) |
| 23 | endif |
Robert Craig | 6b0ff47 | 2014-01-29 13:10:58 -0500 | [diff] [blame] | 24 | |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 25 | ifdef BOARD_SEPOLICY_M4DEFS |
| 26 | LOCAL_ADDITIONAL_M4DEFS := $(addprefix -D, $(BOARD_SEPOLICY_M4DEFS)) |
| 27 | endif |
| 28 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 29 | # Builds paths for all policy files found in BOARD_SEPOLICY_DIRS and the LOCAL_PATH. |
William Roberts | 29d1468 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 30 | # $(1): the set of policy name paths to build |
Jeffrey Vander Stoep | b1fb7e4 | 2016-01-14 23:28:51 +0000 | [diff] [blame] | 31 | build_policy = $(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(LOCAL_PATH) $(BOARD_SEPOLICY_DIRS)), $(sort $(wildcard $(file))))) |
William Roberts | 29d1468 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 32 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 33 | # Builds paths for all policy files found in BOARD_SEPOLICY_DIRS. |
| 34 | # $(1): the set of policy name paths to build |
| 35 | build_device_policy = $(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(BOARD_SEPOLICY_DIRS)), $(sort $(wildcard $(file))))) |
| 36 | |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 37 | # Add a file containing only a newline in-between each policy configuration |
| 38 | # 'contexts' file. This will allow OEM policy configuration files without a |
| 39 | # final newline (0x0A) to be built correctly by the m4(1) macro processor. |
| 40 | # $(1): the set of contexts file names. |
| 41 | # $(2): the file containing only 0x0A. |
| 42 | add_nl = $(foreach entry, $(1), $(subst $(entry), $(entry) $(2), $(entry))) |
| 43 | |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 44 | sepolicy_build_files := security_classes \ |
| 45 | initial_sids \ |
| 46 | access_vectors \ |
| 47 | global_macros \ |
Nick Kralevich | a17a266 | 2014-11-05 15:30:41 -0800 | [diff] [blame] | 48 | neverallow_macros \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 49 | mls_macros \ |
| 50 | mls \ |
| 51 | policy_capabilities \ |
| 52 | te_macros \ |
| 53 | attributes \ |
Jeff Vander Stoep | cbaa2b7 | 2015-12-22 10:39:34 -0800 | [diff] [blame] | 54 | ioctl_defines \ |
Jeff Vander Stoep | de9b530 | 2015-06-05 15:28:55 -0700 | [diff] [blame] | 55 | ioctl_macros \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 56 | *.te \ |
| 57 | roles \ |
| 58 | users \ |
| 59 | initial_sid_contexts \ |
| 60 | fs_use \ |
| 61 | genfs_contexts \ |
| 62 | port_contexts |
| 63 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 64 | ################################## |
| 65 | include $(CLEAR_VARS) |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 66 | |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 67 | LOCAL_MODULE := sectxfile_nl |
| 68 | LOCAL_MODULE_CLASS := ETC |
| 69 | LOCAL_MODULE_TAGS := optional |
| 70 | |
| 71 | # Create a file containing newline only to add between context config files |
| 72 | include $(BUILD_SYSTEM)/base_rules.mk |
William Roberts | cb1ab98 | 2015-12-14 07:54:28 -0800 | [diff] [blame] | 73 | $(LOCAL_BUILT_MODULE): |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 74 | @mkdir -p $(dir $@) |
| 75 | $(hide) echo > $@ |
| 76 | |
| 77 | built_nl := $(LOCAL_BUILT_MODULE) |
| 78 | |
| 79 | ################################# |
| 80 | include $(CLEAR_VARS) |
| 81 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 82 | LOCAL_MODULE := sepolicy |
| 83 | LOCAL_MODULE_CLASS := ETC |
| 84 | LOCAL_MODULE_TAGS := optional |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 85 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Douglas Leung | 5807d1d | 2016-07-28 15:49:31 -0700 | [diff] [blame] | 86 | LOCAL_TARGET_ARCH := $(TARGET_ARCH) |
| 87 | |
| 88 | # Set LOCAL_TARGET_ARCH to mips for mips and mips64. |
| 89 | ifneq (,$(filter mips mips64,$(TARGET_ARCH))) |
| 90 | LOCAL_TARGET_ARCH := mips |
| 91 | endif |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 92 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 93 | include $(BUILD_SYSTEM)/base_rules.mk |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 94 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 95 | sepolicy_policy.conf := $(intermediates)/policy.conf |
| 96 | $(sepolicy_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 97 | $(sepolicy_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 98 | $(sepolicy_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 99 | $(sepolicy_policy.conf): $(call build_policy, $(sepolicy_build_files)) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 100 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 101 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 102 | -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] | 103 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Douglas Leung | 5807d1d | 2016-07-28 15:49:31 -0700 | [diff] [blame] | 104 | -D target_arch=$(LOCAL_TARGET_ARCH) \ |
Nick Kralevich | 623975f | 2014-01-11 01:31:03 -0800 | [diff] [blame] | 105 | -s $^ > $@ |
Robert Craig | 65d4f44 | 2013-03-27 06:30:25 -0400 | [diff] [blame] | 106 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 107 | |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 108 | $(LOCAL_BUILT_MODULE): $(sepolicy_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy $(HOST_OUT_EXECUTABLES)/sepolicy-analyze |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 109 | @mkdir -p $(dir $@) |
Nick Kralevich | 6ef10bd | 2016-02-29 16:59:33 -0800 | [diff] [blame] | 110 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@.tmp $< > /dev/null |
| 111 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $(dir $<)/$(notdir $@).dontaudit $<.dontaudit > /dev/null |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 112 | $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains |
| 113 | $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \ |
| 114 | echo "==========" 1>&2; \ |
| 115 | echo "ERROR: permissive domains not allowed in user builds" 1>&2; \ |
| 116 | echo "List of invalid domains:" 1>&2; \ |
| 117 | cat $@.permissivedomains 1>&2; \ |
| 118 | exit 1; \ |
| 119 | fi |
| 120 | $(hide) mv $@.tmp $@ |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 121 | |
Ying Wang | d8b122c | 2012-10-25 19:01:31 -0700 | [diff] [blame] | 122 | built_sepolicy := $(LOCAL_BUILT_MODULE) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 123 | sepolicy_policy.conf := |
Stephen Smalley | 01a58af | 2012-10-02 12:46:37 -0400 | [diff] [blame] | 124 | |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 125 | ################################## |
| 126 | include $(CLEAR_VARS) |
| 127 | |
| 128 | LOCAL_MODULE := sepolicy.recovery |
| 129 | LOCAL_MODULE_CLASS := ETC |
| 130 | LOCAL_MODULE_TAGS := eng |
| 131 | |
| 132 | include $(BUILD_SYSTEM)/base_rules.mk |
| 133 | |
| 134 | sepolicy_policy_recovery.conf := $(intermediates)/policy_recovery.conf |
| 135 | $(sepolicy_policy_recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 136 | $(sepolicy_policy_recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 137 | $(sepolicy_policy_recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 138 | $(sepolicy_policy_recovery.conf): $(call build_policy, $(sepolicy_build_files)) |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 139 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 140 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 141 | -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] | 142 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 143 | -D target_recovery=true \ |
| 144 | -s $^ > $@ |
| 145 | |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 146 | $(LOCAL_BUILT_MODULE): $(sepolicy_policy_recovery.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy $(HOST_OUT_EXECUTABLES)/sepolicy-analyze |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 147 | @mkdir -p $(dir $@) |
Nick Kralevich | 6ef10bd | 2016-02-29 16:59:33 -0800 | [diff] [blame] | 148 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@.tmp $< > /dev/null |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 149 | $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains |
| 150 | $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \ |
| 151 | echo "==========" 1>&2; \ |
| 152 | echo "ERROR: permissive domains not allowed in user builds" 1>&2; \ |
| 153 | echo "List of invalid domains:" 1>&2; \ |
| 154 | cat $@.permissivedomains 1>&2; \ |
| 155 | exit 1; \ |
| 156 | fi |
| 157 | $(hide) mv $@.tmp $@ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 158 | |
| 159 | built_sepolicy_recovery := $(LOCAL_BUILT_MODULE) |
| 160 | sepolicy_policy_recovery.conf := |
| 161 | |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 162 | ################################## |
| 163 | include $(CLEAR_VARS) |
| 164 | |
| 165 | LOCAL_MODULE := general_sepolicy.conf |
| 166 | LOCAL_MODULE_CLASS := ETC |
| 167 | LOCAL_MODULE_TAGS := tests |
| 168 | |
| 169 | include $(BUILD_SYSTEM)/base_rules.mk |
| 170 | |
| 171 | exp_sepolicy_build_files :=\ |
Dan Willemsen | bc2a49f | 2015-08-10 15:40:52 -0700 | [diff] [blame] | 172 | $(foreach file, $(addprefix $(LOCAL_PATH)/, $(sepolicy_build_files)), $(sort $(wildcard $(file)))) |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 173 | |
| 174 | $(LOCAL_BUILT_MODULE): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 175 | $(LOCAL_BUILT_MODULE): PRIVATE_MLS_CATS := $(MLS_CATS) |
| 176 | $(LOCAL_BUILT_MODULE): $(exp_sepolicy_build_files) |
| 177 | mkdir -p $(dir $@) |
| 178 | $(hide) m4 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 179 | -D target_build_variant=user \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 180 | -s $^ > $@ |
| 181 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
| 182 | |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 183 | built_general_sepolicy.conf := $(LOCAL_BUILT_MODULE) |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 184 | exp_sepolicy_build_files := |
| 185 | |
| 186 | ################################## |
Stephen Smalley | 01a58af | 2012-10-02 12:46:37 -0400 | [diff] [blame] | 187 | include $(CLEAR_VARS) |
| 188 | |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 189 | LOCAL_MODULE := sepolicy.general |
| 190 | LOCAL_MODULE_CLASS := ETC |
| 191 | LOCAL_MODULE_TAGS := tests |
| 192 | |
| 193 | include $(BUILD_SYSTEM)/base_rules.mk |
| 194 | |
| 195 | $(LOCAL_BUILT_MODULE): PRIVATE_BUILT_SEPOLICY.CONF := $(built_general_sepolicy.conf) |
| 196 | $(LOCAL_BUILT_MODULE): $(built_general_sepolicy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy |
| 197 | @mkdir -p $(dir $@) |
Nick Kralevich | 6ef10bd | 2016-02-29 16:59:33 -0800 | [diff] [blame] | 198 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@ $(PRIVATE_BUILT_SEPOLICY.CONF) > /dev/null |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 199 | |
| 200 | built_general_sepolicy := $(LOCAL_BUILT_MODULE) |
| 201 | ################################## |
| 202 | include $(CLEAR_VARS) |
| 203 | |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 204 | LOCAL_MODULE := file_contexts.bin |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 205 | LOCAL_MODULE_CLASS := ETC |
| 206 | LOCAL_MODULE_TAGS := optional |
| 207 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 208 | |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 209 | include $(BUILD_SYSTEM)/base_rules.mk |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 210 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 211 | # The file_contexts.bin is built in the following way: |
| 212 | # 1. Collect all file_contexts files in THIS repository and process them with |
| 213 | # m4 into a tmp file called file_contexts.local.tmp. |
| 214 | # 2. Collect all device specific file_contexts files and process them with m4 |
| 215 | # into a tmp file called file_contexts.device.tmp. |
| 216 | # 3. Run checkfc -e (allow no device fc entries ie empty) and fc_sort on |
| 217 | # file_contexts.device.tmp and output to file_contexts.device.sorted.tmp. |
| 218 | # 4. Concatenate file_contexts.local.tmp and file_contexts.device.tmp into |
| 219 | # file_contexts.concat.tmp. |
| 220 | # 5. Run checkfc and sefcontext_compile on file_contexts.concat.tmp to produce |
| 221 | # file_contexts.bin. |
| 222 | # |
| 223 | # Note: That a newline file is placed between each file_context file found to |
| 224 | # 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] | 225 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 226 | local_fc_files := $(LOCAL_PATH)/file_contexts |
| 227 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
| 228 | local_fc_files := $(local_fc_files) $(LOCAL_PATH)/file_contexts_asan |
| 229 | endif |
| 230 | local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl)) |
| 231 | |
| 232 | file_contexts.local.tmp := $(intermediates)/file_contexts.local.tmp |
| 233 | $(file_contexts.local.tmp): $(local_fcfiles_with_nl) |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 234 | @mkdir -p $(dir $@) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 235 | $(hide) m4 -s $^ > $@ |
| 236 | |
| 237 | device_fc_files := $(call build_device_policy, file_contexts) |
| 238 | device_fcfiles_with_nl := $(call add_nl, $(device_fc_files), $(built_nl)) |
| 239 | |
| 240 | file_contexts.device.tmp := $(intermediates)/file_contexts.device.tmp |
| 241 | $(file_contexts.device.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 242 | $(file_contexts.device.tmp): $(device_fcfiles_with_nl) |
| 243 | @mkdir -p $(dir $@) |
| 244 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@ |
| 245 | |
| 246 | file_contexts.device.sorted.tmp := $(intermediates)/file_contexts.device.sorted.tmp |
| 247 | $(file_contexts.device.sorted.tmp): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 248 | $(file_contexts.device.sorted.tmp): $(file_contexts.device.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/fc_sort $(HOST_OUT_EXECUTABLES)/checkfc |
| 249 | @mkdir -p $(dir $@) |
| 250 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e $(PRIVATE_SEPOLICY) $< |
| 251 | $(hide) $(HOST_OUT_EXECUTABLES)/fc_sort $< $@ |
| 252 | |
| 253 | file_contexts.concat.tmp := $(intermediates)/file_contexts.concat.tmp |
| 254 | $(file_contexts.concat.tmp): $(file_contexts.local.tmp) $(file_contexts.device.sorted.tmp) |
| 255 | @mkdir -p $(dir $@) |
| 256 | $(hide) m4 -s $^ > $@ |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 257 | |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 258 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 259 | $(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] | 260 | @mkdir -p $(dir $@) |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 261 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $< |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 262 | $(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $< |
| 263 | |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 264 | built_fc := $(LOCAL_BUILT_MODULE) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 265 | local_fc_files := |
| 266 | local_fcfiles_with_nl := |
| 267 | device_fc_files := |
| 268 | device_fcfiles_with_nl := |
| 269 | file_contexts.concat.tmp := |
| 270 | file_contexts.device.sorted.tmp := |
| 271 | file_contexts.device.tmp := |
| 272 | file_contexts.local.tmp := |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 273 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 274 | ################################## |
| 275 | include $(CLEAR_VARS) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 276 | |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 277 | LOCAL_MODULE := general_file_contexts.bin |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 278 | LOCAL_MODULE_CLASS := ETC |
| 279 | LOCAL_MODULE_TAGS := tests |
| 280 | |
| 281 | include $(BUILD_SYSTEM)/base_rules.mk |
| 282 | |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 283 | general_file_contexts.tmp := $(intermediates)/general_file_contexts.tmp |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 284 | $(general_file_contexts.tmp): $(addprefix $(LOCAL_PATH)/, file_contexts) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 285 | @mkdir -p $(dir $@) |
| 286 | $(hide) m4 -s $< > $@ |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 287 | |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 288 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
| 289 | $(LOCAL_BUILT_MODULE): $(general_file_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 290 | @mkdir -p $(dir $@) |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 291 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $< |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 292 | $(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $< |
| 293 | |
| 294 | general_file_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 295 | |
| 296 | ################################## |
| 297 | include $(CLEAR_VARS) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 298 | LOCAL_MODULE := seapp_contexts |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 299 | LOCAL_MODULE_CLASS := ETC |
| 300 | LOCAL_MODULE_TAGS := optional |
| 301 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 302 | |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 303 | include $(BUILD_SYSTEM)/base_rules.mk |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 304 | |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 305 | all_sc_files := $(call build_policy, seapp_contexts) |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 306 | |
Ying Wang | d8b122c | 2012-10-25 19:01:31 -0700 | [diff] [blame] | 307 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 308 | $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(all_sc_files) |
| 309 | $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(all_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp |
William Roberts | f0e0a94 | 2012-08-27 15:41:15 -0700 | [diff] [blame] | 310 | @mkdir -p $(dir $@) |
William Roberts | 99fe8df | 2015-06-30 13:53:51 -0700 | [diff] [blame] | 311 | $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 312 | |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 313 | built_sc := $(LOCAL_BUILT_MODULE) |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 314 | all_sc_files := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 315 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 316 | ################################## |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 317 | include $(CLEAR_VARS) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 318 | LOCAL_MODULE := general_seapp_contexts |
| 319 | LOCAL_MODULE_CLASS := ETC |
| 320 | LOCAL_MODULE_TAGS := tests |
| 321 | |
| 322 | include $(BUILD_SYSTEM)/base_rules.mk |
| 323 | |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 324 | all_sc_files := $(addprefix $(LOCAL_PATH)/, seapp_contexts) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 325 | |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 326 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 327 | $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILE := $(all_sc_files) |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 328 | $(LOCAL_BUILT_MODULE): $(built_general_sepolicy) $(all_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 329 | @mkdir -p $(dir $@) |
William Roberts | 99fe8df | 2015-06-30 13:53:51 -0700 | [diff] [blame] | 330 | $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILE) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 331 | |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 332 | all_sc_files := |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 333 | |
| 334 | ################################## |
| 335 | include $(CLEAR_VARS) |
William Roberts | 4ee7131 | 2015-06-25 11:59:30 -0700 | [diff] [blame] | 336 | LOCAL_MODULE := general_seapp_neverallows |
| 337 | LOCAL_MODULE_CLASS := ETC |
| 338 | LOCAL_MODULE_TAGS := tests |
| 339 | |
| 340 | include $(BUILD_SYSTEM)/base_rules.mk |
| 341 | |
| 342 | $(LOCAL_BUILT_MODULE): $(addprefix $(LOCAL_PATH)/, seapp_contexts) |
| 343 | @mkdir -p $(dir $@) |
| 344 | - $(hide) grep -ie '^neverallow' $< > $@ |
| 345 | |
William Roberts | 4ee7131 | 2015-06-25 11:59:30 -0700 | [diff] [blame] | 346 | |
| 347 | ################################## |
| 348 | include $(CLEAR_VARS) |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 349 | |
| 350 | LOCAL_MODULE := property_contexts |
| 351 | LOCAL_MODULE_CLASS := ETC |
| 352 | LOCAL_MODULE_TAGS := optional |
| 353 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 354 | |
| 355 | include $(BUILD_SYSTEM)/base_rules.mk |
| 356 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 357 | all_pc_files := $(call build_policy, property_contexts) |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 358 | all_pcfiles_with_nl := $(call add_nl, $(all_pc_files), $(built_nl)) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 359 | |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 360 | property_contexts.tmp := $(intermediates)/property_contexts.tmp |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 361 | $(property_contexts.tmp): PRIVATE_PC_FILES := $(all_pcfiles_with_nl) |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 362 | $(property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 363 | $(property_contexts.tmp): $(all_pcfiles_with_nl) |
William Roberts | 7f81b33 | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 364 | @mkdir -p $(dir $@) |
Colin Cross | 9eb6c87 | 2015-10-01 21:25:09 +0000 | [diff] [blame] | 365 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@ |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 366 | |
| 367 | |
| 368 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
William Roberts | 371918c | 2016-04-06 11:40:08 -0700 | [diff] [blame] | 369 | $(LOCAL_BUILT_MODULE): $(property_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 370 | @mkdir -p $(dir $@) |
William Roberts | 371918c | 2016-04-06 11:40:08 -0700 | [diff] [blame] | 371 | $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 372 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@ |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 373 | |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 374 | built_pc := $(LOCAL_BUILT_MODULE) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 375 | all_pc_files := |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 376 | all_pcfiles_with_nl := |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 377 | property_contexts.tmp := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 378 | |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 379 | ################################## |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 380 | include $(CLEAR_VARS) |
| 381 | |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 382 | LOCAL_MODULE := general_property_contexts |
| 383 | LOCAL_MODULE_CLASS := ETC |
| 384 | LOCAL_MODULE_TAGS := tests |
| 385 | |
Stephen Smalley | c936173 | 2015-03-13 09:36:57 -0400 | [diff] [blame] | 386 | include $(BUILD_SYSTEM)/base_rules.mk |
| 387 | |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 388 | general_property_contexts.tmp := $(intermediates)/general_property_contexts.tmp |
| 389 | $(general_property_contexts.tmp): $(addprefix $(LOCAL_PATH)/, property_contexts) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 390 | @mkdir -p $(dir $@) |
| 391 | $(hide) m4 -s $< > $@ |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 392 | |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 393 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
| 394 | $(LOCAL_BUILT_MODULE): $(general_property_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
| 395 | @mkdir -p $(dir $@) |
William Roberts | 371918c | 2016-04-06 11:40:08 -0700 | [diff] [blame] | 396 | $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 397 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@ |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 398 | |
| 399 | general_property_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 400 | |
| 401 | ################################## |
| 402 | include $(CLEAR_VARS) |
| 403 | |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 404 | LOCAL_MODULE := service_contexts |
| 405 | LOCAL_MODULE_CLASS := ETC |
| 406 | LOCAL_MODULE_TAGS := optional |
| 407 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 408 | |
| 409 | include $(BUILD_SYSTEM)/base_rules.mk |
| 410 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 411 | all_svc_files := $(call build_policy, service_contexts) |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 412 | all_svcfiles_with_nl := $(call add_nl, $(all_svc_files), $(built_nl)) |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 413 | |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 414 | service_contexts.tmp := $(intermediates)/service_contexts.tmp |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 415 | $(service_contexts.tmp): PRIVATE_SVC_FILES := $(all_svcfiles_with_nl) |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 416 | $(service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 417 | $(service_contexts.tmp): $(all_svcfiles_with_nl) |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 418 | @mkdir -p $(dir $@) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 419 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@ |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 420 | |
| 421 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 422 | $(LOCAL_BUILT_MODULE): $(service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
| 423 | @mkdir -p $(dir $@) |
William Roberts | c9fce3f | 2016-04-06 11:53:04 -0700 | [diff] [blame] | 424 | sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 425 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@ |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 426 | |
| 427 | built_svc := $(LOCAL_BUILT_MODULE) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 428 | all_svc_files := |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 429 | all_svcfiles_with_nl := |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 430 | service_contexts.tmp := |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 431 | |
| 432 | ################################## |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 433 | include $(CLEAR_VARS) |
| 434 | |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 435 | LOCAL_MODULE := general_service_contexts |
| 436 | LOCAL_MODULE_CLASS := ETC |
| 437 | LOCAL_MODULE_TAGS := tests |
| 438 | |
| 439 | include $(BUILD_SYSTEM)/base_rules.mk |
| 440 | |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 441 | general_service_contexts.tmp := $(intermediates)/general_service_contexts.tmp |
| 442 | $(general_service_contexts.tmp): $(addprefix $(LOCAL_PATH)/, service_contexts) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 443 | @mkdir -p $(dir $@) |
| 444 | $(hide) m4 -s $< > $@ |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 445 | |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 446 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
| 447 | $(LOCAL_BUILT_MODULE): $(general_service_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
| 448 | @mkdir -p $(dir $@) |
William Roberts | c9fce3f | 2016-04-06 11:53:04 -0700 | [diff] [blame] | 449 | sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 450 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@ |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 451 | |
| 452 | general_service_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 453 | |
| 454 | ################################## |
| 455 | include $(CLEAR_VARS) |
| 456 | |
Robert Craig | 7f2392e | 2013-03-27 08:35:39 -0400 | [diff] [blame] | 457 | LOCAL_MODULE := mac_permissions.xml |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 458 | LOCAL_MODULE_CLASS := ETC |
| 459 | LOCAL_MODULE_TAGS := optional |
| 460 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/security |
| 461 | |
William Roberts | 2c8a55d | 2012-11-30 14:59:09 -0800 | [diff] [blame] | 462 | include $(BUILD_SYSTEM)/base_rules.mk |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 463 | |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 464 | # Build keys.conf |
| 465 | mac_perms_keys.tmp := $(intermediates)/keys.tmp |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 466 | $(mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 467 | $(mac_perms_keys.tmp): $(call build_policy, keys.conf) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 468 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 469 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@ |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 470 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 471 | all_mac_perms_files := $(call build_policy, $(LOCAL_MODULE)) |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 472 | |
Shinichiro Hamaji | ef0c14d | 2016-05-13 16:04:58 +0900 | [diff] [blame] | 473 | # Should be synced with keys.conf. |
| 474 | all_keys := platform media shared testkey |
| 475 | all_keys := $(all_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem) |
| 476 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 477 | $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_mac_perms_files) |
Shinichiro Hamaji | ef0c14d | 2016-05-13 16:04:58 +0900 | [diff] [blame] | 478 | $(LOCAL_BUILT_MODULE): $(mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py $(all_mac_perms_files) $(all_keys) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 479 | @mkdir -p $(dir $@) |
Nick Kralevich | c3c9052 | 2013-10-25 12:25:36 -0700 | [diff] [blame] | 480 | $(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \ |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 481 | $(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] | 482 | |
Robert Craig | 7f2392e | 2013-03-27 08:35:39 -0400 | [diff] [blame] | 483 | mac_perms_keys.tmp := |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 484 | all_mac_perms_files := |
| 485 | |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 486 | ################################## |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 487 | include $(CLEAR_VARS) |
| 488 | |
| 489 | LOCAL_MODULE := selinux_version |
| 490 | LOCAL_MODULE_CLASS := ETC |
| 491 | LOCAL_MODULE_TAGS := optional |
| 492 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 493 | |
| 494 | include $(BUILD_SYSTEM)/base_rules.mk |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 495 | $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(built_pc) $(built_fc) $(built_sc) $(built_svc) |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 496 | @mkdir -p $(dir $@) |
Colin Cross | 29a463d | 2015-07-17 13:08:41 -0700 | [diff] [blame] | 497 | $(hide) echo -n $(BUILD_FINGERPRINT_FROM_FILE) > $@ |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 498 | |
| 499 | ################################## |
rpcraig | 47cd396 | 2012-10-17 21:09:52 -0400 | [diff] [blame] | 500 | |
| 501 | build_policy := |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 502 | build_device_policy := |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 503 | sepolicy_build_files := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 504 | built_sepolicy := |
William Roberts | 50a478e | 2015-12-28 16:19:54 -0800 | [diff] [blame] | 505 | built_sepolicy_recovery := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 506 | built_sc := |
| 507 | built_fc := |
| 508 | built_pc := |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 509 | built_svc := |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 510 | built_general_sepolicy := |
| 511 | built_general_sepolicy.conf := |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 512 | built_nl := |
William Roberts | 50a478e | 2015-12-28 16:19:54 -0800 | [diff] [blame] | 513 | add_nl := |
Alice Chu | cdfb06f | 2012-11-01 11:33:04 -0700 | [diff] [blame] | 514 | |
| 515 | include $(call all-makefiles-under,$(LOCAL_PATH)) |