2012-01-04 18:33:27 +01:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
2012-08-28 00:41:15 +02:00
|
|
|
|
2017-07-07 23:59:51 +02:00
|
|
|
include $(LOCAL_PATH)/definitions.mk
|
|
|
|
|
2017-04-08 01:36:23 +02:00
|
|
|
# PLATFORM_SEPOLICY_VERSION is a number of the form "NN.m" with "NN" mapping to
|
|
|
|
# PLATFORM_SDK_VERSION and "m" as a minor number which allows for SELinux
|
|
|
|
# changes independent of PLATFORM_SDK_VERSION. This value will be set to
|
|
|
|
# 10000.0 to represent tip-of-tree development that is inherently unstable and
|
|
|
|
# thus designed not to work with any shipping vendor policy. This is similar in
|
|
|
|
# spirit to how DEFAULT_APP_TARGET_SDK is set.
|
|
|
|
# The minor version ('m' component) must be updated every time a platform release
|
|
|
|
# is made which breaks compatibility with the previous platform sepolicy version,
|
|
|
|
# not just on every increase in PLATFORM_SDK_VERSION. The minor version should
|
|
|
|
# be reset to 0 on every bump of the PLATFORM_SDK_VERSION.
|
2017-08-23 22:52:40 +02:00
|
|
|
sepolicy_major_vers := 27
|
2017-04-08 01:36:23 +02:00
|
|
|
sepolicy_minor_vers := 0
|
|
|
|
|
|
|
|
ifneq ($(sepolicy_major_vers), $(PLATFORM_SDK_VERSION))
|
|
|
|
$(error sepolicy_major_version does not match PLATFORM_SDK_VERSION, please update.)
|
|
|
|
endif
|
|
|
|
ifneq (REL,$(PLATFORM_VERSION_CODENAME))
|
|
|
|
sepolicy_major_vers := 10000
|
|
|
|
sepolicy_minor_vers := 0
|
|
|
|
endif
|
|
|
|
PLATFORM_SEPOLICY_VERSION := $(join $(addsuffix .,$(sepolicy_major_vers)), $(sepolicy_minor_vers))
|
|
|
|
sepolicy_major_vers :=
|
|
|
|
sepolicy_minor_vers :=
|
|
|
|
|
2017-03-23 00:20:24 +01:00
|
|
|
include $(CLEAR_VARS)
|
2012-01-04 18:33:27 +01:00
|
|
|
# SELinux policy version.
|
2015-03-13 15:03:52 +01:00
|
|
|
# Must be <= /sys/fs/selinux/policyvers reported by the Android kernel.
|
2012-01-04 18:33:27 +01:00
|
|
|
# Must be within the compatibility range reported by checkpolicy -V.
|
2015-12-07 17:30:43 +01:00
|
|
|
POLICYVERS ?= 30
|
2012-01-04 18:33:27 +01:00
|
|
|
|
|
|
|
MLS_SENS=1
|
|
|
|
MLS_CATS=1024
|
|
|
|
|
2015-03-13 15:03:52 +01:00
|
|
|
ifdef BOARD_SEPOLICY_REPLACE
|
|
|
|
$(error BOARD_SEPOLICY_REPLACE is no longer supported; please remove from your BoardConfig.mk or other .mk file.)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef BOARD_SEPOLICY_IGNORE
|
|
|
|
$(error BOARD_SEPOLICY_IGNORE is no longer supported; please remove from your BoardConfig.mk or other .mk file.)
|
|
|
|
endif
|
2012-10-18 03:09:52 +02:00
|
|
|
|
2015-04-01 16:14:56 +02:00
|
|
|
ifdef BOARD_SEPOLICY_UNION
|
|
|
|
$(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.)
|
|
|
|
endif
|
|
|
|
|
2015-07-16 20:28:02 +02:00
|
|
|
ifdef BOARD_SEPOLICY_M4DEFS
|
|
|
|
LOCAL_ADDITIONAL_M4DEFS := $(addprefix -D, $(BOARD_SEPOLICY_M4DEFS))
|
2017-07-07 23:59:51 +02:00
|
|
|
else
|
|
|
|
LOCAL_ADDITIONAL_M4DEFS :=
|
2015-07-16 20:28:02 +02:00
|
|
|
endif
|
|
|
|
|
2016-07-22 22:13:11 +02:00
|
|
|
# sepolicy is now divided into multiple portions:
|
|
|
|
# public - policy exported on which non-platform policy developers may write
|
|
|
|
# additional policy. types and attributes are versioned and included in
|
|
|
|
# delivered non-platform policy, which is to be combined with platform policy.
|
|
|
|
# private - platform-only policy required for platform functionality but which
|
|
|
|
# is not exported to vendor policy developers and as such may not be assumed
|
|
|
|
# to exist.
|
2017-01-31 03:44:59 +01:00
|
|
|
# vendor - vendor-only policy required for vendor functionality. This policy can
|
|
|
|
# reference the public policy but cannot reference the private policy. This
|
|
|
|
# policy is for components which are produced from the core/non-vendor tree and
|
|
|
|
# placed into a vendor partition.
|
2016-12-07 20:27:47 +01:00
|
|
|
# mapping - This contains policy statements which map the attributes
|
2016-07-22 22:13:11 +02:00
|
|
|
# exposed in the public policy of previous versions to the concrete types used
|
|
|
|
# in this policy to ensure that policy targeting attributes from public
|
|
|
|
# policy from an older platform version continues to work.
|
|
|
|
|
2016-10-12 23:58:09 +02:00
|
|
|
# build process for device:
|
2016-07-22 22:13:11 +02:00
|
|
|
# 1) convert policies to CIL:
|
|
|
|
# - private + public platform policy to CIL
|
|
|
|
# - mapping file to CIL (should already be in CIL form)
|
|
|
|
# - non-platform public policy to CIL
|
|
|
|
# - non-platform public + private policy to CIL
|
|
|
|
# 2) attributize policy
|
|
|
|
# - run script which takes non-platform public and non-platform combined
|
|
|
|
# private + public policy and produces attributized and versioned
|
|
|
|
# non-platform policy
|
|
|
|
# 3) combine policy files
|
|
|
|
# - combine mapping, platform and non-platform policy.
|
|
|
|
# - compile output binary policy file
|
|
|
|
|
|
|
|
PLAT_PUBLIC_POLICY := $(LOCAL_PATH)/public
|
2017-05-23 23:47:16 +02:00
|
|
|
ifneq ( ,$(BOARD_PLAT_PUBLIC_SEPOLICY_DIR))
|
|
|
|
ifneq (1, $(words $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR)))
|
|
|
|
$(error BOARD_PLAT_PUBLIC_SEPOLICY_DIR must only contain one directory)
|
|
|
|
else
|
|
|
|
PLAT_PUBLIC_POLICY += $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR)
|
|
|
|
endif
|
|
|
|
endif
|
2016-07-22 22:13:11 +02:00
|
|
|
PLAT_PRIVATE_POLICY := $(LOCAL_PATH)/private
|
2017-05-23 23:47:16 +02:00
|
|
|
ifneq ( ,$(BOARD_PLAT_PRIVATE_SEPOLICY_DIR))
|
|
|
|
ifneq (1, $(words $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR)))
|
|
|
|
$(error BOARD_PLAT_PRIVATE_SEPOLICY_DIR must only contain one directory)
|
|
|
|
else
|
|
|
|
PLAT_PRIVATE_POLICY += $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR)
|
|
|
|
endif
|
|
|
|
endif
|
2017-01-31 03:44:59 +01:00
|
|
|
PLAT_VENDOR_POLICY := $(LOCAL_PATH)/vendor
|
2016-10-12 23:58:09 +02:00
|
|
|
REQD_MASK_POLICY := $(LOCAL_PATH)/reqd_mask
|
|
|
|
|
|
|
|
# TODO: move to README when doing the README update and finalizing versioning.
|
2017-04-07 23:18:48 +02:00
|
|
|
# BOARD_SEPOLICY_VERS must take the format "NN.m" and contain the sepolicy
|
|
|
|
# version identifier corresponding to the sepolicy on which the non-platform
|
|
|
|
# policy is to be based. If unspecified, this will build against the current
|
|
|
|
# public platform policy in tree
|
2016-10-12 23:58:09 +02:00
|
|
|
ifndef BOARD_SEPOLICY_VERS
|
|
|
|
$(warning BOARD_SEPOLICY_VERS not specified, assuming current platform version)
|
2017-04-07 23:18:48 +02:00
|
|
|
# The default platform policy version.
|
2017-04-08 01:36:23 +02:00
|
|
|
BOARD_SEPOLICY_VERS := $(PLATFORM_SEPOLICY_VERSION)
|
2016-10-12 23:58:09 +02:00
|
|
|
endif
|
2016-07-22 22:13:11 +02:00
|
|
|
|
2018-01-04 01:53:24 +01:00
|
|
|
NEVERALLOW_ARG :=
|
|
|
|
ifeq ($(SELINUX_IGNORE_NEVERALLOWS),true)
|
|
|
|
ifeq ($(TARGET_BUILD_VARIANT),user)
|
|
|
|
$(error SELINUX_IGNORE_NEVERALLOWS := true cannot be used in user builds)
|
|
|
|
endif
|
|
|
|
$(warning Be careful when using the SELINUX_IGNORE_NEVERALLOWS flag. \
|
|
|
|
It does not work in user builds and using it will \
|
|
|
|
not stop you from failing CTS.)
|
|
|
|
NEVERALLOW_ARG := -N
|
|
|
|
endif
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
# BOARD_SEPOLICY_DIRS was used for vendor sepolicy customization before.
|
|
|
|
# It has been replaced by BOARD_VENDOR_SEPOLICY_DIRS. BOARD_SEPOLICY_DIRS is
|
|
|
|
# still allowed for backward compatibility, which will be merged into
|
|
|
|
# BOARD_VENDOR_SEPOLICY_DIRS.
|
|
|
|
ifdef BOARD_SEPOLICY_DIRS
|
|
|
|
BOARD_VENDOR_SEPOLICY_DIRS += $(BOARD_SEPOLICY_DIRS)
|
|
|
|
endif
|
2017-04-12 23:28:34 +02:00
|
|
|
|
|
|
|
platform_mapping_file := $(BOARD_SEPOLICY_VERS).cil
|
|
|
|
|
2016-07-22 22:13:11 +02:00
|
|
|
###########################################################
|
|
|
|
# Compute policy files to be used in policy build.
|
|
|
|
# $(1): files to include
|
|
|
|
# $(2): directories in which to find files
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
define build_policy
|
|
|
|
$(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(2)), $(sort $(wildcard $(file)))))
|
|
|
|
endef
|
2016-01-04 21:20:57 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
# Builds paths for all policy files found in BOARD_VENDOR_SEPOLICY_DIRS.
|
2016-01-04 21:20:57 +01:00
|
|
|
# $(1): the set of policy name paths to build
|
2018-02-05 10:34:52 +01:00
|
|
|
build_vendor_policy = $(call build_policy, $(1), $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS))
|
2016-01-04 21:20:57 +01:00
|
|
|
|
2015-12-11 11:39:19 +01:00
|
|
|
# Add a file containing only a newline in-between each policy configuration
|
|
|
|
# 'contexts' file. This will allow OEM policy configuration files without a
|
|
|
|
# final newline (0x0A) to be built correctly by the m4(1) macro processor.
|
|
|
|
# $(1): the set of contexts file names.
|
|
|
|
# $(2): the file containing only 0x0A.
|
|
|
|
add_nl = $(foreach entry, $(1), $(subst $(entry), $(entry) $(2), $(entry)))
|
|
|
|
|
2014-07-26 04:11:52 +02:00
|
|
|
sepolicy_build_files := security_classes \
|
|
|
|
initial_sids \
|
|
|
|
access_vectors \
|
|
|
|
global_macros \
|
2014-11-06 00:30:41 +01:00
|
|
|
neverallow_macros \
|
2014-07-26 04:11:52 +02:00
|
|
|
mls_macros \
|
2016-10-12 23:58:09 +02:00
|
|
|
mls_decl \
|
2014-07-26 04:11:52 +02:00
|
|
|
mls \
|
|
|
|
policy_capabilities \
|
|
|
|
te_macros \
|
|
|
|
attributes \
|
2015-12-22 19:39:34 +01:00
|
|
|
ioctl_defines \
|
2015-06-06 00:28:55 +02:00
|
|
|
ioctl_macros \
|
2014-07-26 04:11:52 +02:00
|
|
|
*.te \
|
2016-10-12 23:58:09 +02:00
|
|
|
roles_decl \
|
2014-07-26 04:11:52 +02:00
|
|
|
roles \
|
|
|
|
users \
|
|
|
|
initial_sid_contexts \
|
|
|
|
fs_use \
|
|
|
|
genfs_contexts \
|
|
|
|
port_contexts
|
|
|
|
|
Mark all clients of Allocator HAL
This change associates all domains which are clients of Allocator HAL
with hal_allocator_client and the, required for all HAL client
domains, halclientdomain.
This enables this commit to remove the now unnecessary hwallocator_use
macro because its binder_call(..., hal_allocator_server) is covered by
binder_call(hal_allocator_client, hal_allocator_server) added in this
commit.
Unfortunately apps, except isolated app, are clients of Allocator HAL
as well. This makes it hard to use the hal_client_domain(...,
hal_allocator) macro because it translates into "typeattribute" which
currently does not support being provided with a set of types, such as
{ appdomain -isolated_app }. As a workaround, hopefully until
typeattribute is improved, this commit expresses the necessary
association operation in CIL. private/technical_debt.cil introduced by
this commit is appended into the platform policy CIL file, thus
ensuring that the hack has effect on the final monolithic policy.
P. S. This change also removes Allocator HAL access from isolated_app.
Isolated app shouldn't have access to this HAL anyway.
Test: Google Play Music plays back radios
Test: Google Camera records video with sound and that video is then
successfully played back with sound
Test: YouTube app plays back clips with sound
Test: YouTube in Chrome plays back clips with sound
Bug: 34170079
Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
2017-03-21 22:28:53 +01:00
|
|
|
# CIL files which contain workarounds for current limitation of human-readable
|
|
|
|
# module policy language. These files are appended to the CIL files produced
|
|
|
|
# from module language files.
|
|
|
|
sepolicy_build_cil_workaround_files := technical_debt.cil
|
|
|
|
|
2016-12-16 00:28:44 +01:00
|
|
|
my_target_arch := $(TARGET_ARCH)
|
|
|
|
ifneq (,$(filter mips mips64,$(TARGET_ARCH)))
|
|
|
|
my_target_arch := mips
|
|
|
|
endif
|
|
|
|
|
2017-03-15 21:37:35 +01:00
|
|
|
intermediates := $(TARGET_OUT_INTERMEDIATES)/ETC/sepolicy_intermediates
|
|
|
|
|
2017-03-13 20:22:15 +01:00
|
|
|
with_asan := false
|
|
|
|
ifneq (,$(filter address,$(SANITIZE_TARGET)))
|
|
|
|
with_asan := true
|
|
|
|
endif
|
|
|
|
|
2017-10-04 18:42:29 +02:00
|
|
|
# Library extension for host-side tests
|
2017-10-05 03:15:44 +02:00
|
|
|
ifeq ($(HOST_OS),darwin)
|
2017-10-04 18:42:29 +02:00
|
|
|
SHAREDLIB_EXT=dylib
|
|
|
|
else
|
|
|
|
SHAREDLIB_EXT=so
|
|
|
|
endif
|
|
|
|
|
2017-04-10 21:27:18 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := selinux_policy
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
# Include SELinux policy. We do this here because different modules
|
2017-11-09 20:24:56 +01:00
|
|
|
# need to be included based on the value of PRODUCT_SEPOLICY_SPLIT. This
|
2017-04-10 21:27:18 +02:00
|
|
|
# type of conditional inclusion cannot be done in top-level files such
|
|
|
|
# as build/target/product/embedded.mk.
|
|
|
|
# This conditional inclusion closely mimics the conditional logic
|
|
|
|
# inside init/init.cpp for loading SELinux policy from files.
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-04-10 21:27:18 +02:00
|
|
|
|
|
|
|
# Use split SELinux policy
|
|
|
|
LOCAL_REQUIRED_MODULES += \
|
|
|
|
$(platform_mapping_file) \
|
2017-09-29 00:06:39 +02:00
|
|
|
26.0.cil \
|
2018-02-05 10:34:52 +01:00
|
|
|
plat_pub_versioned.cil \
|
|
|
|
vendor_sepolicy.cil \
|
2017-04-10 21:27:18 +02:00
|
|
|
plat_sepolicy.cil \
|
|
|
|
plat_and_mapping_sepolicy.cil.sha256 \
|
|
|
|
secilc \
|
2017-06-01 00:36:07 +02:00
|
|
|
plat_sepolicy_vers.txt \
|
2017-09-26 21:58:29 +02:00
|
|
|
|
2017-04-10 21:27:18 +02:00
|
|
|
# Include precompiled policy, unless told otherwise
|
|
|
|
ifneq ($(PRODUCT_PRECOMPILED_SEPOLICY),false)
|
|
|
|
LOCAL_REQUIRED_MODULES += precompiled_sepolicy precompiled_sepolicy.plat_and_mapping.sha256
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
# Use monolithic SELinux policy
|
2017-06-08 22:24:15 +02:00
|
|
|
LOCAL_REQUIRED_MODULES += sepolicy
|
2017-04-10 21:27:18 +02:00
|
|
|
endif
|
2017-06-08 22:24:15 +02:00
|
|
|
|
|
|
|
LOCAL_REQUIRED_MODULES += \
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_file_contexts \
|
|
|
|
vendor_mac_permissions.xml \
|
|
|
|
vendor_property_contexts \
|
|
|
|
vendor_seapp_contexts \
|
|
|
|
vendor_hwservice_contexts \
|
2017-08-22 22:29:53 +02:00
|
|
|
plat_file_contexts \
|
|
|
|
plat_mac_permissions.xml \
|
|
|
|
plat_property_contexts \
|
|
|
|
plat_seapp_contexts \
|
|
|
|
plat_service_contexts \
|
|
|
|
plat_hwservice_contexts \
|
2017-09-26 21:58:29 +02:00
|
|
|
searchpolicy \
|
2017-08-22 22:29:53 +02:00
|
|
|
vndservice_contexts \
|
2017-06-08 22:24:15 +02:00
|
|
|
|
2018-02-02 01:00:38 +01:00
|
|
|
ifneq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_REQUIRED_MODULES += vendor_service_contexts
|
2018-02-02 01:00:38 +01:00
|
|
|
endif
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
ifneq ($(TARGET_BUILD_VARIANT), user)
|
|
|
|
LOCAL_REQUIRED_MODULES += \
|
|
|
|
selinux_denial_metadata \
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(with_asan),true)
|
|
|
|
LOCAL_REQUIRED_MODULES += \
|
|
|
|
sepolicy_tests \
|
2017-11-20 22:25:47 +01:00
|
|
|
treble_sepolicy_tests \
|
2017-09-26 21:58:29 +02:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2017-04-10 21:27:18 +02:00
|
|
|
include $(BUILD_PHONY_PACKAGE)
|
|
|
|
|
2018-01-04 01:53:24 +01:00
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := sepolicy_neverallows
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
# sepolicy_policy.conf - All of the policy for the device. This is only used to
|
|
|
|
# check neverallow rules.
|
|
|
|
sepolicy_policy.conf := $(intermediates)/policy.conf
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(sepolicy_policy.conf): PRIVATE_SEPOLICY_SPLIT := $(PRODUCT_SEPOLICY_SPLIT)
|
|
|
|
$(sepolicy_policy.conf): $(call build_policy, $(sepolicy_build_files), \
|
|
|
|
$(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY) $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS))
|
|
|
|
$(transform-policy-to-conf)
|
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): $(sepolicy_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy
|
|
|
|
rm -f $@
|
|
|
|
ifneq ($(SELINUX_IGNORE_NEVERALLOWS),true)
|
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c \
|
|
|
|
$(POLICYVERS) -o $@ $<
|
|
|
|
else # ($(SELINUX_IGNORE_NEVERALLOWS),true)
|
|
|
|
$(hide) touch $@
|
|
|
|
endif # ($(SELINUX_IGNORE_NEVERALLOWS),true)
|
|
|
|
|
|
|
|
sepolicy_policy.conf :=
|
|
|
|
built_sepolicy_neverallows := $(LOCAL_BUILT_MODULE)
|
|
|
|
|
2012-01-18 02:51:09 +01:00
|
|
|
##################################
|
2016-10-12 23:58:09 +02:00
|
|
|
# reqd_policy_mask - a policy.conf file which contains only the bare minimum
|
|
|
|
# policy necessary to use checkpolicy. This bare-minimum policy needs to be
|
|
|
|
# present in all policy.conf files, but should not necessarily be exported as
|
|
|
|
# part of the public policy. The rules generated by reqd_policy_mask will allow
|
|
|
|
# the compilation of public policy and subsequent removal of CIL policy that
|
|
|
|
# should not be exported.
|
|
|
|
|
|
|
|
reqd_policy_mask.conf := $(intermediates)/reqd_policy_mask.conf
|
|
|
|
$(reqd_policy_mask.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(reqd_policy_mask.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
2016-12-16 00:28:44 +01:00
|
|
|
$(reqd_policy_mask.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
2017-03-13 20:22:15 +01:00
|
|
|
$(reqd_policy_mask.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
2016-10-12 23:58:09 +02:00
|
|
|
$(reqd_policy_mask.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2017-11-09 20:24:56 +01:00
|
|
|
$(reqd_policy_mask.conf): PRIVATE_SEPOLICY_SPLIT := $(PRODUCT_SEPOLICY_SPLIT)
|
2017-10-19 09:54:49 +02:00
|
|
|
$(reqd_policy_mask.conf): PRIVATE_COMPATIBLE_PROPERTY := $(PRODUCT_COMPATIBLE_PROPERTY)
|
2016-10-12 23:58:09 +02:00
|
|
|
$(reqd_policy_mask.conf): $(call build_policy, $(sepolicy_build_files), $(REQD_MASK_POLICY))
|
2017-07-07 23:59:51 +02:00
|
|
|
$(transform-policy-to-conf)
|
2017-04-28 02:16:13 +02:00
|
|
|
# b/37755687
|
|
|
|
CHECKPOLICY_ASAN_OPTIONS := ASAN_OPTIONS=detect_leaks=0
|
|
|
|
|
2016-10-12 23:58:09 +02:00
|
|
|
reqd_policy_mask.cil := $(intermediates)/reqd_policy_mask.cil
|
|
|
|
$(reqd_policy_mask.cil): $(reqd_policy_mask.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy
|
|
|
|
@mkdir -p $(dir $@)
|
2017-04-28 02:16:13 +02:00
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -C -M -c \
|
|
|
|
$(POLICYVERS) -o $@ $<
|
2016-10-12 23:58:09 +02:00
|
|
|
|
2016-11-28 16:20:28 +01:00
|
|
|
reqd_policy_mask.conf :=
|
|
|
|
|
|
|
|
##################################
|
2016-10-12 23:58:09 +02:00
|
|
|
# plat_pub_policy - policy that will be exported to be a part of non-platform
|
|
|
|
# policy corresponding to this platform version. This is a limited subset of
|
|
|
|
# policy that would not compile in checkpolicy on its own. To get around this
|
|
|
|
# limitation, add only the required files from private policy, which will
|
|
|
|
# generate CIL policy that will then be filtered out by the reqd_policy_mask.
|
|
|
|
plat_pub_policy.conf := $(intermediates)/plat_pub_policy.conf
|
|
|
|
$(plat_pub_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(plat_pub_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
2016-12-16 00:28:44 +01:00
|
|
|
$(plat_pub_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
2017-03-13 20:22:15 +01:00
|
|
|
$(plat_pub_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
2016-10-12 23:58:09 +02:00
|
|
|
$(plat_pub_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2017-11-09 20:24:56 +01:00
|
|
|
$(plat_pub_policy.conf): PRIVATE_SEPOLICY_SPLIT := $(PRODUCT_SEPOLICY_SPLIT)
|
2017-10-19 09:54:49 +02:00
|
|
|
$(plat_pub_policy.conf): PRIVATE_COMPATIBLE_PROPERTY := $(PRODUCT_COMPATIBLE_PROPERTY)
|
2016-10-12 23:58:09 +02:00
|
|
|
$(plat_pub_policy.conf): $(call build_policy, $(sepolicy_build_files), \
|
2017-04-12 20:12:17 +02:00
|
|
|
$(PLAT_PUBLIC_POLICY) $(REQD_MASK_POLICY))
|
2017-07-07 23:59:51 +02:00
|
|
|
$(transform-policy-to-conf)
|
2016-10-12 23:58:09 +02:00
|
|
|
plat_pub_policy.cil := $(intermediates)/plat_pub_policy.cil
|
2016-11-28 16:20:28 +01:00
|
|
|
$(plat_pub_policy.cil): PRIVATE_POL_CONF := $(plat_pub_policy.conf)
|
|
|
|
$(plat_pub_policy.cil): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil)
|
|
|
|
$(plat_pub_policy.cil): $(HOST_OUT_EXECUTABLES)/checkpolicy $(plat_pub_policy.conf) $(reqd_policy_mask.cil)
|
2016-10-12 23:58:09 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2017-04-28 02:16:13 +02:00
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF)
|
2016-11-28 16:20:28 +01:00
|
|
|
$(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@
|
2016-10-12 23:58:09 +02:00
|
|
|
|
2016-11-28 16:20:28 +01:00
|
|
|
plat_pub_policy.conf :=
|
2016-12-16 00:28:44 +01:00
|
|
|
|
2016-11-28 16:20:28 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := sectxfile_nl
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
|
|
|
|
# Create a file containing newline only to add between context config files
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
$(LOCAL_BUILT_MODULE):
|
2016-10-12 23:58:09 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2016-11-28 16:20:28 +01:00
|
|
|
$(hide) echo > $@
|
|
|
|
|
|
|
|
built_nl := $(LOCAL_BUILT_MODULE)
|
|
|
|
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := plat_sepolicy.cil
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-03-02 21:39:25 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
2016-11-28 16:20:28 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2016-10-12 23:58:09 +02:00
|
|
|
|
|
|
|
# plat_policy.conf - A combination of the private and public platform policy
|
|
|
|
# which will ship with the device. The platform will always reflect the most
|
|
|
|
# recent platform version and is not currently being attributized.
|
|
|
|
plat_policy.conf := $(intermediates)/plat_policy.conf
|
|
|
|
$(plat_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(plat_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
2016-12-16 00:28:44 +01:00
|
|
|
$(plat_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
2017-03-13 20:22:15 +01:00
|
|
|
$(plat_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
2016-10-12 23:58:09 +02:00
|
|
|
$(plat_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2017-11-09 20:24:56 +01:00
|
|
|
$(plat_policy.conf): PRIVATE_SEPOLICY_SPLIT := $(PRODUCT_SEPOLICY_SPLIT)
|
2017-10-19 09:54:49 +02:00
|
|
|
$(plat_policy.conf): PRIVATE_COMPATIBLE_PROPERTY := $(PRODUCT_COMPATIBLE_PROPERTY)
|
2016-10-12 23:58:09 +02:00
|
|
|
$(plat_policy.conf): $(call build_policy, $(sepolicy_build_files), \
|
2016-07-22 22:13:11 +02:00
|
|
|
$(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
|
2017-07-07 23:59:51 +02:00
|
|
|
$(transform-policy-to-conf)
|
2016-07-22 22:13:11 +02:00
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
|
|
|
|
2017-04-22 00:57:07 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CIL_FILES := \
|
Mark all clients of Allocator HAL
This change associates all domains which are clients of Allocator HAL
with hal_allocator_client and the, required for all HAL client
domains, halclientdomain.
This enables this commit to remove the now unnecessary hwallocator_use
macro because its binder_call(..., hal_allocator_server) is covered by
binder_call(hal_allocator_client, hal_allocator_server) added in this
commit.
Unfortunately apps, except isolated app, are clients of Allocator HAL
as well. This makes it hard to use the hal_client_domain(...,
hal_allocator) macro because it translates into "typeattribute" which
currently does not support being provided with a set of types, such as
{ appdomain -isolated_app }. As a workaround, hopefully until
typeattribute is improved, this commit expresses the necessary
association operation in CIL. private/technical_debt.cil introduced by
this commit is appended into the platform policy CIL file, thus
ensuring that the hack has effect on the final monolithic policy.
P. S. This change also removes Allocator HAL access from isolated_app.
Isolated app shouldn't have access to this HAL anyway.
Test: Google Play Music plays back radios
Test: Google Camera records video with sound and that video is then
successfully played back with sound
Test: YouTube app plays back clips with sound
Test: YouTube in Chrome plays back clips with sound
Bug: 34170079
Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
2017-03-21 22:28:53 +01:00
|
|
|
$(call build_policy, $(sepolicy_build_cil_workaround_files), $(PLAT_PRIVATE_POLICY))
|
2018-01-04 01:53:24 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_NEVERALLOW_ARG := $(NEVERALLOW_ARG)
|
2017-04-22 00:57:07 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(plat_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/secilc \
|
2018-01-04 01:53:24 +01:00
|
|
|
$(call build_policy, $(sepolicy_build_cil_workaround_files), $(PLAT_PRIVATE_POLICY)) \
|
|
|
|
$(built_sepolicy_neverallows)
|
2016-10-12 23:58:09 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2017-04-28 02:16:13 +02:00
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c \
|
|
|
|
$(POLICYVERS) -o $@ $<
|
Mark all clients of Allocator HAL
This change associates all domains which are clients of Allocator HAL
with hal_allocator_client and the, required for all HAL client
domains, halclientdomain.
This enables this commit to remove the now unnecessary hwallocator_use
macro because its binder_call(..., hal_allocator_server) is covered by
binder_call(hal_allocator_client, hal_allocator_server) added in this
commit.
Unfortunately apps, except isolated app, are clients of Allocator HAL
as well. This makes it hard to use the hal_client_domain(...,
hal_allocator) macro because it translates into "typeattribute" which
currently does not support being provided with a set of types, such as
{ appdomain -isolated_app }. As a workaround, hopefully until
typeattribute is improved, this commit expresses the necessary
association operation in CIL. private/technical_debt.cil introduced by
this commit is appended into the platform policy CIL file, thus
ensuring that the hack has effect on the final monolithic policy.
P. S. This change also removes Allocator HAL access from isolated_app.
Isolated app shouldn't have access to this HAL anyway.
Test: Google Play Music plays back radios
Test: Google Camera records video with sound and that video is then
successfully played back with sound
Test: YouTube app plays back clips with sound
Test: YouTube in Chrome plays back clips with sound
Bug: 34170079
Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
2017-03-21 22:28:53 +01:00
|
|
|
$(hide) cat $(PRIVATE_ADDITIONAL_CIL_FILES) >> $@
|
2018-01-04 01:53:24 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -c $(POLICYVERS) $(PRIVATE_NEVERALLOW_ARG) $@ -o /dev/null -f /dev/null
|
2017-02-25 23:47:53 +01:00
|
|
|
|
|
|
|
built_plat_cil := $(LOCAL_BUILT_MODULE)
|
2016-11-28 16:20:28 +01:00
|
|
|
plat_policy.conf :=
|
|
|
|
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2017-04-10 21:27:18 +02:00
|
|
|
LOCAL_MODULE := plat_sepolicy_vers.txt
|
2016-11-28 16:20:28 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-04-10 21:27:18 +02:00
|
|
|
LOCAL_PROPRIETARY_MODULE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_PLAT_SEPOL_VERS := $(BOARD_SEPOLICY_VERS)
|
|
|
|
$(LOCAL_BUILT_MODULE) :
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
echo $(PRIVATE_PLAT_SEPOL_VERS) > $@
|
|
|
|
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := $(platform_mapping_file)
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux/mapping
|
2016-11-28 16:20:28 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2017-05-08 23:26:52 +02:00
|
|
|
current_mapping.cil := $(intermediates)/mapping/$(PLATFORM_SEPOLICY_VERSION).cil
|
|
|
|
ifeq ($(BOARD_SEPOLICY_VERS), $(PLATFORM_SEPOLICY_VERSION))
|
2016-11-28 16:20:28 +01:00
|
|
|
# auto-generate the mapping file for current platform policy, since it needs to
|
|
|
|
# track platform policy development
|
2017-04-08 01:36:23 +02:00
|
|
|
$(current_mapping.cil) : PRIVATE_VERS := $(PLATFORM_SEPOLICY_VERSION)
|
2016-11-28 16:20:28 +01:00
|
|
|
$(current_mapping.cil) : $(plat_pub_policy.cil) $(HOST_OUT_EXECUTABLES)/version_policy
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/version_policy -b $< -m -n $(PRIVATE_VERS) -o $@
|
|
|
|
|
2017-05-08 23:26:52 +02:00
|
|
|
else # ifeq ($(BOARD_SEPOLICY_VERS), $(PLATFORM_SEPOLICY_VERSION))
|
|
|
|
prebuilt_mapping_files := $(wildcard $(addsuffix /mapping/$(BOARD_SEPOLICY_VERS).cil, $(PLAT_PRIVATE_POLICY)))
|
|
|
|
$(current_mapping.cil) : $(prebuilt_mapping_files)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
cat $^ > $@
|
2017-04-07 23:18:48 +02:00
|
|
|
|
2017-05-08 23:26:52 +02:00
|
|
|
prebuilt_mapping_files :=
|
2016-11-28 16:20:28 +01:00
|
|
|
endif
|
|
|
|
|
2017-05-08 23:26:52 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(current_mapping.cil) $(ACP)
|
2017-04-22 00:57:07 +02:00
|
|
|
$(hide) $(ACP) $< $@
|
2016-11-28 16:20:28 +01:00
|
|
|
|
2017-02-25 23:47:53 +01:00
|
|
|
built_mapping_cil := $(LOCAL_BUILT_MODULE)
|
2016-11-28 16:20:28 +01:00
|
|
|
current_mapping.cil :=
|
|
|
|
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2017-09-29 00:06:39 +02:00
|
|
|
LOCAL_MODULE := 26.0.cil
|
|
|
|
LOCAL_SRC_FILES := private/compat/26.0/26.0.cil
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux/mapping
|
|
|
|
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2017-04-04 23:27:41 +02:00
|
|
|
LOCAL_MODULE := plat_and_mapping_sepolicy.cil.sha256
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH = $(TARGET_OUT)/etc/selinux
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): $(built_plat_cil) $(built_mapping_cil)
|
|
|
|
cat $^ | sha256sum | cut -d' ' -f1 > $@
|
|
|
|
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
# plat_pub_versioned.cil - the exported platform policy associated with the version
|
|
|
|
# that non-platform policy targets.
|
|
|
|
LOCAL_MODULE := plat_pub_versioned.cil
|
2016-11-28 16:20:28 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-03-02 21:39:25 +01:00
|
|
|
LOCAL_PROPRIETARY_MODULE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
2016-11-28 16:20:28 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_VERS := $(BOARD_SEPOLICY_VERS)
|
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_TGT_POL := $(plat_pub_policy.cil)
|
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_DEP_CIL_FILES := $(built_plat_cil) $(built_mapping_cil)
|
|
|
|
$(LOCAL_BUILT_MODULE) : $(plat_pub_policy.cil) $(HOST_OUT_EXECUTABLES)/version_policy \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/secilc $(built_plat_cil) $(built_mapping_cil)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(HOST_OUT_EXECUTABLES)/version_policy -b $< -t $(PRIVATE_TGT_POL) -n $(PRIVATE_VERS) -o $@
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -N -c $(POLICYVERS) \
|
|
|
|
$(PRIVATE_DEP_CIL_FILES) $@ -o /dev/null -f /dev/null
|
|
|
|
|
|
|
|
built_plat_pub_vers_cil := $(LOCAL_BUILT_MODULE)
|
|
|
|
|
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
# vendor_policy.cil - the vendor sepolicy. This needs attributization and to be combined
|
|
|
|
# with the platform-provided policy. It makes use of the reqd_policy_mask files from private
|
|
|
|
# policy and the platform public policy files in order to use checkpolicy.
|
|
|
|
LOCAL_MODULE := vendor_sepolicy.cil
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_PROPRIETARY_MODULE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
vendor_policy.conf := $(intermediates)/vendor_policy.conf
|
|
|
|
$(vendor_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(vendor_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
|
|
|
$(vendor_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
|
|
|
$(vendor_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
|
|
|
$(vendor_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(vendor_policy.conf): PRIVATE_SEPOLICY_SPLIT := $(PRODUCT_SEPOLICY_SPLIT)
|
|
|
|
$(vendor_policy.conf): PRIVATE_COMPATIBLE_PROPERTY := $(PRODUCT_COMPATIBLE_PROPERTY)
|
|
|
|
$(vendor_policy.conf): $(call build_policy, $(sepolicy_build_files), \
|
|
|
|
$(PLAT_PUBLIC_POLICY) $(REQD_MASK_POLICY) $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS))
|
2017-07-07 23:59:51 +02:00
|
|
|
$(transform-policy-to-conf)
|
2013-03-27 11:30:25 +01:00
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_policy_raw := $(intermediates)/vendor_policy_raw.cil
|
|
|
|
$(vendor_policy_raw): PRIVATE_POL_CONF := $(vendor_policy.conf)
|
|
|
|
$(vendor_policy_raw): PRIVATE_REQD_MASK := $(reqd_policy_mask.cil)
|
|
|
|
$(vendor_policy_raw): $(HOST_OUT_EXECUTABLES)/checkpolicy $(vendor_policy.conf) \
|
2018-02-02 01:00:38 +01:00
|
|
|
$(reqd_policy_mask.cil)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $< -C -M -c $(POLICYVERS) -o $@.tmp $(PRIVATE_POL_CONF)
|
|
|
|
$(hide) grep -Fxv -f $(PRIVATE_REQD_MASK) $@.tmp > $@
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_VERS := $(BOARD_SEPOLICY_VERS)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_TGT_POL := $(vendor_policy_raw)
|
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_DEP_CIL_FILES := $(built_plat_cil) $(built_plat_pub_vers_cil) $(built_mapping_cil)
|
|
|
|
$(LOCAL_BUILT_MODULE) : PRIVATE_FILTER_CIL := $(built_plat_pub_vers_cil)
|
|
|
|
$(LOCAL_BUILT_MODULE) : $(plat_pub_policy.cil) $(vendor_policy_raw) \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/version_policy $(HOST_OUT_EXECUTABLES)/secilc \
|
|
|
|
$(built_plat_cil) $(built_plat_pub_vers_cil) $(built_mapping_cil)
|
2016-10-12 23:58:09 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(HOST_OUT_EXECUTABLES)/version_policy -b $< -t $(PRIVATE_TGT_POL) -n $(PRIVATE_VERS) -o $@.tmp
|
|
|
|
$(hide) grep -Fxv -f $(PRIVATE_FILTER_CIL) $@.tmp > $@
|
2018-02-02 01:00:38 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -N -c $(POLICYVERS) \
|
|
|
|
$(PRIVATE_DEP_CIL_FILES) $@ -o /dev/null -f /dev/null
|
2016-10-12 23:58:09 +02:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_cil := $(LOCAL_BUILT_MODULE)
|
|
|
|
vendor_policy.conf :=
|
|
|
|
vendor_policy_raw :=
|
2016-11-28 16:20:28 +01:00
|
|
|
|
2017-03-07 23:05:57 +01:00
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := precompiled_sepolicy
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_PROPRIETARY_MODULE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
all_cil_files := \
|
|
|
|
$(built_plat_cil) \
|
|
|
|
$(built_mapping_cil) \
|
|
|
|
$(built_plat_pub_vers_cil) \
|
|
|
|
$(built_vendor_cil)
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(all_cil_files)
|
2018-01-04 01:53:24 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_NEVERALLOW_ARG := $(NEVERALLOW_ARG)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(all_cil_files) $(built_sepolicy_neverallows)
|
2018-01-04 01:53:24 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -c $(POLICYVERS) $(PRIVATE_NEVERALLOW_ARG) \
|
2017-03-07 23:05:57 +01:00
|
|
|
$(PRIVATE_CIL_FILES) -o $@ -f /dev/null
|
|
|
|
|
|
|
|
built_precompiled_sepolicy := $(LOCAL_BUILT_MODULE)
|
2018-02-05 10:34:52 +01:00
|
|
|
all_cil_files :=
|
2017-03-07 23:05:57 +01:00
|
|
|
|
|
|
|
#################################
|
2017-04-04 23:27:41 +02:00
|
|
|
# SHA-256 digest of the plat_sepolicy.cil and mapping_sepolicy.cil files against
|
|
|
|
# which precompiled_policy was built.
|
2017-03-07 23:05:57 +01:00
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
2017-04-04 23:27:41 +02:00
|
|
|
LOCAL_MODULE := precompiled_sepolicy.plat_and_mapping.sha256
|
2017-03-07 23:05:57 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_PROPRIETARY_MODULE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2017-04-04 23:27:41 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(built_plat_cil) $(built_mapping_cil)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(built_precompiled_sepolicy) $(built_plat_cil) $(built_mapping_cil)
|
|
|
|
cat $(PRIVATE_CIL_FILES) | sha256sum | cut -d' ' -f1 > $@
|
2017-03-07 23:05:57 +01:00
|
|
|
|
2016-11-28 16:20:28 +01:00
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
2016-12-16 00:28:44 +01:00
|
|
|
# build this target so that we can still perform neverallow checks
|
2016-11-28 16:20:28 +01:00
|
|
|
|
|
|
|
LOCAL_MODULE := sepolicy
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2016-12-17 01:53:26 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2016-10-12 23:58:09 +02:00
|
|
|
|
2016-11-28 16:20:28 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2016-10-12 23:58:09 +02:00
|
|
|
all_cil_files := \
|
2017-04-22 00:57:07 +02:00
|
|
|
$(built_plat_cil) \
|
|
|
|
$(built_mapping_cil) \
|
2018-02-05 10:34:52 +01:00
|
|
|
$(built_plat_pub_vers_cil) \
|
|
|
|
$(built_vendor_cil)
|
2016-10-12 23:58:09 +02:00
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(all_cil_files)
|
2018-01-04 01:53:24 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_NEVERALLOW_ARG := $(NEVERALLOW_ARG)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $(all_cil_files) \
|
|
|
|
$(built_sepolicy_neverallows)
|
2016-10-12 23:58:09 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2018-01-04 01:53:24 +01:00
|
|
|
$(hide) $< -m -M true -G -c $(POLICYVERS) $(PRIVATE_NEVERALLOW_ARG) $(PRIVATE_CIL_FILES) -o $@.tmp -f /dev/null
|
2016-02-27 05:06:52 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains
|
|
|
|
$(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \
|
|
|
|
echo "==========" 1>&2; \
|
|
|
|
echo "ERROR: permissive domains not allowed in user builds" 1>&2; \
|
|
|
|
echo "List of invalid domains:" 1>&2; \
|
|
|
|
cat $@.permissivedomains 1>&2; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
$(hide) mv $@.tmp $@
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2012-10-26 04:01:31 +02:00
|
|
|
built_sepolicy := $(LOCAL_BUILT_MODULE)
|
2016-10-12 23:58:09 +02:00
|
|
|
all_cil_files :=
|
2012-10-02 18:46:37 +02:00
|
|
|
|
2017-03-10 18:36:07 +01:00
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
# keep concrete sepolicy for neverallow checks
|
2018-01-04 01:53:24 +01:00
|
|
|
# If SELINUX_IGNORE_NEVERALLOWS is set, we use sed to remove the neverallow lines before compiling.
|
2017-03-10 18:36:07 +01:00
|
|
|
|
|
|
|
LOCAL_MODULE := sepolicy.recovery
|
2017-03-10 21:44:16 +01:00
|
|
|
LOCAL_MODULE_STEM := sepolicy
|
2017-03-10 18:36:07 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-03-10 21:44:16 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
|
2017-03-10 18:36:07 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2017-04-11 16:38:48 +02:00
|
|
|
sepolicy.recovery.conf := $(intermediates)/sepolicy.recovery.conf
|
|
|
|
$(sepolicy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(sepolicy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
|
|
|
$(sepolicy.recovery.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
|
|
|
$(sepolicy.recovery.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
|
|
|
$(sepolicy.recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2017-07-07 23:59:51 +02:00
|
|
|
$(sepolicy.recovery.conf): PRIVATE_TGT_RECOVERY := -D target_recovery=true
|
2017-04-11 16:38:48 +02:00
|
|
|
$(sepolicy.recovery.conf): $(call build_policy, $(sepolicy_build_files), \
|
|
|
|
$(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY) \
|
2018-02-05 10:34:52 +01:00
|
|
|
$(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS))
|
2017-07-07 23:59:51 +02:00
|
|
|
$(transform-policy-to-conf)
|
2016-12-16 00:28:44 +01:00
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
2018-01-04 01:53:24 +01:00
|
|
|
ifeq ($(SELINUX_IGNORE_NEVERALLOWS),true)
|
|
|
|
$(hide) sed -z 's/\n\s*neverallow[^;]*;/\n/g' $@ > $@.neverallow
|
|
|
|
$(hide) mv $@.neverallow $@
|
|
|
|
endif
|
2016-12-16 00:28:44 +01:00
|
|
|
|
2017-04-11 16:38:48 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(sepolicy.recovery.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/sepolicy-analyze
|
2016-12-16 00:28:44 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2017-04-28 02:16:13 +02:00
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c \
|
|
|
|
$(POLICYVERS) -o $@.tmp $<
|
2016-02-27 05:06:52 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains
|
|
|
|
$(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \
|
|
|
|
echo "==========" 1>&2; \
|
|
|
|
echo "ERROR: permissive domains not allowed in user builds" 1>&2; \
|
|
|
|
echo "List of invalid domains:" 1>&2; \
|
|
|
|
cat $@.permissivedomains 1>&2; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
$(hide) mv $@.tmp $@
|
2014-05-29 22:40:15 +02:00
|
|
|
|
2017-04-11 16:38:48 +02:00
|
|
|
sepolicy.recovery.conf :=
|
2014-05-29 22:40:15 +02:00
|
|
|
|
2017-04-06 23:45:50 +02:00
|
|
|
##################################
|
|
|
|
# SELinux policy embedded into CTS.
|
|
|
|
# CTS checks neverallow rules of this policy against the policy of the device under test.
|
2014-07-26 04:11:52 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := general_sepolicy.conf
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_MLS_CATS := $(MLS_CATS)
|
2016-12-16 00:28:44 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_TGT_ARCH := $(my_target_arch)
|
2017-07-07 23:59:51 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_WITH_ASAN := false
|
2017-11-09 20:24:56 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY_SPLIT := cts
|
2016-07-22 22:13:11 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): $(call build_policy, $(sepolicy_build_files), \
|
|
|
|
$(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
|
2017-07-07 23:59:51 +02:00
|
|
|
$(transform-policy-to-conf)
|
2014-07-26 04:11:52 +02:00
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
|
|
|
|
2015-06-30 01:31:23 +02:00
|
|
|
##################################
|
2016-12-12 18:29:04 +01:00
|
|
|
# TODO - remove this. Keep around until we get the filesystem creation stuff taken care of.
|
|
|
|
#
|
2015-06-30 01:31:23 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-08-06 18:43:52 +02:00
|
|
|
LOCAL_MODULE := file_contexts.bin
|
2012-01-18 02:51:09 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
|
2012-03-06 17:12:41 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2016-01-04 21:20:57 +01:00
|
|
|
# The file_contexts.bin is built in the following way:
|
|
|
|
# 1. Collect all file_contexts files in THIS repository and process them with
|
|
|
|
# m4 into a tmp file called file_contexts.local.tmp.
|
|
|
|
# 2. Collect all device specific file_contexts files and process them with m4
|
|
|
|
# into a tmp file called file_contexts.device.tmp.
|
|
|
|
# 3. Run checkfc -e (allow no device fc entries ie empty) and fc_sort on
|
|
|
|
# file_contexts.device.tmp and output to file_contexts.device.sorted.tmp.
|
|
|
|
# 4. Concatenate file_contexts.local.tmp and file_contexts.device.tmp into
|
|
|
|
# file_contexts.concat.tmp.
|
|
|
|
# 5. Run checkfc and sefcontext_compile on file_contexts.concat.tmp to produce
|
|
|
|
# file_contexts.bin.
|
|
|
|
#
|
|
|
|
# Note: That a newline file is placed between each file_context file found to
|
|
|
|
# ensure a proper build when an fc file is missing an ending newline.
|
|
|
|
|
2017-05-08 23:26:52 +02:00
|
|
|
local_fc_files := $(call build_policy, file_contexts, $(PLAT_PRIVATE_POLICY))
|
|
|
|
|
2015-09-18 21:05:51 +02:00
|
|
|
ifneq ($(filter address,$(SANITIZE_TARGET)),)
|
2017-05-08 23:26:52 +02:00
|
|
|
local_fc_files := $(local_fc_files) $(wildcard $(addsuffix /file_contexts_asan, $(PLAT_PRIVATE_POLICY)))
|
2015-06-13 02:18:20 +02:00
|
|
|
endif
|
2016-01-04 21:20:57 +01:00
|
|
|
local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl))
|
|
|
|
|
|
|
|
file_contexts.local.tmp := $(intermediates)/file_contexts.local.tmp
|
|
|
|
$(file_contexts.local.tmp): $(local_fcfiles_with_nl)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $^ > $@
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
device_fc_files := $(call build_vendor_policy, file_contexts)
|
2016-01-04 21:20:57 +01:00
|
|
|
device_fcfiles_with_nl := $(call add_nl, $(device_fc_files), $(built_nl))
|
|
|
|
|
|
|
|
file_contexts.device.tmp := $(intermediates)/file_contexts.device.tmp
|
|
|
|
$(file_contexts.device.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(file_contexts.device.tmp): $(device_fcfiles_with_nl)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
|
|
|
|
|
|
|
|
file_contexts.device.sorted.tmp := $(intermediates)/file_contexts.device.sorted.tmp
|
|
|
|
$(file_contexts.device.sorted.tmp): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(file_contexts.device.sorted.tmp): $(file_contexts.device.tmp) $(built_sepolicy) \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/fc_sort $(HOST_OUT_EXECUTABLES)/checkfc
|
2016-01-04 21:20:57 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2016-12-07 20:27:47 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e $(PRIVATE_SEPOLICY) $<
|
2016-01-04 21:20:57 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/fc_sort $< $@
|
2012-10-02 18:46:37 +02:00
|
|
|
|
2016-01-04 21:20:57 +01:00
|
|
|
file_contexts.concat.tmp := $(intermediates)/file_contexts.concat.tmp
|
|
|
|
$(file_contexts.concat.tmp): $(file_contexts.local.tmp) $(file_contexts.device.sorted.tmp)
|
2012-03-06 17:12:41 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2016-01-04 21:20:57 +01:00
|
|
|
$(hide) m4 -s $^ > $@
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2015-09-25 19:18:44 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2016-01-04 21:20:57 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(file_contexts.concat.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc
|
2015-08-06 18:43:52 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2016-12-07 20:27:47 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $<
|
2015-08-06 18:43:52 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $<
|
|
|
|
|
2014-03-20 14:35:08 +01:00
|
|
|
built_fc := $(LOCAL_BUILT_MODULE)
|
2016-01-04 21:20:57 +01:00
|
|
|
local_fc_files :=
|
|
|
|
local_fcfiles_with_nl :=
|
|
|
|
device_fc_files :=
|
|
|
|
device_fcfiles_with_nl :=
|
|
|
|
file_contexts.concat.tmp :=
|
|
|
|
file_contexts.device.sorted.tmp :=
|
|
|
|
file_contexts.device.tmp :=
|
|
|
|
file_contexts.local.tmp :=
|
2012-08-16 19:55:05 +02:00
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
##################################
|
|
|
|
ifneq ($(TARGET_BUILD_VARIANT), user)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := selinux_denial_metadata
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
bug_files := $(call build_policy, bug_map, $(LOCAL_PATH) $(PLAT_PRIVATE_POLICY) $(PLAT_VENDOR_POLICY) $(BOARD_SEPOLICY_DIRS) $(PLAT_PUBLIC_POLICY))
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE) : $(bug_files)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
cat $^ > $@
|
|
|
|
|
|
|
|
bug_files :=
|
|
|
|
endif
|
2015-03-12 22:45:03 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2016-12-12 18:29:04 +01:00
|
|
|
LOCAL_MODULE := plat_file_contexts
|
2015-03-12 22:45:03 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
2016-12-12 18:29:04 +01:00
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-03-08 23:12:54 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
2017-06-08 22:24:15 +02:00
|
|
|
else
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
endif
|
2015-03-12 22:45:03 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2017-05-08 23:26:52 +02:00
|
|
|
local_fc_files := $(call build_policy, file_contexts, $(PLAT_PRIVATE_POLICY))
|
2016-12-12 18:29:04 +01:00
|
|
|
ifneq ($(filter address,$(SANITIZE_TARGET)),)
|
2017-05-08 23:26:52 +02:00
|
|
|
local_fc_files += $(wildcard $(addsuffix /file_contexts_asan, $(PLAT_PRIVATE_POLICY)))
|
2016-12-12 18:29:04 +01:00
|
|
|
endif
|
2017-01-20 04:58:34 +01:00
|
|
|
local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl))
|
2016-12-12 18:29:04 +01:00
|
|
|
|
2017-01-20 04:58:34 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_FC_FILES := $(local_fcfiles_with_nl)
|
2016-12-12 18:29:04 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2017-01-20 04:58:34 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_FC_SORT := $(HOST_OUT_EXECUTABLES)/fc_sort
|
|
|
|
$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/checkfc $(HOST_OUT_EXECUTABLES)/fc_sort \
|
|
|
|
$(local_fcfiles_with_nl) $(built_sepolicy)
|
2015-03-12 22:45:03 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2017-01-20 04:58:34 +01:00
|
|
|
$(hide) m4 -s $(PRIVATE_FC_FILES) > $@.tmp
|
|
|
|
$(hide) $< $(PRIVATE_SEPOLICY) $@.tmp
|
|
|
|
$(hide) $(PRIVATE_FC_SORT) $@.tmp $@
|
2015-03-12 22:45:03 +01:00
|
|
|
|
2016-12-12 18:29:04 +01:00
|
|
|
built_plat_fc := $(LOCAL_BUILT_MODULE)
|
|
|
|
local_fc_files :=
|
2017-01-20 04:58:34 +01:00
|
|
|
local_fcfiles_with_nl :=
|
2016-12-12 18:29:04 +01:00
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_file_contexts
|
2016-12-12 18:29:04 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-03-08 23:12:54 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
2017-06-08 22:24:15 +02:00
|
|
|
else
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
endif
|
2016-12-12 18:29:04 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_fc_files := $(call build_vendor_policy, file_contexts)
|
|
|
|
vendor_fcfiles_with_nl := $(call add_nl, $(vendor_fc_files), $(built_nl))
|
2016-12-12 18:29:04 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_FC_FILES := $(vendor_fcfiles_with_nl)
|
2016-12-12 18:29:04 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_FC_SORT := $(HOST_OUT_EXECUTABLES)/fc_sort
|
|
|
|
$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/checkfc $(HOST_OUT_EXECUTABLES)/fc_sort \
|
2018-02-05 10:34:52 +01:00
|
|
|
$(vendor_fcfiles_with_nl) $(built_sepolicy)
|
2015-08-06 18:43:52 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2016-12-12 18:29:04 +01:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_FC_FILES) > $@.tmp
|
|
|
|
$(hide) $< $(PRIVATE_SEPOLICY) $@.tmp
|
|
|
|
$(hide) $(PRIVATE_FC_SORT) $@.tmp $@
|
2015-08-06 18:43:52 +02:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_fc := $(LOCAL_BUILT_MODULE)
|
|
|
|
vendor_fc_files :=
|
|
|
|
vendor_fcfiles_with_nl :=
|
2015-03-12 22:45:03 +01:00
|
|
|
|
2017-06-13 17:24:17 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := plat_file_contexts.recovery
|
|
|
|
LOCAL_MODULE_STEM := plat_file_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): $(built_plat_fc)
|
|
|
|
$(hide) cp -f $< $@
|
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_file_contexts.recovery
|
|
|
|
LOCAL_MODULE_STEM := vendor_file_contexts
|
2017-06-13 17:24:17 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(built_vendor_fc)
|
2017-06-13 17:24:17 +02:00
|
|
|
$(hide) cp -f $< $@
|
|
|
|
|
2012-01-18 02:51:09 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
2016-12-22 16:15:18 +01:00
|
|
|
LOCAL_MODULE := plat_seapp_contexts
|
2012-01-18 02:51:09 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-03-09 07:28:03 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
|
|
|
else
|
2012-01-18 02:51:09 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2017-03-09 07:28:03 +01:00
|
|
|
endif
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2012-08-16 19:55:05 +02:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2016-12-22 16:15:18 +01:00
|
|
|
plat_sc_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY))
|
2012-08-16 19:55:05 +02:00
|
|
|
|
2012-10-26 04:01:31 +02:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2016-12-22 16:15:18 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(plat_sc_files)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(built_sepolicy) $(plat_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp
|
2012-08-28 00:41:15 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-06-30 22:53:51 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES)
|
2012-01-18 02:51:09 +01:00
|
|
|
|
2016-12-22 16:15:18 +01:00
|
|
|
built_plat_sc := $(LOCAL_BUILT_MODULE)
|
|
|
|
plat_sc_files :=
|
2014-03-20 14:35:08 +01:00
|
|
|
|
2015-03-12 20:46:36 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_seapp_contexts
|
2015-03-12 20:46:36 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
2016-12-22 16:15:18 +01:00
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-03-09 07:28:03 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
else
|
2016-12-22 16:15:18 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2017-03-09 07:28:03 +01:00
|
|
|
endif
|
2015-03-12 20:46:36 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_sc_files := $(call build_policy, seapp_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
|
2017-05-08 23:26:52 +02:00
|
|
|
plat_sc_neverallow_files := $(call build_policy, seapp_contexts, $(PLAT_PRIVATE_POLICY))
|
2015-03-12 20:46:36 +01:00
|
|
|
|
2016-12-22 16:15:18 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(vendor_sc_files)
|
2017-03-07 07:53:09 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SC_NEVERALLOW_FILES := $(plat_sc_neverallow_files)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(built_sepolicy) $(vendor_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp $(plat_sc_neverallow_files)
|
2015-03-12 20:46:36 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2017-09-26 21:58:29 +02:00
|
|
|
$(hide) grep -ihe '^neverallow' $(PRIVATE_SC_NEVERALLOW_FILES) > $@.tmp
|
2017-03-15 00:51:13 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) $@.tmp
|
2015-03-12 20:46:36 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_sc := $(LOCAL_BUILT_MODULE)
|
|
|
|
vendor_sc_files :=
|
2015-03-12 20:46:36 +01:00
|
|
|
|
2015-06-25 20:59:30 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
2016-12-22 16:15:18 +01:00
|
|
|
LOCAL_MODULE := plat_seapp_neverallows
|
2015-06-25 20:59:30 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2017-03-07 07:53:09 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(plat_sc_neverallow_files)
|
2015-06-25 20:59:30 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2017-09-26 21:58:29 +02:00
|
|
|
- $(hide) grep -ihe '^neverallow' $< > $@
|
2015-06-25 20:59:30 +02:00
|
|
|
|
2017-03-07 07:53:09 +01:00
|
|
|
plat_sc_neverallow_files :=
|
2015-06-25 20:59:30 +02:00
|
|
|
|
2012-04-04 16:11:16 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2016-12-28 01:08:44 +01:00
|
|
|
LOCAL_MODULE := plat_property_contexts
|
2012-04-04 16:11:16 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-03-08 22:10:05 +01:00
|
|
|
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-03-08 22:10:05 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
|
|
|
else
|
2012-04-04 16:11:16 +02:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2017-03-08 22:10:05 +01:00
|
|
|
endif
|
2012-04-04 16:11:16 +02:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2016-12-28 01:08:44 +01:00
|
|
|
plat_pcfiles := $(call build_policy, property_contexts, $(PLAT_PRIVATE_POLICY))
|
2017-10-19 09:54:49 +02:00
|
|
|
ifeq ($(PRODUCT_COMPATIBLE_PROPERTY),true)
|
|
|
|
plat_pcfiles += $(LOCAL_PATH)/public/property_contexts
|
|
|
|
endif
|
2015-07-30 20:44:26 +02:00
|
|
|
|
2016-12-28 01:08:44 +01:00
|
|
|
plat_property_contexts.tmp := $(intermediates)/plat_property_contexts.tmp
|
|
|
|
$(plat_property_contexts.tmp): PRIVATE_PC_FILES := $(plat_pcfiles)
|
|
|
|
$(plat_property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(plat_property_contexts.tmp): $(plat_pcfiles)
|
2015-09-29 22:52:37 +02:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@
|
2018-01-04 18:46:48 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(plat_property_contexts.tmp) $(HOST_OUT_EXECUTABLES)/property_info_checker
|
2012-04-04 16:11:16 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2018-01-04 18:46:48 +01:00
|
|
|
$(hide) cp -f $< $@
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/property_info_checker $@
|
2012-04-04 16:11:16 +02:00
|
|
|
|
2016-12-28 01:08:44 +01:00
|
|
|
built_plat_pc := $(LOCAL_BUILT_MODULE)
|
|
|
|
plat_pcfiles :=
|
|
|
|
plat_property_contexts.tmp :=
|
2014-03-20 14:35:08 +01:00
|
|
|
|
2014-06-06 00:52:02 +02:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_property_contexts
|
2015-03-12 22:45:03 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
2016-12-28 01:08:44 +01:00
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-03-08 22:10:05 +01:00
|
|
|
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-03-08 22:10:05 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
else
|
2016-12-28 01:08:44 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2017-03-08 22:10:05 +01:00
|
|
|
endif
|
2015-03-12 22:45:03 +01:00
|
|
|
|
2015-03-13 14:36:57 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_pcfiles := $(call build_policy, property_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
|
2016-12-28 01:08:44 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_property_contexts.tmp := $(intermediates)/vendor_property_contexts.tmp
|
|
|
|
$(vendor_property_contexts.tmp): PRIVATE_PC_FILES := $(vendor_pcfiles)
|
|
|
|
$(vendor_property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(vendor_property_contexts.tmp): $(vendor_pcfiles)
|
2015-09-29 22:52:37 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2016-12-28 01:08:44 +01:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@
|
2015-09-29 22:52:37 +02:00
|
|
|
|
2016-12-28 01:08:44 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(vendor_property_contexts.tmp) $(HOST_OUT_EXECUTABLES)/property_info_checker
|
2015-09-29 22:52:37 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2018-01-04 18:46:48 +01:00
|
|
|
$(hide) cp -f $< $@
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/property_info_checker $@
|
2015-09-29 22:52:37 +02:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_pc := $(LOCAL_BUILT_MODULE)
|
|
|
|
vendor_pcfiles :=
|
|
|
|
vendor_property_contexts.tmp :=
|
2015-03-12 22:45:03 +01:00
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2017-03-10 21:44:16 +01:00
|
|
|
LOCAL_MODULE := plat_property_contexts.recovery
|
|
|
|
LOCAL_MODULE_STEM := plat_property_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): $(built_plat_pc)
|
|
|
|
$(hide) cp -f $< $@
|
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_property_contexts.recovery
|
|
|
|
LOCAL_MODULE_STEM := vendor_property_contexts
|
2017-03-10 21:44:16 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(built_vendor_pc)
|
2017-03-10 21:44:16 +01:00
|
|
|
$(hide) cp -f $< $@
|
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2016-12-28 00:10:48 +01:00
|
|
|
LOCAL_MODULE := plat_service_contexts
|
2014-06-06 00:52:02 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-03-09 07:28:03 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
|
|
|
else
|
2014-06-06 00:52:02 +02:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2017-03-09 07:28:03 +01:00
|
|
|
endif
|
2014-06-06 00:52:02 +02:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2016-12-28 00:10:48 +01:00
|
|
|
plat_svcfiles := $(call build_policy, service_contexts, $(PLAT_PRIVATE_POLICY))
|
2014-06-06 00:52:02 +02:00
|
|
|
|
2016-12-28 00:10:48 +01:00
|
|
|
plat_service_contexts.tmp := $(intermediates)/plat_service_contexts.tmp
|
|
|
|
$(plat_service_contexts.tmp): PRIVATE_SVC_FILES := $(plat_svcfiles)
|
|
|
|
$(plat_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(plat_service_contexts.tmp): $(plat_svcfiles)
|
2015-09-29 23:17:38 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2015-10-01 23:22:16 +02:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
|
2015-09-29 23:17:38 +02:00
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2016-12-28 00:10:48 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(plat_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
2015-09-29 23:17:38 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2016-04-06 20:53:04 +02:00
|
|
|
sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
|
2016-12-07 20:27:47 +01:00
|
|
|
$(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
|
2014-06-06 00:52:02 +02:00
|
|
|
|
2016-12-28 00:10:48 +01:00
|
|
|
built_plat_svc := $(LOCAL_BUILT_MODULE)
|
|
|
|
plat_svcfiles :=
|
|
|
|
plat_service_contexts.tmp :=
|
2014-06-06 00:52:02 +02:00
|
|
|
|
2012-07-30 15:33:03 +02:00
|
|
|
##################################
|
2017-09-05 15:51:52 +02:00
|
|
|
# nonplat_service_contexts is only allowed on non-full-treble devices
|
2017-11-09 20:24:56 +01:00
|
|
|
ifneq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-09-05 15:51:52 +02:00
|
|
|
|
2012-07-30 15:33:03 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_service_contexts
|
2015-03-12 22:45:03 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
2016-12-28 00:10:48 +01:00
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
2015-03-12 22:45:03 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_svcfiles := $(call build_policy, service_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
|
2016-12-28 00:10:48 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_service_contexts.tmp := $(intermediates)/vendor_service_contexts.tmp
|
|
|
|
$(vendor_service_contexts.tmp): PRIVATE_SVC_FILES := $(vendor_svcfiles)
|
|
|
|
$(vendor_service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(vendor_service_contexts.tmp): $(vendor_svcfiles)
|
2015-09-29 23:17:38 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2016-12-28 00:10:48 +01:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
|
2015-09-29 23:17:38 +02:00
|
|
|
|
2016-12-28 00:10:48 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(vendor_service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
2015-09-29 23:17:38 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2016-04-06 20:53:04 +02:00
|
|
|
sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
|
2016-12-07 20:27:47 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@
|
2015-09-29 23:17:38 +02:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_svc := $(LOCAL_BUILT_MODULE)
|
|
|
|
vendor_svcfiles :=
|
|
|
|
vendor_service_contexts.tmp :=
|
2015-03-12 22:45:03 +01:00
|
|
|
|
2017-09-05 15:51:52 +02:00
|
|
|
endif
|
|
|
|
|
2015-03-12 22:45:03 +01:00
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2017-04-08 01:14:43 +02:00
|
|
|
LOCAL_MODULE := plat_hwservice_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-04-08 01:14:43 +02:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
|
|
|
else
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
plat_hwsvcfiles := $(call build_policy, hwservice_contexts, $(PLAT_PRIVATE_POLICY))
|
|
|
|
|
|
|
|
plat_hwservice_contexts.tmp := $(intermediates)/plat_hwservice_contexts.tmp
|
|
|
|
$(plat_hwservice_contexts.tmp): PRIVATE_SVC_FILES := $(plat_hwsvcfiles)
|
|
|
|
$(plat_hwservice_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(plat_hwservice_contexts.tmp): $(plat_hwsvcfiles)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(plat_hwservice_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
|
|
|
|
$(HOST_OUT_EXECUTABLES)/checkfc -e -l $(PRIVATE_SEPOLICY) $@
|
|
|
|
|
|
|
|
plat_hwsvcfiles :=
|
|
|
|
plat_hwservice_contexts.tmp :=
|
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_hwservice_contexts
|
2017-04-08 01:14:43 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-04-08 01:14:43 +02:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
else
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_hwsvcfiles := $(call build_policy, hwservice_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
|
2017-04-08 01:14:43 +02:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_hwservice_contexts.tmp := $(intermediates)/vendor_hwservice_contexts.tmp
|
|
|
|
$(vendor_hwservice_contexts.tmp): PRIVATE_SVC_FILES := $(vendor_hwsvcfiles)
|
|
|
|
$(vendor_hwservice_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(vendor_hwservice_contexts.tmp): $(vendor_hwsvcfiles)
|
2017-04-08 01:14:43 +02:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): $(vendor_hwservice_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
2017-04-08 01:14:43 +02:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e -l $(PRIVATE_SEPOLICY) $@
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_hwsvcfiles :=
|
|
|
|
vendor_hwservice_contexts.tmp :=
|
|
|
|
|
2017-04-08 01:14:43 +02:00
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2017-04-01 02:29:53 +02:00
|
|
|
LOCAL_MODULE := vndservice_contexts
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-04-01 02:29:53 +02:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
|
|
|
else
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vnd_svcfiles := $(call build_policy, vndservice_contexts, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
|
2017-04-01 02:29:53 +02:00
|
|
|
|
|
|
|
vndservice_contexts.tmp := $(intermediates)/vndservice_contexts.tmp
|
|
|
|
$(vndservice_contexts.tmp): PRIVATE_SVC_FILES := $(vnd_svcfiles)
|
|
|
|
$(vndservice_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(vndservice_contexts.tmp): $(vnd_svcfiles)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@
|
|
|
|
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(vndservice_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
sed -e 's/#.*$$//' -e '/^$$/d' $< > $@
|
2017-04-07 19:08:55 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e -v $(PRIVATE_SEPOLICY) $@
|
2017-04-01 02:29:53 +02:00
|
|
|
|
|
|
|
vnd_svcfiles :=
|
|
|
|
vndservice_contexts.tmp :=
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2016-12-14 22:47:55 +01:00
|
|
|
LOCAL_MODULE := plat_mac_permissions.xml
|
2012-07-30 15:33:03 +02:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-03-11 00:51:23 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/selinux
|
2012-07-30 15:33:03 +02:00
|
|
|
|
2012-11-30 23:59:09 +01:00
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
2012-07-30 15:33:03 +02:00
|
|
|
|
2013-03-26 19:19:12 +01:00
|
|
|
# Build keys.conf
|
2016-12-14 22:47:55 +01:00
|
|
|
plat_mac_perms_keys.tmp := $(intermediates)/plat_keys.tmp
|
|
|
|
$(plat_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(plat_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_PRIVATE_POLICY))
|
2013-03-26 19:19:12 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2015-07-16 20:28:02 +02:00
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
|
2013-03-26 19:19:12 +01:00
|
|
|
|
2016-12-14 22:47:55 +01:00
|
|
|
all_plat_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_PRIVATE_POLICY))
|
2012-07-30 15:33:03 +02:00
|
|
|
|
2016-05-13 09:04:58 +02:00
|
|
|
# Should be synced with keys.conf.
|
2016-12-14 22:47:55 +01:00
|
|
|
all_plat_keys := platform media shared testkey
|
|
|
|
all_plat_keys := $(all_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem)
|
2016-05-13 09:04:58 +02:00
|
|
|
|
2016-12-14 22:47:55 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_plat_mac_perms_files)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(plat_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
|
|
|
|
$(all_plat_mac_perms_files) $(all_plat_keys)
|
2013-03-26 19:19:12 +01:00
|
|
|
@mkdir -p $(dir $@)
|
2013-10-25 21:25:36 +02:00
|
|
|
$(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \
|
2015-07-30 20:44:26 +02:00
|
|
|
$(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
|
2013-03-26 19:19:12 +01:00
|
|
|
|
2015-07-30 20:44:26 +02:00
|
|
|
all_mac_perms_files :=
|
2016-12-14 22:47:55 +01:00
|
|
|
all_plat_keys :=
|
|
|
|
plat_mac_perms_keys.tmp :=
|
|
|
|
|
|
|
|
##################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
LOCAL_MODULE := vendor_mac_permissions.xml
|
2016-12-14 22:47:55 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2017-03-11 00:51:23 +01:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/selinux
|
2016-12-14 22:47:55 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
|
|
|
# Build keys.conf
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_mac_perms_keys.tmp := $(intermediates)/vendor_keys.tmp
|
|
|
|
$(vendor_mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
|
|
|
$(vendor_mac_perms_keys.tmp): $(call build_policy, keys.conf, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
|
2016-12-14 22:47:55 +01:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
all_vendor_mac_perms_files := $(call build_policy, mac_permissions.xml, $(PLAT_VENDOR_POLICY) $(BOARD_VENDOR_SEPOLICY_DIRS) $(REQD_MASK_POLICY))
|
2016-12-14 22:47:55 +01:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_vendor_mac_perms_files)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(vendor_mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py \
|
|
|
|
$(all_vendor_mac_perms_files)
|
2016-12-14 22:47:55 +01:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES)
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
vendor_mac_perms_keys.tmp :=
|
|
|
|
all_vendor_mac_perms_files :=
|
2015-07-30 20:44:26 +02:00
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
#################################
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := sepolicy_tests
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
all_fc_files := $(built_plat_fc) $(built_vendor_fc)
|
|
|
|
all_fc_args := $(foreach file, $(all_fc_files), -f $(file))
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
sepolicy_tests := $(intermediates)/sepolicy_tests
|
2018-02-05 10:34:52 +01:00
|
|
|
$(sepolicy_tests): ALL_FC_ARGS := $(all_fc_args)
|
2017-09-26 21:58:29 +02:00
|
|
|
$(sepolicy_tests): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2018-02-05 10:34:52 +01:00
|
|
|
$(sepolicy_tests): $(HOST_OUT_EXECUTABLES)/sepolicy_tests $(all_fc_files) $(built_sepolicy)
|
2017-09-26 21:58:29 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2017-10-04 18:42:29 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/sepolicy_tests -l $(HOST_OUT)/lib64/libsepolwrap.$(SHAREDLIB_EXT) \
|
2018-02-05 10:34:52 +01:00
|
|
|
$(ALL_FC_ARGS) -p $(PRIVATE_SEPOLICY)
|
2017-09-26 21:58:29 +02:00
|
|
|
$(hide) touch $@
|
|
|
|
|
2014-03-20 14:35:08 +01:00
|
|
|
##################################
|
2017-11-09 20:24:56 +01:00
|
|
|
ifeq ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-06-01 00:36:07 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
# For Treble builds run tests verifying that processes are properly labeled and
|
2017-09-26 21:58:29 +02:00
|
|
|
# permissions granted do not violate the treble model. Also ensure that treble
|
|
|
|
# compatibility guarantees are upheld between SELinux version bumps.
|
2017-06-01 00:36:07 +02:00
|
|
|
LOCAL_MODULE := treble_sepolicy_tests
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
# 26.0_plat - the platform policy shipped as part of the 26.0 release. This is
|
|
|
|
# built to enable us to determine the diff between the current policy and the
|
|
|
|
# 26.0 policy, which will be used in tests to make sure that compatibility has
|
|
|
|
# been maintained by our mapping files.
|
|
|
|
26.0_PLAT_PUBLIC_POLICY := $(LOCAL_PATH)/prebuilts/api/26.0/public
|
|
|
|
26.0_PLAT_PRIVATE_POLICY := $(LOCAL_PATH)/prebuilts/api/26.0/private
|
|
|
|
26.0_plat_policy.conf := $(intermediates)/26.0_plat_policy.conf
|
|
|
|
$(26.0_plat_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(26.0_plat_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
|
|
|
$(26.0_plat_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
|
|
|
$(26.0_plat_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
|
|
|
$(26.0_plat_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2017-11-09 20:24:56 +01:00
|
|
|
$(26.0_plat_policy.conf): PRIVATE_SEPOLICY_SPLIT := true
|
2017-09-26 21:58:29 +02:00
|
|
|
$(26.0_plat_policy.conf): $(call build_policy, $(sepolicy_build_files), \
|
|
|
|
$(26.0_PLAT_PUBLIC_POLICY) $(26.0_PLAT_PRIVATE_POLICY))
|
|
|
|
$(transform-policy-to-conf)
|
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
|
|
|
|
|
|
|
built_26.0_plat_sepolicy := $(intermediates)/built_26.0_plat_sepolicy
|
|
|
|
$(built_26.0_plat_sepolicy): PRIVATE_ADDITIONAL_CIL_FILES := \
|
|
|
|
$(call build_policy, technical_debt.cil , $(26.0_PLAT_PRIVATE_POLICY))
|
2018-01-04 01:53:24 +01:00
|
|
|
$(built_26.0_plat_sepolicy): PRIVATE_NEVERALLOW_ARG := $(NEVERALLOW_ARG)
|
2017-09-26 21:58:29 +02:00
|
|
|
$(built_26.0_plat_sepolicy): $(26.0_plat_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/secilc \
|
2018-01-04 01:53:24 +01:00
|
|
|
$(call build_policy, technical_debt.cil, $(26.0_PLAT_PRIVATE_POLICY)) \
|
|
|
|
$(built_sepolicy_neverallows)
|
2017-09-26 21:58:29 +02:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c \
|
|
|
|
$(POLICYVERS) -o $@ $<
|
|
|
|
$(hide) cat $(PRIVATE_ADDITIONAL_CIL_FILES) >> $@
|
2018-01-04 01:53:24 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -c $(POLICYVERS) $(PRIVATE_NEVERALLOW_ARG) $@ -o $@ -f /dev/null
|
2017-09-26 21:58:29 +02:00
|
|
|
|
|
|
|
26.0_plat_policy.conf :=
|
|
|
|
|
|
|
|
|
|
|
|
# 26.0_compat - the current plat_sepolicy.cil built with the compatibility file
|
|
|
|
# targeting the 26.0 SELinux release. This ensures that our policy will build
|
|
|
|
# when used on a device that has non-platform policy targetting the 26.0 release.
|
|
|
|
26.0_compat := $(intermediates)/26.0_compat
|
|
|
|
26.0_mapping.cil := $(LOCAL_PATH)/private/compat/26.0/26.0.cil
|
|
|
|
26.0_mapping.ignore.cil := $(LOCAL_PATH)/private/compat/26.0/26.0.ignore.cil
|
|
|
|
26.0_nonplat := $(LOCAL_PATH)/prebuilts/api/26.0/nonplat_sepolicy.cil
|
|
|
|
$(26.0_compat): PRIVATE_CIL_FILES := \
|
|
|
|
$(built_plat_cil) $(26.0_mapping.cil) $(26.0_nonplat)
|
|
|
|
$(26.0_compat): $(HOST_OUT_EXECUTABLES)/secilc \
|
|
|
|
$(built_plat_cil) $(26.0_mapping.cil) $(26.0_nonplat)
|
2017-10-07 02:06:04 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -N -c $(POLICYVERS) \
|
2017-09-26 21:58:29 +02:00
|
|
|
$(PRIVATE_CIL_FILES) -o $@ -f /dev/null
|
|
|
|
|
|
|
|
# 26.0_mapping.combined.cil - a combination of the mapping file used when
|
|
|
|
# combining the current platform policy with nonplatform policy based on the
|
|
|
|
# 26.0 policy release and also a special ignored file that exists purely for
|
|
|
|
# these tests.
|
|
|
|
26.0_mapping.combined.cil := $(intermediates)/26.0_mapping.combined.cil
|
|
|
|
$(26.0_mapping.combined.cil): $(26.0_mapping.cil) $(26.0_mapping.ignore.cil)
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
cat $^ > $@
|
|
|
|
|
|
|
|
# plat_sepolicy - the current platform policy only, built into a policy binary.
|
|
|
|
# TODO - this currently excludes partner extensions, but support should be added
|
|
|
|
# to enable partners to add their own compatibility mapping
|
|
|
|
BASE_PLAT_PUBLIC_POLICY := $(filter-out $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR), $(PLAT_PUBLIC_POLICY))
|
|
|
|
BASE_PLAT_PRIVATE_POLICY := $(filter-out $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR), $(PLAT_PRIVATE_POLICY))
|
|
|
|
base_plat_policy.conf := $(intermediates)/base_plat_policy.conf
|
|
|
|
$(base_plat_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
|
|
|
|
$(base_plat_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
|
|
|
|
$(base_plat_policy.conf): PRIVATE_TGT_ARCH := $(my_target_arch)
|
|
|
|
$(base_plat_policy.conf): PRIVATE_TGT_WITH_ASAN := $(with_asan)
|
|
|
|
$(base_plat_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS)
|
2017-11-09 20:24:56 +01:00
|
|
|
$(base_plat_policy.conf): PRIVATE_SEPOLICY_SPLIT := true
|
2017-10-19 09:54:49 +02:00
|
|
|
$(base_plat_policy.conf): PRIVATE_COMPATIBLE_PROPERTY := $(PRODUCT_COMPATIBLE_PROPERTY)
|
2017-09-26 21:58:29 +02:00
|
|
|
$(base_plat_policy.conf): $(call build_policy, $(sepolicy_build_files), \
|
|
|
|
$(BASE_PLAT_PUBLIC_POLICY) $(BASE_PLAT_PRIVATE_POLICY))
|
|
|
|
$(transform-policy-to-conf)
|
|
|
|
$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
|
|
|
|
|
|
|
|
built_plat_sepolicy := $(intermediates)/built_plat_sepolicy
|
|
|
|
$(built_plat_sepolicy): PRIVATE_ADDITIONAL_CIL_FILES := \
|
|
|
|
$(call build_policy, $(sepolicy_build_cil_workaround_files), $(BASE_PLAT_PRIVATE_POLICY))
|
2018-01-04 01:53:24 +01:00
|
|
|
$(built_plat_sepolicy): PRIVATE_NEVERALLOW_ARG := $(NEVERALLOW_ARG)
|
2017-09-26 21:58:29 +02:00
|
|
|
$(built_plat_sepolicy): $(base_plat_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/secilc \
|
2018-01-04 01:53:24 +01:00
|
|
|
$(call build_policy, $(sepolicy_build_cil_workaround_files), $(BASE_PLAT_PRIVATE_POLICY)) \
|
|
|
|
$(built_sepolicy_neverallows)
|
2017-09-26 21:58:29 +02:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(CHECKPOLICY_ASAN_OPTIONS) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c \
|
|
|
|
$(POLICYVERS) -o $@ $<
|
|
|
|
$(hide) cat $(PRIVATE_ADDITIONAL_CIL_FILES) >> $@
|
2018-01-04 01:53:24 +01:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -c $(POLICYVERS) $(PRIVATE_NEVERALLOW_ARG) $@ -o $@ -f /dev/null
|
2017-09-26 21:58:29 +02:00
|
|
|
|
2018-02-05 10:34:52 +01:00
|
|
|
all_fc_files := $(built_plat_fc) $(built_vendor_fc)
|
|
|
|
all_fc_args := $(foreach file, $(all_fc_files), -f $(file))
|
|
|
|
|
2017-06-01 00:36:07 +02:00
|
|
|
treble_sepolicy_tests := $(intermediates)/treble_sepolicy_tests
|
2018-02-05 10:34:52 +01:00
|
|
|
$(treble_sepolicy_tests): ALL_FC_ARGS := $(all_fc_args)
|
2017-06-01 00:36:07 +02:00
|
|
|
$(treble_sepolicy_tests): PRIVATE_SEPOLICY := $(built_sepolicy)
|
2017-09-26 21:58:29 +02:00
|
|
|
$(treble_sepolicy_tests): PRIVATE_SEPOLICY_OLD := $(built_26.0_plat_sepolicy)
|
|
|
|
$(treble_sepolicy_tests): PRIVATE_COMBINED_MAPPING := $(26.0_mapping.combined.cil)
|
|
|
|
$(treble_sepolicy_tests): PRIVATE_PLAT_SEPOLICY := $(built_plat_sepolicy)
|
|
|
|
ifeq ($(PRODUCT_FULL_TREBLE_OVERRIDE),true)
|
|
|
|
$(treble_sepolicy_tests): PRIVATE_FAKE_TREBLE := --fake-treble
|
|
|
|
else
|
|
|
|
$(treble_sepolicy_tests): PRIVATE_FAKE_TREBLE :=
|
|
|
|
endif
|
2017-09-23 23:42:50 +02:00
|
|
|
$(treble_sepolicy_tests): $(HOST_OUT_EXECUTABLES)/treble_sepolicy_tests \
|
2018-02-05 10:34:52 +01:00
|
|
|
$(all_fc_files) $(built_sepolicy) $(built_plat_sepolicy) \
|
|
|
|
$(built_26.0_plat_sepolicy) $(26.0_compat) $(26.0_mapping.combined.cil)
|
2017-06-01 00:36:07 +02:00
|
|
|
@mkdir -p $(dir $@)
|
2017-09-24 00:11:25 +02:00
|
|
|
$(hide) $(HOST_OUT_EXECUTABLES)/treble_sepolicy_tests -l \
|
2018-02-05 10:34:52 +01:00
|
|
|
$(HOST_OUT)/lib64/libsepolwrap.$(SHAREDLIB_EXT) $(ALL_FC_ARGS) \
|
2017-09-26 21:58:29 +02:00
|
|
|
-b $(PRIVATE_PLAT_SEPOLICY) -m $(PRIVATE_COMBINED_MAPPING) \
|
|
|
|
-o $(PRIVATE_SEPOLICY_OLD) -p $(PRIVATE_SEPOLICY) \
|
|
|
|
$(PRIVATE_FAKE_TREBLE)
|
2017-06-01 00:36:07 +02:00
|
|
|
$(hide) touch $@
|
2017-09-26 21:58:29 +02:00
|
|
|
|
|
|
|
26.0_PLAT_PUBLIC_POLICY :=
|
|
|
|
26.0_PLAT_PRIVATE_POLICY :=
|
|
|
|
26.0_compat :=
|
|
|
|
26.0_mapping.cil :=
|
|
|
|
26.0_mapping.combined.cil :=
|
|
|
|
26.0_mapping.ignore.cil :=
|
|
|
|
26.0_nonplat :=
|
|
|
|
BASE_PLAT_PUBLIC_POLICY :=
|
|
|
|
BASE_PLAT_PRIVATE_POLICY :=
|
|
|
|
base_plat_policy.conf :=
|
|
|
|
built_26.0_plat_sepolicy :=
|
|
|
|
plat_sepolicy :=
|
|
|
|
|
2017-11-09 20:24:56 +01:00
|
|
|
endif # ($(PRODUCT_SEPOLICY_SPLIT),true)
|
2017-06-01 00:36:07 +02:00
|
|
|
#################################
|
2012-10-18 03:09:52 +02:00
|
|
|
|
2016-12-16 00:28:44 +01:00
|
|
|
add_nl :=
|
2018-02-05 10:34:52 +01:00
|
|
|
build_vendor_policy :=
|
2016-12-16 00:28:44 +01:00
|
|
|
build_policy :=
|
2016-12-12 18:29:04 +01:00
|
|
|
built_plat_fc :=
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_fc :=
|
2015-12-11 11:39:19 +01:00
|
|
|
built_nl :=
|
2017-02-25 23:47:53 +01:00
|
|
|
built_plat_cil :=
|
2018-02-05 10:34:52 +01:00
|
|
|
built_plat_pub_vers_cil :=
|
2017-02-25 23:47:53 +01:00
|
|
|
built_mapping_cil :=
|
2016-12-28 01:08:44 +01:00
|
|
|
built_plat_pc :=
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_cil :=
|
|
|
|
built_vendor_pc :=
|
|
|
|
built_vendor_sc :=
|
2016-12-22 16:15:18 +01:00
|
|
|
built_plat_sc :=
|
2017-03-07 23:05:57 +01:00
|
|
|
built_precompiled_sepolicy :=
|
2016-12-16 00:28:44 +01:00
|
|
|
built_sepolicy :=
|
2018-01-04 01:53:24 +01:00
|
|
|
built_sepolicy_neverallows :=
|
2016-12-28 00:10:48 +01:00
|
|
|
built_plat_svc :=
|
2018-02-05 10:34:52 +01:00
|
|
|
built_vendor_svc :=
|
2017-04-22 00:57:07 +02:00
|
|
|
mapping_policy :=
|
2016-12-16 00:28:44 +01:00
|
|
|
my_target_arch :=
|
2016-11-28 16:20:28 +01:00
|
|
|
plat_pub_policy.cil :=
|
|
|
|
reqd_policy_mask.cil :=
|
2016-12-16 00:28:44 +01:00
|
|
|
sepolicy_build_files :=
|
Mark all clients of Allocator HAL
This change associates all domains which are clients of Allocator HAL
with hal_allocator_client and the, required for all HAL client
domains, halclientdomain.
This enables this commit to remove the now unnecessary hwallocator_use
macro because its binder_call(..., hal_allocator_server) is covered by
binder_call(hal_allocator_client, hal_allocator_server) added in this
commit.
Unfortunately apps, except isolated app, are clients of Allocator HAL
as well. This makes it hard to use the hal_client_domain(...,
hal_allocator) macro because it translates into "typeattribute" which
currently does not support being provided with a set of types, such as
{ appdomain -isolated_app }. As a workaround, hopefully until
typeattribute is improved, this commit expresses the necessary
association operation in CIL. private/technical_debt.cil introduced by
this commit is appended into the platform policy CIL file, thus
ensuring that the hack has effect on the final monolithic policy.
P. S. This change also removes Allocator HAL access from isolated_app.
Isolated app shouldn't have access to this HAL anyway.
Test: Google Play Music plays back radios
Test: Google Camera records video with sound and that video is then
successfully played back with sound
Test: YouTube app plays back clips with sound
Test: YouTube in Chrome plays back clips with sound
Bug: 34170079
Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
2017-03-21 22:28:53 +01:00
|
|
|
sepolicy_build_cil_workaround_files :=
|
2017-03-13 20:22:15 +01:00
|
|
|
with_asan :=
|
2012-11-01 19:33:04 +01:00
|
|
|
|
|
|
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|