aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2018-11-14 03:57:28 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-11-14 03:57:28 +0000
commitb9619f0746c7282a01f922bf71f5636a097e4a89 (patch)
tree360a3581e1b1a42c5c0977290bfe4e5056652ded
parent4855c4f4605574f01b2bdcd31b654db6c8eb0fb6 (diff)
parentd0a65bae178f0b8d65a8ab0f71f313baa34031a1 (diff)
downloadbuild_soong-b9619f0746c7282a01f922bf71f5636a097e4a89.tar.gz
build_soong-b9619f0746c7282a01f922bf71f5636a097e4a89.tar.bz2
build_soong-b9619f0746c7282a01f922bf71f5636a097e4a89.zip
Merge "Move file_contexts file for APEXes to under /system/sepolicy"
-rw-r--r--apex/apex.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 3e7c0a79..7232c1b6 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -171,8 +171,10 @@ type apexBundleProperties struct {
// "manifest.json"
Manifest *string
- // File contexts file for setting security context to each file in this APEX bundle
- // Default: "file_contexts".
+ // Determines the file contexts file for setting security context to each file in this APEX bundle.
+ // Specifically, when this is set to <value>, /system/sepolicy/apex/<value>_file_contexts file is
+ // used.
+ // Default: <name_of_this_module>
File_contexts *string
// List of native shared libs that are embedded inside this APEX bundle
@@ -489,7 +491,15 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
})
manifest := android.PathForModuleSrc(ctx, proptools.StringDefault(a.properties.Manifest, "manifest.json"))
- fileContexts := android.PathForModuleSrc(ctx, proptools.StringDefault(a.properties.File_contexts, "file_contexts"))
+
+ fcName := proptools.StringDefault(a.properties.File_contexts, a.ModuleBase.Name())
+ fileContextsPath := "system/sepolicy/apex/" + fcName + "_file_contexts"
+ fileContextsOptionalPath := android.ExistentPathForSource(ctx, fileContextsPath)
+ if !fileContextsOptionalPath.Valid() {
+ ctx.ModuleErrorf("Cannot find file_contexts file: %q", fileContextsPath)
+ return
+ }
+ fileContexts := fileContextsOptionalPath.Path()
unsignedOutputFile := android.PathForModuleOut(ctx, a.ModuleBase.Name()+apexSuffix+".unsigned")