blob: 68bd7869c75c2582aaacec398b4cf964c896324b [file] [log] [blame]
Stephen Smalley2dd4e512012-01-04 12:33:27 -05001LOCAL_PATH:= $(call my-dir)
William Robertsf0e0a942012-08-27 15:41:15 -07002
Dan Cashman6f14f6b2017-04-07 16:36:23 -07003# PLATFORM_SEPOLICY_VERSION is a number of the form "NN.m" with "NN" mapping to
4# PLATFORM_SDK_VERSION and "m" as a minor number which allows for SELinux
5# changes independent of PLATFORM_SDK_VERSION. This value will be set to
6# 10000.0 to represent tip-of-tree development that is inherently unstable and
7# thus designed not to work with any shipping vendor policy. This is similar in
8# spirit to how DEFAULT_APP_TARGET_SDK is set.
9# The minor version ('m' component) must be updated every time a platform release
10# is made which breaks compatibility with the previous platform sepolicy version,
11# not just on every increase in PLATFORM_SDK_VERSION. The minor version should
12# be reset to 0 on every bump of the PLATFORM_SDK_VERSION.
Ian Pedowitz4816b8f2017-05-04 00:09:57 +000013sepolicy_major_vers := 26
Dan Cashman6f14f6b2017-04-07 16:36:23 -070014sepolicy_minor_vers := 0
15
16ifneq ($(sepolicy_major_vers), $(PLATFORM_SDK_VERSION))
17$(error sepolicy_major_version does not match PLATFORM_SDK_VERSION, please update.)
18endif
19ifneq (REL,$(PLATFORM_VERSION_CODENAME))
20 sepolicy_major_vers := 10000
21 sepolicy_minor_vers := 0
22endif
23PLATFORM_SEPOLICY_VERSION := $(join $(addsuffix .,$(sepolicy_major_vers)), $(sepolicy_minor_vers))
24sepolicy_major_vers :=
25sepolicy_minor_vers :=
26
Stephen Smalley2dd4e512012-01-04 12:33:27 -050027include $(CLEAR_VARS)
Stephen Smalley2dd4e512012-01-04 12:33:27 -050028# SELinux policy version.
Stephen Smalleyb4f17062015-03-13 10:03:52 -040029# Must be <= /sys/fs/selinux/policyvers reported by the Android kernel.
Stephen Smalley2dd4e512012-01-04 12:33:27 -050030# Must be within the compatibility range reported by checkpolicy -V.
Jeff Vander Stoep3a0ce492015-12-07 08:30:43 -080031POLICYVERS ?= 30
Stephen Smalley2dd4e512012-01-04 12:33:27 -050032
33MLS_SENS=1
34MLS_CATS=1024
35
Stephen Smalleyb4f17062015-03-13 10:03:52 -040036ifdef BOARD_SEPOLICY_REPLACE
37$(error BOARD_SEPOLICY_REPLACE is no longer supported; please remove from your BoardConfig.mk or other .mk file.)
38endif
39
40ifdef BOARD_SEPOLICY_IGNORE
41$(error BOARD_SEPOLICY_IGNORE is no longer supported; please remove from your BoardConfig.mk or other .mk file.)
42endif
Stephen Smalley5b340be2012-03-06 11:12:41 -050043
Stephen Smalley8e0ca882015-04-01 10:14:56 -040044ifdef BOARD_SEPOLICY_UNION
45$(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.)
46endif
Robert Craig6b0ff472014-01-29 13:10:58 -050047
William Robertsd2185582015-07-16 11:28:02 -070048ifdef BOARD_SEPOLICY_M4DEFS
49LOCAL_ADDITIONAL_M4DEFS := $(addprefix -D, $(BOARD_SEPOLICY_M4DEFS))
50endif
51
dcashmancc39f632016-07-22 13:13:11 -070052# sepolicy is now divided into multiple portions:
53# public - policy exported on which non-platform policy developers may write
54# additional policy. types and attributes are versioned and included in
55# delivered non-platform policy, which is to be combined with platform policy.
56# private - platform-only policy required for platform functionality but which
57# is not exported to vendor policy developers and as such may not be assumed
58# to exist.
Alex Klyubin55961722017-01-30 18:44:59 -080059# vendor - vendor-only policy required for vendor functionality. This policy can
60# reference the public policy but cannot reference the private policy. This
61# policy is for components which are produced from the core/non-vendor tree and
62# placed into a vendor partition.
dcashman07791552016-12-07 11:27:47 -080063# mapping - This contains policy statements which map the attributes
dcashmancc39f632016-07-22 13:13:11 -070064# exposed in the public policy of previous versions to the concrete types used
65# in this policy to ensure that policy targeting attributes from public
66# policy from an older platform version continues to work.
67
dcashman2e00e632016-10-12 14:58:09 -070068# build process for device:
dcashmancc39f632016-07-22 13:13:11 -070069# 1) convert policies to CIL:
70# - private + public platform policy to CIL
71# - mapping file to CIL (should already be in CIL form)
72# - non-platform public policy to CIL
73# - non-platform public + private policy to CIL
74# 2) attributize policy
dcashmancc39f632016-07-22 13:13:11 -070075# - run script which takes non-platform public and non-platform combined
76# private + public policy and produces attributized and versioned
77# non-platform policy
78# 3) combine policy files
79# - combine mapping, platform and non-platform policy.
80# - compile output binary policy file
81
82PLAT_PUBLIC_POLICY := $(LOCAL_PATH)/public
Dan Cashman51455fe2017-05-23 14:47:16 -070083ifneq ( ,$(BOARD_PLAT_PUBLIC_SEPOLICY_DIR))
84ifneq (1, $(words $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR)))
85$(error BOARD_PLAT_PUBLIC_SEPOLICY_DIR must only contain one directory)
86else
87PLAT_PUBLIC_POLICY += $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR)
88endif
89endif
dcashmancc39f632016-07-22 13:13:11 -070090PLAT_PRIVATE_POLICY := $(LOCAL_PATH)/private
Dan Cashman51455fe2017-05-23 14:47:16 -070091ifneq ( ,$(BOARD_PLAT_PRIVATE_SEPOLICY_DIR))
92ifneq (1, $(words $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR)))
93$(error BOARD_PLAT_PRIVATE_SEPOLICY_DIR must only contain one directory)
94else
95PLAT_PRIVATE_POLICY += $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR)
96endif
97endif
Alex Klyubin55961722017-01-30 18:44:59 -080098PLAT_VENDOR_POLICY := $(LOCAL_PATH)/vendor
dcashman2e00e632016-10-12 14:58:09 -070099REQD_MASK_POLICY := $(LOCAL_PATH)/reqd_mask
100
101# TODO: move to README when doing the README update and finalizing versioning.
Sandeep Patil42f95982017-04-07 14:18:48 -0700102# BOARD_SEPOLICY_VERS must take the format "NN.m" and contain the sepolicy
103# version identifier corresponding to the sepolicy on which the non-platform
104# policy is to be based. If unspecified, this will build against the current
105# public platform policy in tree
dcashman2e00e632016-10-12 14:58:09 -0700106ifndef BOARD_SEPOLICY_VERS
107$(warning BOARD_SEPOLICY_VERS not specified, assuming current platform version)
Sandeep Patil42f95982017-04-07 14:18:48 -0700108# The default platform policy version.
Dan Cashman6f14f6b2017-04-07 16:36:23 -0700109BOARD_SEPOLICY_VERS := $(PLATFORM_SEPOLICY_VERSION)
dcashman2e00e632016-10-12 14:58:09 -0700110endif
dcashmancc39f632016-07-22 13:13:11 -0700111
Dan Cashman4d24a772017-04-12 14:28:34 -0700112
113platform_mapping_file := $(BOARD_SEPOLICY_VERS).cil
114
dcashmancc39f632016-07-22 13:13:11 -0700115###########################################################
116# Compute policy files to be used in policy build.
117# $(1): files to include
118# $(2): directories in which to find files
119###########################################################
120
121define build_policy
122$(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(2)), $(sort $(wildcard $(file)))))
123endef
William Roberts29d14682016-01-04 12:20:57 -0800124
William Roberts49693f12016-01-04 12:20:57 -0800125# Builds paths for all policy files found in BOARD_SEPOLICY_DIRS.
126# $(1): the set of policy name paths to build
Alex Klyubin55961722017-01-30 18:44:59 -0800127build_device_policy = $(call build_policy, $(1), $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS))
William Roberts49693f12016-01-04 12:20:57 -0800128
Richard Hainesc8801fe2015-12-11 10:39:19 +0000129# Add a file containing only a newline in-between each policy configuration
130# 'contexts' file. This will allow OEM policy configuration files without a
131# final newline (0x0A) to be built correctly by the m4(1) macro processor.
132# $(1): the set of contexts file names.
133# $(2): the file containing only 0x0A.
134add_nl = $(foreach entry, $(1), $(subst $(entry), $(entry) $(2), $(entry)))
135
dcashman704741a2014-07-25 19:11:52 -0700136sepolicy_build_files := security_classes \
137 initial_sids \
138 access_vectors \
139 global_macros \
Nick Kralevicha17a2662014-11-05 15:30:41 -0800140 neverallow_macros \
dcashman704741a2014-07-25 19:11:52 -0700141 mls_macros \
dcashman2e00e632016-10-12 14:58:09 -0700142 mls_decl \
dcashman704741a2014-07-25 19:11:52 -0700143 mls \
144 policy_capabilities \
145 te_macros \
146 attributes \
Jeff Vander Stoepcbaa2b72015-12-22 10:39:34 -0800147 ioctl_defines \
Jeff Vander Stoepde9b5302015-06-05 15:28:55 -0700148 ioctl_macros \
dcashman704741a2014-07-25 19:11:52 -0700149 *.te \
dcashman2e00e632016-10-12 14:58:09 -0700150 roles_decl \
dcashman704741a2014-07-25 19:11:52 -0700151 roles \
152 users \
153 initial_sid_contexts \
154 fs_use \
155 genfs_contexts \
156 port_contexts
157
Alex Klyubin7cda44f2017-03-21 14:28:53 -0700158# CIL files which contain workarounds for current limitation of human-readable
159# module policy language. These files are appended to the CIL files produced
160# from module language files.
161sepolicy_build_cil_workaround_files := technical_debt.cil
162
Dan Cashman1c040272016-12-15 15:28:44 -0800163my_target_arch := $(TARGET_ARCH)
164ifneq (,$(filter mips mips64,$(TARGET_ARCH)))
165 my_target_arch := mips
166endif
167
Jeff Vander Stoepd2053bd2017-03-15 13:37:35 -0700168intermediates := $(TARGET_OUT_INTERMEDIATES)/ETC/sepolicy_intermediates
169
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700170with_asan := false
171ifneq (,$(filter address,$(SANITIZE_TARGET)))
172 with_asan := true
173endif
174
Dan Cashman4f9a6482017-04-10 12:27:18 -0700175include $(CLEAR_VARS)
176LOCAL_MODULE := selinux_policy
177LOCAL_MODULE_TAGS := optional
178# Include SELinux policy. We do this here because different modules
179# need to be included based on the value of PRODUCT_FULL_TREBLE. This
180# type of conditional inclusion cannot be done in top-level files such
181# as build/target/product/embedded.mk.
182# This conditional inclusion closely mimics the conditional logic
183# inside init/init.cpp for loading SELinux policy from files.
184ifeq ($(PRODUCT_FULL_TREBLE),true)
185
Dan Cashman4f9a6482017-04-10 12:27:18 -0700186# Use split SELinux policy
187LOCAL_REQUIRED_MODULES += \
188 $(platform_mapping_file) \
189 nonplat_sepolicy.cil \
190 plat_sepolicy.cil \
191 plat_and_mapping_sepolicy.cil.sha256 \
192 secilc \
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -0700193 plat_sepolicy_vers.txt \
194 treble_sepolicy_tests
Dan Cashman4f9a6482017-04-10 12:27:18 -0700195
196# Include precompiled policy, unless told otherwise
197ifneq ($(PRODUCT_PRECOMPILED_SEPOLICY),false)
198LOCAL_REQUIRED_MODULES += precompiled_sepolicy precompiled_sepolicy.plat_and_mapping.sha256
199endif
Dan Cashman4f9a6482017-04-10 12:27:18 -0700200else
201# Use monolithic SELinux policy
Jeff Vander Stoep7a68c5a2017-06-08 13:24:15 -0700202LOCAL_REQUIRED_MODULES += sepolicy
Dan Cashman4f9a6482017-04-10 12:27:18 -0700203endif
Jeff Vander Stoep7a68c5a2017-06-08 13:24:15 -0700204
205LOCAL_REQUIRED_MODULES += \
206 nonplat_file_contexts \
Jeff Vander Stoep13fb5ed2017-08-22 13:29:53 -0700207 nonplat_mac_permissions.xml \
208 nonplat_property_contexts \
209 nonplat_seapp_contexts \
210 nonplat_service_contexts \
211 nonplat_hwservice_contexts \
212 plat_file_contexts \
213 plat_mac_permissions.xml \
214 plat_property_contexts \
215 plat_seapp_contexts \
216 plat_service_contexts \
217 plat_hwservice_contexts \
218 vndservice_contexts \
Jeff Vander Stoep7a68c5a2017-06-08 13:24:15 -0700219
Dan Cashman4f9a6482017-04-10 12:27:18 -0700220include $(BUILD_PHONY_PACKAGE)
221
Ying Wang02fb5f32012-01-17 17:51:09 -0800222##################################
dcashman2e00e632016-10-12 14:58:09 -0700223# reqd_policy_mask - a policy.conf file which contains only the bare minimum
224# policy necessary to use checkpolicy. This bare-minimum policy needs to be
225# present in all policy.conf files, but should not necessarily be exported as
226# part of the public policy. The rules generated by reqd_policy_mask will allow
227# the compilation of public policy and subsequent removal of CIL policy that
228# should not be exported.
229
230reqd_policy_mask.conf := $(intermediates)/reqd_policy_mask.conf
231$(reqd_policy_mask.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
232$(reqd_policy_mask.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
Dan Cashman1c040272016-12-15 15:28:44 -0800233$(reqd_policy_mask.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700234$(reqd_policy_mask.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
dcashman2e00e632016-10-12 14:58:09 -0700235$(reqd_policy_mask.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
236$(reqd_policy_mask.conf): $(call build_policy, $(sepolicy_build_files), $(REQD_MASK_POLICY))
237 @mkdir -p $(dir $@)
238 $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
239 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
240 -D target_build_variant=$(TARGET_BUILD_VARIANT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800241 -D target_with_dexpreopt=$(WITH_DEXPREOPT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800242 -D target_arch=$(PRIVATE_TGT_ARCH) \
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700243 -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \
Alex Klyubinf5446eb2017-03-23 14:27:32 -0700244 -D target_full_treble=$(PRODUCT_FULL_TREBLE) \
dcashman2e00e632016-10-12 14:58:09 -0700245 -s $^ > $@
246
Andreas Gampe3ddc78b2017-04-27 17:16:13 -0700247# b/37755687
248CHECKPOLICY_ASAN_OPTIONS := ASAN_OPTIONS=detect_leaks=0
249
dcashman2e00e632016-10-12 14:58:09 -0700250reqd_policy_mask.cil := $(intermediates)/reqd_policy_mask.cil
251$(reqd_policy_mask.cil): $(reqd_policy_mask.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy
252 @mkdir -p $(dir $@)
Andreas Gampe3ddc78b2017-04-27 17:16:13 -0700253 $(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -C -M -c \
254 $(POLICYVERS) -o $@ $<
dcashman2e00e632016-10-12 14:58:09 -0700255
dcashman1faa6442016-11-28 07:20:28 -0800256reqd_policy_mask.conf :=
257
258##################################
dcashman2e00e632016-10-12 14:58:09 -0700259# plat_pub_policy - policy that will be exported to be a part of non-platform
260# policy corresponding to this platform version. This is a limited subset of
261# policy that would not compile in checkpolicy on its own. To get around this
262# limitation, add only the required files from private policy, which will
263# generate CIL policy that will then be filtered out by the reqd_policy_mask.
264plat_pub_policy.conf := $(intermediates)/plat_pub_policy.conf
265$(plat_pub_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
266$(plat_pub_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
Dan Cashman1c040272016-12-15 15:28:44 -0800267$(plat_pub_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700268$(plat_pub_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
dcashman2e00e632016-10-12 14:58:09 -0700269$(plat_pub_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
270$(plat_pub_policy.conf): $(call build_policy, $(sepolicy_build_files), \
Dan Cashman6bf50e52017-04-12 11:12:17 -0700271$(PLAT_PUBLIC_POLICY) $(REQD_MASK_POLICY))
dcashman2e00e632016-10-12 14:58:09 -0700272 @mkdir -p $(dir $@)
273 $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
274 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
275 -D target_build_variant=$(TARGET_BUILD_VARIANT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800276 -D target_with_dexpreopt=$(WITH_DEXPREOPT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800277 -D target_arch=$(PRIVATE_TGT_ARCH) \
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700278 -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \
Alex Klyubinf5446eb2017-03-23 14:27:32 -0700279 -D target_full_treble=$(PRODUCT_FULL_TREBLE) \
dcashman2e00e632016-10-12 14:58:09 -0700280 -s $^ > $@
281
282plat_pub_policy.cil := $(intermediates)/plat_pub_policy.cil
dcashman1faa6442016-11-28 07:20:28 -0800283$(plat_pub_policy.cil): PRIVATE_POL_CONF := $(plat_pub_policy.conf)
284$(plat_pub_policy.cil): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil)
285$(plat_pub_policy.cil): $(HOST_OUT_EXECUTABLES)/checkpolicy $(plat_pub_policy.conf) $(reqd_policy_mask.cil)
dcashman2e00e632016-10-12 14:58:09 -0700286 @mkdir -p $(dir $@)
Andreas Gampe3ddc78b2017-04-27 17:16:13 -0700287 $(hide) $(CHECKPOLICY_ASAN_OPTIONS) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF)
dcashman1faa6442016-11-28 07:20:28 -0800288 $(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@
dcashman2e00e632016-10-12 14:58:09 -0700289
dcashman1faa6442016-11-28 07:20:28 -0800290plat_pub_policy.conf :=
Dan Cashman1c040272016-12-15 15:28:44 -0800291
dcashman1faa6442016-11-28 07:20:28 -0800292##################################
293include $(CLEAR_VARS)
294
295LOCAL_MODULE := sectxfile_nl
296LOCAL_MODULE_CLASS := ETC
297LOCAL_MODULE_TAGS := optional
298
299# Create a file containing newline only to add between context config files
300include $(BUILD_SYSTEM)/base_rules.mk
301$(LOCAL_BUILT_MODULE):
dcashman2e00e632016-10-12 14:58:09 -0700302 @mkdir -p $(dir $@)
dcashman1faa6442016-11-28 07:20:28 -0800303 $(hide) echo > $@
304
305built_nl := $(LOCAL_BUILT_MODULE)
306
307#################################
308include $(CLEAR_VARS)
309
310LOCAL_MODULE := plat_sepolicy.cil
311LOCAL_MODULE_CLASS := ETC
312LOCAL_MODULE_TAGS := optional
Alex Klyubin052b0bb2017-03-02 12:39:25 -0800313LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
dcashman1faa6442016-11-28 07:20:28 -0800314
315include $(BUILD_SYSTEM)/base_rules.mk
dcashman2e00e632016-10-12 14:58:09 -0700316
317# plat_policy.conf - A combination of the private and public platform policy
318# which will ship with the device. The platform will always reflect the most
319# recent platform version and is not currently being attributized.
320plat_policy.conf := $(intermediates)/plat_policy.conf
321$(plat_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
322$(plat_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
Dan Cashman1c040272016-12-15 15:28:44 -0800323$(plat_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700324$(plat_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
dcashman2e00e632016-10-12 14:58:09 -0700325$(plat_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
326$(plat_policy.conf): $(call build_policy, $(sepolicy_build_files), \
dcashmancc39f632016-07-22 13:13:11 -0700327$(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
328 @mkdir -p $(dir $@)
329 $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
330 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
331 -D target_build_variant=$(TARGET_BUILD_VARIANT) \
Jorge Lucangeli Obes84db84e2016-11-18 08:42:35 -0500332 -D target_with_dexpreopt=$(WITH_DEXPREOPT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800333 -D target_arch=$(PRIVATE_TGT_ARCH) \
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700334 -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \
Alex Klyubinf5446eb2017-03-23 14:27:32 -0700335 -D target_full_treble=$(PRODUCT_FULL_TREBLE) \
dcashmancc39f632016-07-22 13:13:11 -0700336 -s $^ > $@
337 $(hide) sed '/dontaudit/d' $@ > $@.dontaudit
338
Jeff Vander Stoepb8787692017-04-21 15:57:07 -0700339$(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CIL_FILES := \
Alex Klyubin7cda44f2017-03-21 14:28:53 -0700340 $(call build_policy, $(sepolicy_build_cil_workaround_files), $(PLAT_PRIVATE_POLICY))
Jeff Vander Stoepb8787692017-04-21 15:57:07 -0700341$(LOCAL_BUILT_MODULE): $(plat_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy \
342 $(HOST_OUT_EXECUTABLES)/secilc \
Alex Klyubin7cda44f2017-03-21 14:28:53 -0700343 $(call build_policy, $(sepolicy_build_cil_workaround_files), $(PLAT_PRIVATE_POLICY))
dcashman2e00e632016-10-12 14:58:09 -0700344 @mkdir -p $(dir $@)
Andreas Gampe3ddc78b2017-04-27 17:16:13 -0700345 $(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c \
346 $(POLICYVERS) -o $@ $<
Alex Klyubin7cda44f2017-03-21 14:28:53 -0700347 $(hide) cat $(PRIVATE_ADDITIONAL_CIL_FILES) >> $@
Sandeep Patilcfb6f352017-06-14 09:57:43 -0700348 $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -G -c $(POLICYVERS) $@ -o /dev/null -f /dev/null
dcashman1faa6442016-11-28 07:20:28 -0800349
Alex Klyubin8f7173b2017-02-25 14:47:53 -0800350built_plat_cil := $(LOCAL_BUILT_MODULE)
dcashman1faa6442016-11-28 07:20:28 -0800351plat_policy.conf :=
352
353#################################
354include $(CLEAR_VARS)
355
Dan Cashman4f9a6482017-04-10 12:27:18 -0700356LOCAL_MODULE := plat_sepolicy_vers.txt
dcashman1faa6442016-11-28 07:20:28 -0800357LOCAL_MODULE_CLASS := ETC
358LOCAL_MODULE_TAGS := optional
Dan Cashman4f9a6482017-04-10 12:27:18 -0700359LOCAL_PROPRIETARY_MODULE := true
360LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
361
362include $(BUILD_SYSTEM)/base_rules.mk
363
364$(LOCAL_BUILT_MODULE) : PRIVATE_PLAT_SEPOL_VERS := $(BOARD_SEPOLICY_VERS)
365$(LOCAL_BUILT_MODULE) :
366 mkdir -p $(dir $@)
367 echo $(PRIVATE_PLAT_SEPOL_VERS) > $@
368
369#################################
370include $(CLEAR_VARS)
371
372LOCAL_MODULE := $(platform_mapping_file)
373LOCAL_MODULE_CLASS := ETC
374LOCAL_MODULE_TAGS := optional
375LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux/mapping
dcashman1faa6442016-11-28 07:20:28 -0800376
377include $(BUILD_SYSTEM)/base_rules.mk
378
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700379current_mapping.cil := $(intermediates)/mapping/$(PLATFORM_SEPOLICY_VERSION).cil
380ifeq ($(BOARD_SEPOLICY_VERS), $(PLATFORM_SEPOLICY_VERSION))
dcashman1faa6442016-11-28 07:20:28 -0800381# auto-generate the mapping file for current platform policy, since it needs to
382# track platform policy development
Dan Cashman6f14f6b2017-04-07 16:36:23 -0700383$(current_mapping.cil) : PRIVATE_VERS := $(PLATFORM_SEPOLICY_VERSION)
dcashman1faa6442016-11-28 07:20:28 -0800384$(current_mapping.cil) : $(plat_pub_policy.cil) $(HOST_OUT_EXECUTABLES)/version_policy
385 @mkdir -p $(dir $@)
386 $(hide) $(HOST_OUT_EXECUTABLES)/version_policy -b $< -m -n $(PRIVATE_VERS) -o $@
387
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700388else # ifeq ($(BOARD_SEPOLICY_VERS), $(PLATFORM_SEPOLICY_VERSION))
389prebuilt_mapping_files := $(wildcard $(addsuffix /mapping/$(BOARD_SEPOLICY_VERS).cil, $(PLAT_PRIVATE_POLICY)))
390$(current_mapping.cil) : $(prebuilt_mapping_files)
391 @mkdir -p $(dir $@)
392 cat $^ > $@
Sandeep Patil42f95982017-04-07 14:18:48 -0700393
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700394prebuilt_mapping_files :=
dcashman1faa6442016-11-28 07:20:28 -0800395endif
396
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700397$(LOCAL_BUILT_MODULE): $(current_mapping.cil) $(ACP)
Jeff Vander Stoepb8787692017-04-21 15:57:07 -0700398 $(hide) $(ACP) $< $@
dcashman1faa6442016-11-28 07:20:28 -0800399
Alex Klyubin8f7173b2017-02-25 14:47:53 -0800400built_mapping_cil := $(LOCAL_BUILT_MODULE)
dcashman1faa6442016-11-28 07:20:28 -0800401current_mapping.cil :=
402
403#################################
404include $(CLEAR_VARS)
405
Dan Cashman0e9c47c2017-04-04 14:27:41 -0700406LOCAL_MODULE := plat_and_mapping_sepolicy.cil.sha256
407LOCAL_MODULE_CLASS := ETC
408LOCAL_MODULE_TAGS := optional
409LOCAL_MODULE_PATH = $(TARGET_OUT)/etc/selinux
410
411include $(BUILD_SYSTEM)/base_rules.mk
412
413$(LOCAL_BUILT_MODULE): $(built_plat_cil) $(built_mapping_cil)
414 cat $^ | sha256sum | cut -d' ' -f1 > $@
415
416#################################
417include $(CLEAR_VARS)
418
dcashman1faa6442016-11-28 07:20:28 -0800419LOCAL_MODULE := nonplat_sepolicy.cil
420LOCAL_MODULE_CLASS := ETC
421LOCAL_MODULE_TAGS := optional
Alex Klyubin052b0bb2017-03-02 12:39:25 -0800422LOCAL_PROPRIETARY_MODULE := true
423LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
dcashman1faa6442016-11-28 07:20:28 -0800424
425include $(BUILD_SYSTEM)/base_rules.mk
426
Alex Klyubin55961722017-01-30 18:44:59 -0800427# nonplat_policy.conf - A combination of the non-platform private, vendor and
428# the exported platform policy associated with the version the non-platform
429# policy targets. This needs attributization and to be combined with the
dcashman2e00e632016-10-12 14:58:09 -0700430# platform-provided policy. Like plat_pub_policy.conf, this needs to make use
431# of the reqd_policy_mask files from private policy in order to use checkpolicy.
432nonplat_policy.conf := $(intermediates)/nonplat_policy.conf
433$(nonplat_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
434$(nonplat_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
Dan Cashman1c040272016-12-15 15:28:44 -0800435$(nonplat_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700436$(nonplat_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
dcashman2e00e632016-10-12 14:58:09 -0700437$(nonplat_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
438$(nonplat_policy.conf): $(call build_policy, $(sepolicy_build_files), \
Dan Cashman6bf50e52017-04-12 11:12:17 -0700439$(PLAT_PUBLIC_POLICY) $(REQD_MASK_POLICY) $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS))
Ying Wang02fb5f32012-01-17 17:51:09 -0800440 @mkdir -p $(dir $@)
William Robertsd2185582015-07-16 11:28:02 -0700441 $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
442 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
Nick Kralevich623975f2014-01-11 01:31:03 -0800443 -D target_build_variant=$(TARGET_BUILD_VARIANT) \
Jorge Lucangeli Obes84db84e2016-11-18 08:42:35 -0500444 -D target_with_dexpreopt=$(WITH_DEXPREOPT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800445 -D target_arch=$(PRIVATE_TGT_ARCH) \
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700446 -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \
Alex Klyubinf5446eb2017-03-23 14:27:32 -0700447 -D target_full_treble=$(PRODUCT_FULL_TREBLE) \
Nick Kralevich623975f2014-01-11 01:31:03 -0800448 -s $^ > $@
Robert Craig65d4f442013-03-27 06:30:25 -0400449 $(hide) sed '/dontaudit/d' $@ > $@.dontaudit
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500450
dcashman1faa6442016-11-28 07:20:28 -0800451nonplat_policy_raw := $(intermediates)/nonplat_policy_raw.cil
452$(nonplat_policy_raw): PRIVATE_POL_CONF := $(nonplat_policy.conf)
453$(nonplat_policy_raw): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil)
454$(nonplat_policy_raw): $(HOST_OUT_EXECUTABLES)/checkpolicy $(nonplat_policy.conf) \
455$(reqd_policy_mask.cil)
Ying Wang02fb5f32012-01-17 17:51:09 -0800456 @mkdir -p $(dir $@)
Andreas Gampe3ddc78b2017-04-27 17:16:13 -0700457 $(hide) $(CHECKPOLICY_ASAN_OPTIONS) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF)
dcashman1faa6442016-11-28 07:20:28 -0800458 $(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@
dcashman2e00e632016-10-12 14:58:09 -0700459
Jeff Vander Stoepb8787692017-04-21 15:57:07 -0700460$(LOCAL_BUILT_MODULE) : PRIVATE_VERS := $(BOARD_SEPOLICY_VERS)
461$(LOCAL_BUILT_MODULE) : PRIVATE_TGT_POL := $(nonplat_policy_raw)
462$(LOCAL_BUILT_MODULE) : PRIVATE_DEP_CIL_FILES := $(built_plat_cil) $(built_mapping_cil)
463$(LOCAL_BUILT_MODULE) : $(plat_pub_policy.cil) $(nonplat_policy_raw) \
464$(HOST_OUT_EXECUTABLES)/version_policy $(HOST_OUT_EXECUTABLES)/secilc \
Jeff Vander Stoep5edd96d2017-04-24 16:46:40 -0700465$(built_plat_cil) $(built_mapping_cil)
dcashman2e00e632016-10-12 14:58:09 -0700466 @mkdir -p $(dir $@)
467 $(HOST_OUT_EXECUTABLES)/version_policy -b $< -t $(PRIVATE_TGT_POL) -n $(PRIVATE_VERS) -o $@
Jeff Vander Stoepb8787692017-04-21 15:57:07 -0700468 $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -G -N -c $(POLICYVERS) \
Alex Klyubin8f7173b2017-02-25 14:47:53 -0800469 $(PRIVATE_DEP_CIL_FILES) $@ -o /dev/null -f /dev/null
dcashman2e00e632016-10-12 14:58:09 -0700470
Alex Klyubin193dccd2017-03-07 14:05:57 -0800471built_nonplat_cil := $(LOCAL_BUILT_MODULE)
dcashman1faa6442016-11-28 07:20:28 -0800472nonplat_policy.conf :=
473nonplat_policy_raw :=
474
475#################################
476include $(CLEAR_VARS)
Alex Klyubin193dccd2017-03-07 14:05:57 -0800477
478LOCAL_MODULE := precompiled_sepolicy
479LOCAL_MODULE_CLASS := ETC
480LOCAL_MODULE_TAGS := optional
481LOCAL_PROPRIETARY_MODULE := true
482LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
483
484include $(BUILD_SYSTEM)/base_rules.mk
485
486$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := \
487$(built_plat_cil) $(built_mapping_cil) $(built_nonplat_cil)
488$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc \
489$(built_plat_cil) $(built_mapping_cil) $(built_nonplat_cil)
Jeff Vander Stoepac171b42017-04-12 17:01:54 -0700490 $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -G -c $(POLICYVERS) \
Alex Klyubin193dccd2017-03-07 14:05:57 -0800491 $(PRIVATE_CIL_FILES) -o $@ -f /dev/null
492
493built_precompiled_sepolicy := $(LOCAL_BUILT_MODULE)
494
495#################################
Dan Cashman0e9c47c2017-04-04 14:27:41 -0700496# SHA-256 digest of the plat_sepolicy.cil and mapping_sepolicy.cil files against
497# which precompiled_policy was built.
Alex Klyubin193dccd2017-03-07 14:05:57 -0800498#################################
499include $(CLEAR_VARS)
Dan Cashman0e9c47c2017-04-04 14:27:41 -0700500LOCAL_MODULE := precompiled_sepolicy.plat_and_mapping.sha256
Alex Klyubin193dccd2017-03-07 14:05:57 -0800501LOCAL_MODULE_CLASS := ETC
502LOCAL_MODULE_TAGS := optional
503LOCAL_PROPRIETARY_MODULE := true
504LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
505
506include $(BUILD_SYSTEM)/base_rules.mk
507
Dan Cashman0e9c47c2017-04-04 14:27:41 -0700508$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(built_plat_cil) $(built_mapping_cil)
509$(LOCAL_BUILT_MODULE): $(built_precompiled_sepolicy) $(built_plat_cil) $(built_mapping_cil)
510 cat $(PRIVATE_CIL_FILES) | sha256sum | cut -d' ' -f1 > $@
Alex Klyubin193dccd2017-03-07 14:05:57 -0800511
512#################################
513include $(CLEAR_VARS)
Dan Cashman1c040272016-12-15 15:28:44 -0800514# build this target so that we can still perform neverallow checks
dcashman1faa6442016-11-28 07:20:28 -0800515
516LOCAL_MODULE := sepolicy
517LOCAL_MODULE_CLASS := ETC
518LOCAL_MODULE_TAGS := optional
Daniel Cashman65d01342016-12-17 00:53:26 +0000519LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
dcashman2e00e632016-10-12 14:58:09 -0700520
dcashman1faa6442016-11-28 07:20:28 -0800521include $(BUILD_SYSTEM)/base_rules.mk
522
dcashman2e00e632016-10-12 14:58:09 -0700523all_cil_files := \
Jeff Vander Stoepb8787692017-04-21 15:57:07 -0700524 $(built_plat_cil) \
525 $(built_mapping_cil) \
526 $(built_nonplat_cil)
dcashman2e00e632016-10-12 14:58:09 -0700527
528$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(all_cil_files)
529$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $(all_cil_files)
530 @mkdir -p $(dir $@)
Jeff Vander Stoep748cae82017-04-13 14:16:29 -0700531 $(hide) $< -M true -G -c $(POLICYVERS) $(PRIVATE_CIL_FILES) -o $@.tmp -f /dev/null
Nick Kralevichbca98ef2016-02-26 20:06:52 -0800532 $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains
533 $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \
534 echo "==========" 1>&2; \
535 echo "ERROR: permissive domains not allowed in user builds" 1>&2; \
536 echo "List of invalid domains:" 1>&2; \
537 cat $@.permissivedomains 1>&2; \
538 exit 1; \
539 fi
540 $(hide) mv $@.tmp $@
Ying Wang02fb5f32012-01-17 17:51:09 -0800541
Ying Wangd8b122c2012-10-25 19:01:31 -0700542built_sepolicy := $(LOCAL_BUILT_MODULE)
dcashman2e00e632016-10-12 14:58:09 -0700543all_cil_files :=
Stephen Smalley01a58af2012-10-02 12:46:37 -0400544
Alex Klyubin84aa7422017-03-10 09:36:07 -0800545#################################
546include $(CLEAR_VARS)
547
548# keep concrete sepolicy for neverallow checks
549
550LOCAL_MODULE := sepolicy.recovery
Alex Klyubinec78c372017-03-10 12:44:16 -0800551LOCAL_MODULE_STEM := sepolicy
Alex Klyubin84aa7422017-03-10 09:36:07 -0800552LOCAL_MODULE_CLASS := ETC
553LOCAL_MODULE_TAGS := optional
Alex Klyubinec78c372017-03-10 12:44:16 -0800554LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
Alex Klyubin84aa7422017-03-10 09:36:07 -0800555
556include $(BUILD_SYSTEM)/base_rules.mk
557
Dan Cashmanc8d45352017-04-11 07:38:48 -0700558sepolicy.recovery.conf := $(intermediates)/sepolicy.recovery.conf
559$(sepolicy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
560$(sepolicy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
561$(sepolicy.recovery.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
562$(sepolicy.recovery.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
563$(sepolicy.recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
564$(sepolicy.recovery.conf): $(call build_policy, $(sepolicy_build_files), \
565 $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY) \
566 $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS))
Dan Cashman1c040272016-12-15 15:28:44 -0800567 @mkdir -p $(dir $@)
568 $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
569 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
570 -D target_build_variant=$(TARGET_BUILD_VARIANT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800571 -D target_with_dexpreopt=$(WITH_DEXPREOPT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800572 -D target_arch=$(PRIVATE_TGT_ARCH) \
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700573 -D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \
Dan Cashman1c040272016-12-15 15:28:44 -0800574 -D target_recovery=true \
575 -s $^ > $@
576 $(hide) sed '/dontaudit/d' $@ > $@.dontaudit
577
Dan Cashmanc8d45352017-04-11 07:38:48 -0700578$(LOCAL_BUILT_MODULE): $(sepolicy.recovery.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy \
579 $(HOST_OUT_EXECUTABLES)/sepolicy-analyze
Dan Cashman1c040272016-12-15 15:28:44 -0800580 @mkdir -p $(dir $@)
Andreas Gampe3ddc78b2017-04-27 17:16:13 -0700581 $(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c \
582 $(POLICYVERS) -o $@.tmp $<
Nick Kralevichbca98ef2016-02-26 20:06:52 -0800583 $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains
584 $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \
585 echo "==========" 1>&2; \
586 echo "ERROR: permissive domains not allowed in user builds" 1>&2; \
587 echo "List of invalid domains:" 1>&2; \
588 cat $@.permissivedomains 1>&2; \
589 exit 1; \
590 fi
591 $(hide) mv $@.tmp $@
Stephen Smalleye60723a2014-05-29 16:40:15 -0400592
Dan Cashmanc8d45352017-04-11 07:38:48 -0700593sepolicy.recovery.conf :=
Stephen Smalleye60723a2014-05-29 16:40:15 -0400594
dcashman704741a2014-07-25 19:11:52 -0700595##################################
Alex Klyubin446279a2017-04-06 14:45:50 -0700596# SELinux policy embedded into CTS.
597# CTS checks neverallow rules of this policy against the policy of the device under test.
598##################################
dcashman704741a2014-07-25 19:11:52 -0700599include $(CLEAR_VARS)
600
601LOCAL_MODULE := general_sepolicy.conf
602LOCAL_MODULE_CLASS := ETC
603LOCAL_MODULE_TAGS := tests
604
605include $(BUILD_SYSTEM)/base_rules.mk
606
dcashman704741a2014-07-25 19:11:52 -0700607$(LOCAL_BUILT_MODULE): PRIVATE_MLS_SENS := $(MLS_SENS)
608$(LOCAL_BUILT_MODULE): PRIVATE_MLS_CATS := $(MLS_CATS)
Dan Cashman1c040272016-12-15 15:28:44 -0800609$(LOCAL_BUILT_MODULE): PRIVATE_TGT_ARCH := $(my_target_arch)
dcashmancc39f632016-07-22 13:13:11 -0700610$(LOCAL_BUILT_MODULE): $(call build_policy, $(sepolicy_build_files), \
611$(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
dcashman704741a2014-07-25 19:11:52 -0700612 mkdir -p $(dir $@)
613 $(hide) m4 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
614 -D target_build_variant=user \
Jorge Lucangeli Obes84db84e2016-11-18 08:42:35 -0500615 -D target_with_dexpreopt=$(WITH_DEXPREOPT) \
Dan Cashman1c040272016-12-15 15:28:44 -0800616 -D target_arch=$(PRIVATE_TGT_ARCH) \
Jeff Vander Stoep74434842017-03-13 12:22:15 -0700617 -D target_with_asan=false \
Alex Klyubin446279a2017-04-06 14:45:50 -0700618 -D target_full_treble=cts \
dcashman704741a2014-07-25 19:11:52 -0700619 -s $^ > $@
620 $(hide) sed '/dontaudit/d' $@ > $@.dontaudit
621
William Robertsb8769932015-06-29 16:31:23 -0700622##################################
dcashmand225b692016-12-12 09:29:04 -0800623# TODO - remove this. Keep around until we get the filesystem creation stuff taken care of.
624#
William Robertsb8769932015-06-29 16:31:23 -0700625include $(CLEAR_VARS)
626
Richard Hainesc2d01912015-08-06 17:43:52 +0100627LOCAL_MODULE := file_contexts.bin
Ying Wang02fb5f32012-01-17 17:51:09 -0800628LOCAL_MODULE_CLASS := ETC
629LOCAL_MODULE_TAGS := optional
630LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
631
Stephen Smalley5b340be2012-03-06 11:12:41 -0500632include $(BUILD_SYSTEM)/base_rules.mk
Ying Wang02fb5f32012-01-17 17:51:09 -0800633
William Roberts49693f12016-01-04 12:20:57 -0800634# The file_contexts.bin is built in the following way:
635# 1. Collect all file_contexts files in THIS repository and process them with
636# m4 into a tmp file called file_contexts.local.tmp.
637# 2. Collect all device specific file_contexts files and process them with m4
638# into a tmp file called file_contexts.device.tmp.
639# 3. Run checkfc -e (allow no device fc entries ie empty) and fc_sort on
640# file_contexts.device.tmp and output to file_contexts.device.sorted.tmp.
641# 4. Concatenate file_contexts.local.tmp and file_contexts.device.tmp into
642# file_contexts.concat.tmp.
643# 5. Run checkfc and sefcontext_compile on file_contexts.concat.tmp to produce
644# file_contexts.bin.
645#
646# Note: That a newline file is placed between each file_context file found to
647# ensure a proper build when an fc file is missing an ending newline.
William Roberts29d14682016-01-04 12:20:57 -0800648
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700649local_fc_files := $(call build_policy, file_contexts, $(PLAT_PRIVATE_POLICY))
650
William Roberts49693f12016-01-04 12:20:57 -0800651ifneq ($(filter address,$(SANITIZE_TARGET)),)
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700652 local_fc_files := $(local_fc_files) $(wildcard $(addsuffix /file_contexts_asan, $(PLAT_PRIVATE_POLICY)))
William Roberts49693f12016-01-04 12:20:57 -0800653endif
654local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl))
655
656file_contexts.local.tmp := $(intermediates)/file_contexts.local.tmp
657$(file_contexts.local.tmp): $(local_fcfiles_with_nl)
Stephen Smalley5b340be2012-03-06 11:12:41 -0500658 @mkdir -p $(dir $@)
William Roberts49693f12016-01-04 12:20:57 -0800659 $(hide) m4 -s $^ > $@
660
661device_fc_files := $(call build_device_policy, file_contexts)
662device_fcfiles_with_nl := $(call add_nl, $(device_fc_files), $(built_nl))
663
664file_contexts.device.tmp := $(intermediates)/file_contexts.device.tmp
665$(file_contexts.device.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
666$(file_contexts.device.tmp): $(device_fcfiles_with_nl)
667 @mkdir -p $(dir $@)
668 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
669
670file_contexts.device.sorted.tmp := $(intermediates)/file_contexts.device.sorted.tmp
671$(file_contexts.device.sorted.tmp): PRIVATE_SEPOLICY := $(built_sepolicy)
672$(file_contexts.device.sorted.tmp): $(file_contexts.device.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/fc_sort $(HOST_OUT_EXECUTABLES)/checkfc
673 @mkdir -p $(dir $@)
dcashman07791552016-12-07 11:27:47 -0800674 $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e $(PRIVATE_SEPOLICY) $<
William Roberts49693f12016-01-04 12:20:57 -0800675 $(hide) $(HOST_OUT_EXECUTABLES)/fc_sort $< $@
676
677file_contexts.concat.tmp := $(intermediates)/file_contexts.concat.tmp
678$(file_contexts.concat.tmp): $(file_contexts.local.tmp) $(file_contexts.device.sorted.tmp)
679 @mkdir -p $(dir $@)
680 $(hide) m4 -s $^ > $@
Stephen Smalley5b340be2012-03-06 11:12:41 -0500681
William Roberts3746a0a2015-09-25 10:18:44 -0700682$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
William Roberts49693f12016-01-04 12:20:57 -0800683$(LOCAL_BUILT_MODULE): $(file_contexts.concat.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc
Richard Hainesc2d01912015-08-06 17:43:52 +0100684 @mkdir -p $(dir $@)
dcashman07791552016-12-07 11:27:47 -0800685 $(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $<
Richard Hainesc2d01912015-08-06 17:43:52 +0100686 $(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $<
687
Robert Craig8b7545b2014-03-20 09:35:08 -0400688built_fc := $(LOCAL_BUILT_MODULE)
William Roberts49693f12016-01-04 12:20:57 -0800689local_fc_files :=
690local_fcfiles_with_nl :=
691device_fc_files :=
692device_fcfiles_with_nl :=
693file_contexts.concat.tmp :=
694file_contexts.device.sorted.tmp :=
695file_contexts.device.tmp :=
696file_contexts.local.tmp :=
William Roberts171a0622012-08-16 10:55:05 -0700697
Ying Wang02fb5f32012-01-17 17:51:09 -0800698##################################
699include $(CLEAR_VARS)
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400700
dcashmand225b692016-12-12 09:29:04 -0800701LOCAL_MODULE := plat_file_contexts
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400702LOCAL_MODULE_CLASS := ETC
dcashmand225b692016-12-12 09:29:04 -0800703LOCAL_MODULE_TAGS := optional
Jeff Vander Stoep7a68c5a2017-06-08 13:24:15 -0700704ifeq ($(PRODUCT_FULL_TREBLE),true)
Jeff Vander Stoep0cb417a2017-03-08 14:12:54 -0800705LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
Jeff Vander Stoep7a68c5a2017-06-08 13:24:15 -0700706else
707LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
708endif
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400709
710include $(BUILD_SYSTEM)/base_rules.mk
711
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700712local_fc_files := $(call build_policy, file_contexts, $(PLAT_PRIVATE_POLICY))
dcashmand225b692016-12-12 09:29:04 -0800713ifneq ($(filter address,$(SANITIZE_TARGET)),)
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700714 local_fc_files += $(wildcard $(addsuffix /file_contexts_asan, $(PLAT_PRIVATE_POLICY)))
dcashmand225b692016-12-12 09:29:04 -0800715endif
Alex Klyubine4665d72017-01-19 19:58:34 -0800716local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl))
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400717
Alex Klyubine4665d72017-01-19 19:58:34 -0800718$(LOCAL_BUILT_MODULE): PRIVATE_FC_FILES := $(local_fcfiles_with_nl)
dcashmand225b692016-12-12 09:29:04 -0800719$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
Alex Klyubine4665d72017-01-19 19:58:34 -0800720$(LOCAL_BUILT_MODULE): PRIVATE_FC_SORT := $(HOST_OUT_EXECUTABLES)/fc_sort
721$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/checkfc $(HOST_OUT_EXECUTABLES)/fc_sort \
722$(local_fcfiles_with_nl) $(built_sepolicy)
Richard Hainesc2d01912015-08-06 17:43:52 +0100723 @mkdir -p $(dir $@)
Alex Klyubine4665d72017-01-19 19:58:34 -0800724 $(hide) m4 -s $(PRIVATE_FC_FILES) > $@.tmp
725 $(hide) $< $(PRIVATE_SEPOLICY) $@.tmp
726 $(hide) $(PRIVATE_FC_SORT) $@.tmp $@
Richard Hainesc2d01912015-08-06 17:43:52 +0100727
dcashmand225b692016-12-12 09:29:04 -0800728built_plat_fc := $(LOCAL_BUILT_MODULE)
729local_fc_files :=
Alex Klyubine4665d72017-01-19 19:58:34 -0800730local_fcfiles_with_nl :=
dcashmand225b692016-12-12 09:29:04 -0800731
732##################################
733include $(CLEAR_VARS)
734
735LOCAL_MODULE := nonplat_file_contexts
736LOCAL_MODULE_CLASS := ETC
737LOCAL_MODULE_TAGS := optional
Jeff Vander Stoep7a68c5a2017-06-08 13:24:15 -0700738ifeq ($(PRODUCT_FULL_TREBLE),true)
Jeff Vander Stoep0cb417a2017-03-08 14:12:54 -0800739LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
Jeff Vander Stoep7a68c5a2017-06-08 13:24:15 -0700740else
741LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
742endif
dcashmand225b692016-12-12 09:29:04 -0800743
744include $(BUILD_SYSTEM)/base_rules.mk
745
746nonplat_fc_files := $(call build_device_policy, file_contexts)
747nonplat_fcfiles_with_nl := $(call add_nl, $(nonplat_fc_files), $(built_nl))
748
749$(LOCAL_BUILT_MODULE): PRIVATE_FC_FILES := $(nonplat_fcfiles_with_nl)
750$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
751$(LOCAL_BUILT_MODULE): PRIVATE_FC_SORT := $(HOST_OUT_EXECUTABLES)/fc_sort
752$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/checkfc $(HOST_OUT_EXECUTABLES)/fc_sort \
Alex Klyubine4665d72017-01-19 19:58:34 -0800753$(nonplat_fcfiles_with_nl) $(built_sepolicy)
dcashmand225b692016-12-12 09:29:04 -0800754 @mkdir -p $(dir $@)
755 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_FC_FILES) > $@.tmp
756 $(hide) $< $(PRIVATE_SEPOLICY) $@.tmp
757 $(hide) $(PRIVATE_FC_SORT) $@.tmp $@
758
759built_nonplat_fc := $(LOCAL_BUILT_MODULE)
760nonplat_fc_files :=
761nonplat_fcfiles_with_nl :=
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400762
763##################################
764include $(CLEAR_VARS)
Jeff Vander Stoepb236eb62017-06-13 08:24:17 -0700765
766LOCAL_MODULE := plat_file_contexts.recovery
767LOCAL_MODULE_STEM := plat_file_contexts
768LOCAL_MODULE_CLASS := ETC
769LOCAL_MODULE_TAGS := optional
770LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
771
772include $(BUILD_SYSTEM)/base_rules.mk
773
774$(LOCAL_BUILT_MODULE): $(built_plat_fc)
775 $(hide) cp -f $< $@
776
777##################################
778include $(CLEAR_VARS)
779LOCAL_MODULE := nonplat_file_contexts.recovery
780LOCAL_MODULE_STEM := nonplat_file_contexts
781LOCAL_MODULE_CLASS := ETC
782LOCAL_MODULE_TAGS := optional
783LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
784
785include $(BUILD_SYSTEM)/base_rules.mk
786
787$(LOCAL_BUILT_MODULE): $(built_nonplat_fc)
788 $(hide) cp -f $< $@
789
790##################################
791include $(CLEAR_VARS)
Dan Cashman9c038072016-12-22 07:15:18 -0800792LOCAL_MODULE := plat_seapp_contexts
Ying Wang02fb5f32012-01-17 17:51:09 -0800793LOCAL_MODULE_CLASS := ETC
794LOCAL_MODULE_TAGS := optional
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800795ifeq ($(PRODUCT_FULL_TREBLE),true)
796LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
797else
Ying Wang02fb5f32012-01-17 17:51:09 -0800798LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800799endif
Ying Wang02fb5f32012-01-17 17:51:09 -0800800
William Roberts171a0622012-08-16 10:55:05 -0700801include $(BUILD_SYSTEM)/base_rules.mk
Ying Wang02fb5f32012-01-17 17:51:09 -0800802
Dan Cashman9c038072016-12-22 07:15:18 -0800803plat_sc_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY))
William Roberts171a0622012-08-16 10:55:05 -0700804
Ying Wangd8b122c2012-10-25 19:01:31 -0700805$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
Dan Cashman9c038072016-12-22 07:15:18 -0800806$(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(plat_sc_files)
807$(LOCAL_BUILT_MODULE): $(built_sepolicy) $(plat_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp
William Robertsf0e0a942012-08-27 15:41:15 -0700808 @mkdir -p $(dir $@)
William Roberts99fe8df2015-06-30 13:53:51 -0700809 $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES)
Ying Wang02fb5f32012-01-17 17:51:09 -0800810
Dan Cashman9c038072016-12-22 07:15:18 -0800811built_plat_sc := $(LOCAL_BUILT_MODULE)
812plat_sc_files :=
Robert Craig8b7545b2014-03-20 09:35:08 -0400813
Ying Wang02fb5f32012-01-17 17:51:09 -0800814##################################
Stephen Smalley124720a2012-04-04 10:11:16 -0400815include $(CLEAR_VARS)
Dan Cashman9c038072016-12-22 07:15:18 -0800816LOCAL_MODULE := nonplat_seapp_contexts
Stephen Smalley37712872015-03-12 15:46:36 -0400817LOCAL_MODULE_CLASS := ETC
Dan Cashman9c038072016-12-22 07:15:18 -0800818LOCAL_MODULE_TAGS := optional
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800819ifeq ($(PRODUCT_FULL_TREBLE),true)
820LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
821else
Dan Cashman9c038072016-12-22 07:15:18 -0800822LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800823endif
Stephen Smalley37712872015-03-12 15:46:36 -0400824
825include $(BUILD_SYSTEM)/base_rules.mk
826
Alex Klyubin55961722017-01-30 18:44:59 -0800827nonplat_sc_files := $(call build_policy, seapp_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
Dan Cashman1b0a71f2017-05-08 14:26:52 -0700828plat_sc_neverallow_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY))
Stephen Smalley37712872015-03-12 15:46:36 -0400829
Dan Cashman9c038072016-12-22 07:15:18 -0800830$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
831$(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(nonplat_sc_files)
Jeff Vander Stoep87ae5f72017-03-06 22:53:09 -0800832$(LOCAL_BUILT_MODULE): PRIVATE_SC_NEVERALLOW_FILES := $(plat_sc_neverallow_files)
833$(LOCAL_BUILT_MODULE): $(built_sepolicy) $(nonplat_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp $(plat_sc_neverallow_files)
Stephen Smalley37712872015-03-12 15:46:36 -0400834 @mkdir -p $(dir $@)
Xin Liec6f3932017-03-14 16:51:13 -0700835 $(hide) grep -ie '^neverallow' $(PRIVATE_SC_NEVERALLOW_FILES) > $@.tmp
836 $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) $@.tmp
Stephen Smalley37712872015-03-12 15:46:36 -0400837
Dan Cashman9c038072016-12-22 07:15:18 -0800838built_nonplat_sc := $(LOCAL_BUILT_MODULE)
839nonplat_sc_files :=
Stephen Smalley37712872015-03-12 15:46:36 -0400840
841##################################
842include $(CLEAR_VARS)
Dan Cashman9c038072016-12-22 07:15:18 -0800843LOCAL_MODULE := plat_seapp_neverallows
William Roberts4ee71312015-06-25 11:59:30 -0700844LOCAL_MODULE_CLASS := ETC
845LOCAL_MODULE_TAGS := tests
846
847include $(BUILD_SYSTEM)/base_rules.mk
848
Jeff Vander Stoep87ae5f72017-03-06 22:53:09 -0800849$(LOCAL_BUILT_MODULE): $(plat_sc_neverallow_files)
William Roberts4ee71312015-06-25 11:59:30 -0700850 @mkdir -p $(dir $@)
851 - $(hide) grep -ie '^neverallow' $< > $@
852
Jeff Vander Stoep87ae5f72017-03-06 22:53:09 -0800853plat_sc_neverallow_files :=
William Roberts4ee71312015-06-25 11:59:30 -0700854
855##################################
856include $(CLEAR_VARS)
Stephen Smalley124720a2012-04-04 10:11:16 -0400857
Sandeep Patila86316e2016-12-27 16:08:44 -0800858LOCAL_MODULE := plat_property_contexts
Stephen Smalley124720a2012-04-04 10:11:16 -0400859LOCAL_MODULE_CLASS := ETC
860LOCAL_MODULE_TAGS := optional
Alex Klyubin9d590412017-03-08 13:10:05 -0800861
862ifeq ($(PRODUCT_FULL_TREBLE),true)
863LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
864else
Stephen Smalley124720a2012-04-04 10:11:16 -0400865LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
Alex Klyubin9d590412017-03-08 13:10:05 -0800866endif
Stephen Smalley124720a2012-04-04 10:11:16 -0400867
868include $(BUILD_SYSTEM)/base_rules.mk
869
Sandeep Patila86316e2016-12-27 16:08:44 -0800870plat_pcfiles := $(call build_policy, property_contexts, $(PLAT_PRIVATE_POLICY))
William Roberts6aabc1c2015-07-30 11:44:26 -0700871
Sandeep Patila86316e2016-12-27 16:08:44 -0800872plat_property_contexts.tmp := $(intermediates)/plat_property_contexts.tmp
873$(plat_property_contexts.tmp): PRIVATE_PC_FILES := $(plat_pcfiles)
874$(plat_property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
875$(plat_property_contexts.tmp): $(plat_pcfiles)
William Roberts7f81b332015-09-29 13:52:37 -0700876 @mkdir -p $(dir $@)
Colin Cross9eb6c872015-10-01 21:25:09 +0000877 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@
William Robertsdcffd2b2015-09-29 13:52:37 -0700878$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
Sandeep Patila86316e2016-12-27 16:08:44 -0800879$(LOCAL_BUILT_MODULE): $(plat_property_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc
William Robertsdcffd2b2015-09-29 13:52:37 -0700880 @mkdir -p $(dir $@)
Sandeep Patila86316e2016-12-27 16:08:44 -0800881 $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< | sort -u -o $@
dcashman07791552016-12-07 11:27:47 -0800882 $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@
Stephen Smalley124720a2012-04-04 10:11:16 -0400883
Sandeep Patila86316e2016-12-27 16:08:44 -0800884built_plat_pc := $(LOCAL_BUILT_MODULE)
885plat_pcfiles :=
886plat_property_contexts.tmp :=
Robert Craig8b7545b2014-03-20 09:35:08 -0400887
Stephen Smalley124720a2012-04-04 10:11:16 -0400888##################################
Riley Spahnf90c41f2014-06-05 15:52:02 -0700889include $(CLEAR_VARS)
Sandeep Patila86316e2016-12-27 16:08:44 -0800890LOCAL_MODULE := nonplat_property_contexts
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400891LOCAL_MODULE_CLASS := ETC
Sandeep Patila86316e2016-12-27 16:08:44 -0800892LOCAL_MODULE_TAGS := optional
Alex Klyubin9d590412017-03-08 13:10:05 -0800893
894ifeq ($(PRODUCT_FULL_TREBLE),true)
895LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
896else
Sandeep Patila86316e2016-12-27 16:08:44 -0800897LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
Alex Klyubin9d590412017-03-08 13:10:05 -0800898endif
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400899
Stephen Smalleyc9361732015-03-13 09:36:57 -0400900include $(BUILD_SYSTEM)/base_rules.mk
901
Alex Klyubin55961722017-01-30 18:44:59 -0800902nonplat_pcfiles := $(call build_policy, property_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
Sandeep Patil262edc32016-12-27 16:08:44 -0800903
Sandeep Patila86316e2016-12-27 16:08:44 -0800904nonplat_property_contexts.tmp := $(intermediates)/nonplat_property_contexts.tmp
905$(nonplat_property_contexts.tmp): PRIVATE_PC_FILES := $(nonplat_pcfiles)
906$(nonplat_property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
907$(nonplat_property_contexts.tmp): $(nonplat_pcfiles)
William Robertsdcffd2b2015-09-29 13:52:37 -0700908 @mkdir -p $(dir $@)
Sandeep Patila86316e2016-12-27 16:08:44 -0800909 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@
910
911
912$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
913$(LOCAL_BUILT_MODULE): $(nonplat_property_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc
914 @mkdir -p $(dir $@)
915 $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< | sort -u -o $@
dcashman07791552016-12-07 11:27:47 -0800916 $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@
William Robertsdcffd2b2015-09-29 13:52:37 -0700917
Sandeep Patila86316e2016-12-27 16:08:44 -0800918built_nonplat_pc := $(LOCAL_BUILT_MODULE)
919nonplat_pcfiles :=
920nonplat_property_contexts.tmp :=
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400921
922##################################
923include $(CLEAR_VARS)
924
Alex Klyubinec78c372017-03-10 12:44:16 -0800925LOCAL_MODULE := plat_property_contexts.recovery
926LOCAL_MODULE_STEM := plat_property_contexts
927LOCAL_MODULE_CLASS := ETC
928LOCAL_MODULE_TAGS := optional
929LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
930
931include $(BUILD_SYSTEM)/base_rules.mk
932
933$(LOCAL_BUILT_MODULE): $(built_plat_pc)
934 $(hide) cp -f $< $@
935
936##################################
937include $(CLEAR_VARS)
Alex Klyubinec78c372017-03-10 12:44:16 -0800938LOCAL_MODULE := nonplat_property_contexts.recovery
939LOCAL_MODULE_STEM := nonplat_property_contexts
940LOCAL_MODULE_CLASS := ETC
941LOCAL_MODULE_TAGS := optional
942LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
943
944include $(BUILD_SYSTEM)/base_rules.mk
945
946$(LOCAL_BUILT_MODULE): $(built_nonplat_pc)
947 $(hide) cp -f $< $@
948
949##################################
950include $(CLEAR_VARS)
951
Sandeep Patila058b562016-12-27 15:10:48 -0800952LOCAL_MODULE := plat_service_contexts
Riley Spahnf90c41f2014-06-05 15:52:02 -0700953LOCAL_MODULE_CLASS := ETC
954LOCAL_MODULE_TAGS := optional
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800955ifeq ($(PRODUCT_FULL_TREBLE),true)
956LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
957else
Riley Spahnf90c41f2014-06-05 15:52:02 -0700958LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800959endif
Riley Spahnf90c41f2014-06-05 15:52:02 -0700960
961include $(BUILD_SYSTEM)/base_rules.mk
962
Sandeep Patila058b562016-12-27 15:10:48 -0800963plat_svcfiles := $(call build_policy, service_contexts, $(PLAT_PRIVATE_POLICY))
Riley Spahnf90c41f2014-06-05 15:52:02 -0700964
Sandeep Patila058b562016-12-27 15:10:48 -0800965plat_service_contexts.tmp := $(intermediates)/plat_service_contexts.tmp
966$(plat_service_contexts.tmp): PRIVATE_SVC_FILES := $(plat_svcfiles)
967$(plat_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
968$(plat_service_contexts.tmp): $(plat_svcfiles)
Riley Spahnf90c41f2014-06-05 15:52:02 -0700969 @mkdir -p $(dir $@)
William Roberts6aabc1c2015-07-30 11:44:26 -0700970 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
William Roberts7fc865a2015-09-29 14:17:38 -0700971
972$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
Sandeep Patila058b562016-12-27 15:10:48 -0800973$(LOCAL_BUILT_MODULE): $(plat_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
William Roberts7fc865a2015-09-29 14:17:38 -0700974 @mkdir -p $(dir $@)
William Robertsc9fce3f2016-04-06 11:53:04 -0700975 sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
dcashman07791552016-12-07 11:27:47 -0800976 $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
Riley Spahnf90c41f2014-06-05 15:52:02 -0700977
Sandeep Patila058b562016-12-27 15:10:48 -0800978built_plat_svc := $(LOCAL_BUILT_MODULE)
979plat_svcfiles :=
980plat_service_contexts.tmp :=
Riley Spahnf90c41f2014-06-05 15:52:02 -0700981
982##################################
rpcraigb19665c2012-07-30 09:33:03 -0400983include $(CLEAR_VARS)
984
Sandeep Patila058b562016-12-27 15:10:48 -0800985LOCAL_MODULE := nonplat_service_contexts
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400986LOCAL_MODULE_CLASS := ETC
Sandeep Patila058b562016-12-27 15:10:48 -0800987LOCAL_MODULE_TAGS := optional
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800988ifeq ($(PRODUCT_FULL_TREBLE),true)
989LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
990else
Sandeep Patila058b562016-12-27 15:10:48 -0800991LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
Jeff Vander Stoep4e3a4c72017-03-08 22:28:03 -0800992endif
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400993
994include $(BUILD_SYSTEM)/base_rules.mk
995
Alex Klyubin55961722017-01-30 18:44:59 -0800996nonplat_svcfiles := $(call build_policy, service_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -0400997
Sandeep Patila058b562016-12-27 15:10:48 -0800998nonplat_service_contexts.tmp := $(intermediates)/nonplat_service_contexts.tmp
999$(nonplat_service_contexts.tmp): PRIVATE_SVC_FILES := $(nonplat_svcfiles)
1000$(nonplat_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
1001$(nonplat_service_contexts.tmp): $(nonplat_svcfiles)
1002 @mkdir -p $(dir $@)
1003 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
1004
1005$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
1006$(LOCAL_BUILT_MODULE): $(nonplat_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
William Roberts7fc865a2015-09-29 14:17:38 -07001007 @mkdir -p $(dir $@)
William Robertsc9fce3f2016-04-06 11:53:04 -07001008 sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
dcashman07791552016-12-07 11:27:47 -08001009 $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
William Roberts7fc865a2015-09-29 14:17:38 -07001010
Sandeep Patila058b562016-12-27 15:10:48 -08001011built_nonplat_svc := $(LOCAL_BUILT_MODULE)
1012nonplat_svcfiles :=
1013nonplat_service_contexts.tmp :=
Stephen Smalley2e0cd5a2015-03-12 17:45:03 -04001014
1015##################################
1016include $(CLEAR_VARS)
1017
Martijn Coenen3ea47b92017-04-07 16:14:43 -07001018LOCAL_MODULE := plat_hwservice_contexts
1019LOCAL_MODULE_CLASS := ETC
1020LOCAL_MODULE_TAGS := optional
1021ifeq ($(PRODUCT_FULL_TREBLE),true)
1022LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
1023else
1024LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
1025endif
1026
1027include $(BUILD_SYSTEM)/base_rules.mk
1028
1029plat_hwsvcfiles := $(call build_policy, hwservice_contexts, $(PLAT_PRIVATE_POLICY))
1030
1031plat_hwservice_contexts.tmp := $(intermediates)/plat_hwservice_contexts.tmp
1032$(plat_hwservice_contexts.tmp): PRIVATE_SVC_FILES := $(plat_hwsvcfiles)
1033$(plat_hwservice_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
1034$(plat_hwservice_contexts.tmp): $(plat_hwsvcfiles)
1035 @mkdir -p $(dir $@)
1036 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
1037
1038$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
1039$(LOCAL_BUILT_MODULE): $(plat_hwservice_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
1040 @mkdir -p $(dir $@)
1041 sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
1042 $(HOST_OUT_EXECUTABLES)/checkfc -e -l $(PRIVATE_SEPOLICY) $@
1043
1044plat_hwsvcfiles :=
1045plat_hwservice_contexts.tmp :=
1046
1047##################################
1048include $(CLEAR_VARS)
1049
1050LOCAL_MODULE := nonplat_hwservice_contexts
1051LOCAL_MODULE_CLASS := ETC
1052LOCAL_MODULE_TAGS := optional
1053ifeq ($(PRODUCT_FULL_TREBLE),true)
1054LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
1055else
1056LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
1057endif
1058
1059include $(BUILD_SYSTEM)/base_rules.mk
1060
1061nonplat_hwsvcfiles := $(call build_policy, hwservice_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
1062
1063nonplat_hwservice_contexts.tmp := $(intermediates)/nonplat_hwservice_contexts.tmp
1064$(nonplat_hwservice_contexts.tmp): PRIVATE_SVC_FILES := $(nonplat_hwsvcfiles)
1065$(nonplat_hwservice_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
1066$(nonplat_hwservice_contexts.tmp): $(nonplat_hwsvcfiles)
1067 @mkdir -p $(dir $@)
1068 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
1069
1070$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
1071$(LOCAL_BUILT_MODULE): $(nonplat_hwservice_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
1072 @mkdir -p $(dir $@)
1073 sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
1074 $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e -l $(PRIVATE_SEPOLICY) $@
1075
1076nonplat_hwsvcfiles :=
1077nonplat_hwservice_contexts.tmp :=
1078
1079##################################
1080include $(CLEAR_VARS)
1081
Martijn Coenen6676c232017-03-31 17:29:53 -07001082LOCAL_MODULE := vndservice_contexts
1083LOCAL_MODULE_CLASS := ETC
1084LOCAL_MODULE_TAGS := optional
1085ifeq ($(PRODUCT_FULL_TREBLE),true)
1086LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
1087else
1088LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
1089endif
1090
1091include $(BUILD_SYSTEM)/base_rules.mk
1092
1093vnd_svcfiles := $(call build_policy, vndservice_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
1094
1095vndservice_contexts.tmp := $(intermediates)/vndservice_contexts.tmp
1096$(vndservice_contexts.tmp): PRIVATE_SVC_FILES := $(vnd_svcfiles)
1097$(vndservice_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
1098$(vndservice_contexts.tmp): $(vnd_svcfiles)
1099 @mkdir -p $(dir $@)
1100 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
1101
1102$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
1103$(LOCAL_BUILT_MODULE): $(vndservice_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
1104 @mkdir -p $(dir $@)
1105 sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
Martijn Coenenee976622017-04-07 10:08:55 -07001106 $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e -v $(PRIVATE_SEPOLICY) $@
Martijn Coenen6676c232017-03-31 17:29:53 -07001107
1108vnd_svcfiles :=
1109vndservice_contexts.tmp :=
1110##################################
1111include $(CLEAR_VARS)
1112
dcashman90b3b942016-12-14 13:47:55 -08001113LOCAL_MODULE := plat_mac_permissions.xml
rpcraigb19665c2012-07-30 09:33:03 -04001114LOCAL_MODULE_CLASS := ETC
1115LOCAL_MODULE_TAGS := optional
Jeff Vander Stoepbba9e7b2017-03-10 15:51:23 -08001116LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
rpcraigb19665c2012-07-30 09:33:03 -04001117
William Roberts2c8a55d2012-11-30 14:59:09 -08001118include $(BUILD_SYSTEM)/base_rules.mk
rpcraigb19665c2012-07-30 09:33:03 -04001119
Geremy Condracd4104e2013-03-26 18:19:12 +00001120# Build keys.conf
dcashman90b3b942016-12-14 13:47:55 -08001121plat_mac_perms_keys.tmp := $(intermediates)/plat_keys.tmp
1122$(plat_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
1123$(plat_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_PRIVATE_POLICY))
Geremy Condracd4104e2013-03-26 18:19:12 +00001124 @mkdir -p $(dir $@)
William Robertsd2185582015-07-16 11:28:02 -07001125 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
Geremy Condracd4104e2013-03-26 18:19:12 +00001126
dcashman90b3b942016-12-14 13:47:55 -08001127all_plat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_PRIVATE_POLICY))
rpcraigb19665c2012-07-30 09:33:03 -04001128
Shinichiro Hamajief0c14d2016-05-13 16:04:58 +09001129# Should be synced with keys.conf.
dcashman90b3b942016-12-14 13:47:55 -08001130all_plat_keys := platform media shared testkey
1131all_plat_keys := $(all_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem)
Shinichiro Hamajief0c14d2016-05-13 16:04:58 +09001132
dcashman90b3b942016-12-14 13:47:55 -08001133$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_plat_mac_perms_files)
1134$(LOCAL_BUILT_MODULE): $(plat_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
1135$(all_plat_mac_perms_files) $(all_plat_keys)
Geremy Condracd4104e2013-03-26 18:19:12 +00001136 @mkdir -p $(dir $@)
Nick Kralevichc3c90522013-10-25 12:25:36 -07001137 $(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \
William Roberts6aabc1c2015-07-30 11:44:26 -07001138 $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
Geremy Condracd4104e2013-03-26 18:19:12 +00001139
William Roberts6aabc1c2015-07-30 11:44:26 -07001140all_mac_perms_files :=
dcashman90b3b942016-12-14 13:47:55 -08001141all_plat_keys :=
1142plat_mac_perms_keys.tmp :=
1143
1144##################################
1145include $(CLEAR_VARS)
1146
1147LOCAL_MODULE := nonplat_mac_permissions.xml
1148LOCAL_MODULE_CLASS := ETC
1149LOCAL_MODULE_TAGS := optional
Jeff Vander Stoepbba9e7b2017-03-10 15:51:23 -08001150LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
dcashman90b3b942016-12-14 13:47:55 -08001151
1152include $(BUILD_SYSTEM)/base_rules.mk
1153
1154# Build keys.conf
1155nonplat_mac_perms_keys.tmp := $(intermediates)/nonplat_keys.tmp
1156$(nonplat_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
Alex Klyubin55961722017-01-30 18:44:59 -08001157$(nonplat_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
dcashman90b3b942016-12-14 13:47:55 -08001158 @mkdir -p $(dir $@)
1159 $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
1160
Alex Klyubin55961722017-01-30 18:44:59 -08001161all_nonplat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
dcashman90b3b942016-12-14 13:47:55 -08001162
1163$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_nonplat_mac_perms_files)
1164$(LOCAL_BUILT_MODULE): $(nonplat_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
1165$(all_nonplat_mac_perms_files)
1166 @mkdir -p $(dir $@)
1167 $(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
1168
1169nonplat_mac_perms_keys.tmp :=
1170all_nonplat_mac_perms_files :=
William Roberts6aabc1c2015-07-30 11:44:26 -07001171
rpcraigb19665c2012-07-30 09:33:03 -04001172##################################
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -07001173ifeq ($(PRODUCT_FULL_TREBLE),true)
1174include $(CLEAR_VARS)
1175# For Treble builds run tests verifying that processes are properly labeled and
1176# permissions granted do not violate the treble model.
1177LOCAL_MODULE := treble_sepolicy_tests
1178LOCAL_MODULE_CLASS := ETC
1179LOCAL_MODULE_TAGS := tests
1180
1181include $(BUILD_SYSTEM)/base_rules.mk
1182
1183treble_sepolicy_tests := $(intermediates)/treble_sepolicy_tests
1184$(treble_sepolicy_tests): PRIVATE_PLAT_FC := $(built_plat_fc)
1185$(treble_sepolicy_tests): PRIVATE_NONPLAT_FC := $(built_nonplat_fc)
1186$(treble_sepolicy_tests): PRIVATE_SEPOLICY := $(built_sepolicy)
1187$(treble_sepolicy_tests): $(HOST_OUT_EXECUTABLES)/treble_sepolicy_tests.py \
1188$(built_plat_fc) $(built_nonplat_fc) $(built_sepolicy)
1189 @mkdir -p $(dir $@)
1190 $(hide) python $(HOST_OUT_EXECUTABLES)/treble_sepolicy_tests.py -l $(HOST_OUT)/lib64 -f $(PRIVATE_PLAT_FC) -f $(PRIVATE_NONPLAT_FC) -p $(PRIVATE_SEPOLICY)
1191 $(hide) touch $@
1192endif # ($(PRODUCT_FULL_TREBLE),true)
1193#################################
rpcraig47cd3962012-10-17 21:09:52 -04001194
Dan Cashman1c040272016-12-15 15:28:44 -08001195add_nl :=
William Roberts49693f12016-01-04 12:20:57 -08001196build_device_policy :=
Dan Cashman1c040272016-12-15 15:28:44 -08001197build_policy :=
dcashmand225b692016-12-12 09:29:04 -08001198built_plat_fc :=
1199built_nonplat_fc :=
Richard Hainesc8801fe2015-12-11 10:39:19 +00001200built_nl :=
Alex Klyubin8f7173b2017-02-25 14:47:53 -08001201built_plat_cil :=
Alex Klyubin8f7173b2017-02-25 14:47:53 -08001202built_mapping_cil :=
Sandeep Patila86316e2016-12-27 16:08:44 -08001203built_plat_pc :=
Alex Klyubin193dccd2017-03-07 14:05:57 -08001204built_nonplat_cil :=
Sandeep Patila86316e2016-12-27 16:08:44 -08001205built_nonplat_pc :=
Dan Cashman9c038072016-12-22 07:15:18 -08001206built_nonplat_sc :=
1207built_plat_sc :=
Alex Klyubin193dccd2017-03-07 14:05:57 -08001208built_precompiled_sepolicy :=
Dan Cashman1c040272016-12-15 15:28:44 -08001209built_sepolicy :=
Sandeep Patila058b562016-12-27 15:10:48 -08001210built_plat_svc :=
1211built_nonplat_svc :=
Jeff Vander Stoepb8787692017-04-21 15:57:07 -07001212mapping_policy :=
Dan Cashman1c040272016-12-15 15:28:44 -08001213my_target_arch :=
dcashman1faa6442016-11-28 07:20:28 -08001214plat_pub_policy.cil :=
1215reqd_policy_mask.cil :=
Dan Cashman1c040272016-12-15 15:28:44 -08001216sepolicy_build_files :=
Alex Klyubin7cda44f2017-03-21 14:28:53 -07001217sepolicy_build_cil_workaround_files :=
Jeff Vander Stoep74434842017-03-13 12:22:15 -07001218with_asan :=
Alice Chucdfb06f2012-11-01 11:33:04 -07001219
1220include $(call all-makefiles-under,$(LOCAL_PATH))