Merge "Allow apex to use generated file_contexts" into main am: 6a4bb378df
am: fb1d783e07
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2836495 Change-Id: I6f13620f38f0f820f6a0a4ee6e8af326ffa6049a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -344,10 +344,12 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
|
|||||||
func (a *apexBundle) buildFileContexts(ctx android.ModuleContext) android.OutputPath {
|
func (a *apexBundle) buildFileContexts(ctx android.ModuleContext) android.OutputPath {
|
||||||
var fileContexts android.Path
|
var fileContexts android.Path
|
||||||
var fileContextsDir string
|
var fileContextsDir string
|
||||||
|
isFileContextsModule := false
|
||||||
if a.properties.File_contexts == nil {
|
if a.properties.File_contexts == nil {
|
||||||
fileContexts = android.PathForSource(ctx, "system/sepolicy/apex", ctx.ModuleName()+"-file_contexts")
|
fileContexts = android.PathForSource(ctx, "system/sepolicy/apex", ctx.ModuleName()+"-file_contexts")
|
||||||
} else {
|
} else {
|
||||||
if m, t := android.SrcIsModuleWithTag(*a.properties.File_contexts); m != "" {
|
if m, t := android.SrcIsModuleWithTag(*a.properties.File_contexts); m != "" {
|
||||||
|
isFileContextsModule = true
|
||||||
otherModule := android.GetModuleFromPathDep(ctx, m, t)
|
otherModule := android.GetModuleFromPathDep(ctx, m, t)
|
||||||
fileContextsDir = ctx.OtherModuleDir(otherModule)
|
fileContextsDir = ctx.OtherModuleDir(otherModule)
|
||||||
}
|
}
|
||||||
@@ -363,7 +365,7 @@ func (a *apexBundle) buildFileContexts(ctx android.ModuleContext) android.Output
|
|||||||
ctx.PropertyErrorf("file_contexts", "should be under system/sepolicy, but found in %q", fileContextsDir)
|
ctx.PropertyErrorf("file_contexts", "should be under system/sepolicy, but found in %q", fileContextsDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !android.ExistentPathForSource(ctx, fileContexts.String()).Valid() {
|
if !isFileContextsModule && !android.ExistentPathForSource(ctx, fileContexts.String()).Valid() {
|
||||||
ctx.PropertyErrorf("file_contexts", "cannot find file_contexts file: %q", fileContexts.String())
|
ctx.PropertyErrorf("file_contexts", "cannot find file_contexts file: %q", fileContexts.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user