commit | 232f6ac67604215c1eafad4fd83e1f065e8f936f | [log] [tgz] |
---|---|---|
author | Inseob Kim <inseob@google.com> | Mon Mar 22 22:16:16 2021 +0900 |
committer | Inseob Kim <inseob@google.com> | Mon Mar 22 22:34:40 2021 +0900 |
tree | 18facd9ebf1e4f3d1955e070ab72e331ac0f1968 | |
parent | fd4844272c960b7fd9402d2e40bc34554cd819e8 [diff] |
Add PlatformSepolicyVersion to soong_config PlatformSepolicyVersion and BoardSepolicyVers haven't assigned correctly so far. Below is the reason why it hasn't been discovered yet. DeviceConfig.PlatformSepolicyVersion() was added to support mixed sepolicy build (setting BOARD_SEPOLICY_VERS and building vendor sepolicy with old plat policy files). Soong compares PlatformSepolicyVersion() and BoardSepolicyVers(), and used old vendor sources if both are different. Back then, the only place where such logic played a role was selinux contexts. Test codes were running as intended: after setting BOARD_SEPOLICY_VERS the context files were built against old policies. But there were two mistakes: 1) PlatformSepolicyVersion() was not added to soong_config.mk, so it was always empty. 2) BOARD_SEPOLICY_VERS was set to default in system/sepolicy/Android.mk, which was processed after soong_config. So if BOARD_SEPOLICY_VERS was not set in BoardConfig.mk, BoardSepolicyVers() was empty, not PLATFORM_SEPOLICY_VERSION. And there were no issues as Soong only checked equality. To fix the issue correctly, this commit adds the variable PlatformSepolicyVersion, and then handles BoardSepolicyVers correctly by returning PlatformSepolicyVersion if it's empty. Test: set BOARD_SEPOLICY_VERS and see vendor_file_contexts changes Change-Id: I4e306ec1f5225094a39f0c8d94f5e7683d70d60e
This is the Makefile-based portion of the Android Build System.
For documentation on how to run a build, see Usage.txt
For a list of behavioral changes useful for Android.mk writers see Changes.md
For an outdated reference on Android.mk files, see build-system.html. Our Android.mk files look similar, but are entirely different from the Android.mk files used by the NDK build system. When searching for documentation elsewhere, ensure that it is for the platform build system -- most are not.
This Makefile-based system is in the process of being replaced with Soong, a new build system written in Go. During the transition, all of these makefiles are read by Kati, and generate a ninja file instead of being executed directly. That's combined with a ninja file read by Soong so that the build graph of the two systems can be combined and run as one.