From 8f4547cde94f0e46aec2b7d48225c271ae21f325 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 5 Feb 2018 15:51:34 -0800 Subject: [PATCH 1/2] Move PLATFORM_SEPOLICY_VERSION from system/sepolicy/Android.mk Test: builds Bug: 67920434 Change-Id: I3b29fd188e755039a1fcf4814c578a2220567bf1 --- core/config.mk | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/core/config.mk b/core/config.mk index 69035599e..47e60a88d 100644 --- a/core/config.mk +++ b/core/config.mk @@ -846,6 +846,32 @@ $(KATI_obsolete_var DEVICE_FRAMEWORK_MANIFEST_FILE,No one should ever need to us BUILD_NUMBER_FROM_FILE := $$(cat $(OUT_DIR)/build_number.txt) BUILD_DATETIME_FROM_FILE := $$(cat $(OUT_DIR)/build_date.txt) +# SEPolicy versions + +# 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. +sepolicy_major_vers := 27 +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 := + # ############################################################### # Set up final options. # ############################################################### From 9bf93017d4ed617c0d4f1faf16d0b8fa15519fc0 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 5 Feb 2018 15:52:46 -0800 Subject: [PATCH 2/2] core/config.mk: Add PLATFORM_SEPOLICY_COMPAT_VERSIONS This is a list of sepolicy versions that the framework supports. Test: build framework compatibility matrix Test: boots Bug: 67920434 Change-Id: I82365742172b653eadb7b5315398e06cace4e000 --- core/config.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/config.mk b/core/config.mk index 47e60a88d..a32e9f233 100644 --- a/core/config.mk +++ b/core/config.mk @@ -872,6 +872,11 @@ PLATFORM_SEPOLICY_VERSION := $(join $(addsuffix .,$(sepolicy_major_vers)), $(sep sepolicy_major_vers := sepolicy_minor_vers := +# A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports. +PLATFORM_SEPOLICY_COMPAT_VERSIONS := \ + 26.0 \ + 27.0 + # ############################################################### # Set up final options. # ###############################################################