Merge changes from topic "logtags_filesystem_module" into main am: 53507d1559
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3066502 Change-Id: I047402199b93062de23b5f4c3dfa9f4bec6fc018 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -127,6 +127,10 @@ type filesystemProperties struct {
|
|||||||
// the make version.
|
// the make version.
|
||||||
Include_make_built_files string
|
Include_make_built_files string
|
||||||
|
|
||||||
|
// When set, builds etc/event-log-tags file by merging logtags from all dependencies.
|
||||||
|
// Default is false
|
||||||
|
Build_logtags *bool
|
||||||
|
|
||||||
Fsverity fsverityProperties
|
Fsverity fsverityProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,6 +292,7 @@ func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) androi
|
|||||||
f.buildNonDepsFiles(ctx, builder, rootDir)
|
f.buildNonDepsFiles(ctx, builder, rootDir)
|
||||||
f.addMakeBuiltFiles(ctx, builder, rootDir)
|
f.addMakeBuiltFiles(ctx, builder, rootDir)
|
||||||
f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
|
f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
|
||||||
|
f.buildEventLogtagsFile(ctx, builder, rebasedDir)
|
||||||
|
|
||||||
// run host_init_verifier
|
// run host_init_verifier
|
||||||
// Ideally we should have a concept of pluggable linters that verify the generated image.
|
// Ideally we should have a concept of pluggable linters that verify the generated image.
|
||||||
@@ -428,6 +433,7 @@ func (f *filesystem) buildCpioImage(ctx android.ModuleContext, compressed bool)
|
|||||||
|
|
||||||
f.buildNonDepsFiles(ctx, builder, rootDir)
|
f.buildNonDepsFiles(ctx, builder, rootDir)
|
||||||
f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
|
f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
|
||||||
|
f.buildEventLogtagsFile(ctx, builder, rebasedDir)
|
||||||
|
|
||||||
output := android.PathForModuleOut(ctx, f.installFileName()).OutputPath
|
output := android.PathForModuleOut(ctx, f.installFileName()).OutputPath
|
||||||
cmd := builder.Command().
|
cmd := builder.Command().
|
||||||
@@ -485,6 +491,37 @@ func (f *filesystem) addMakeBuiltFiles(ctx android.ModuleContext, builder *andro
|
|||||||
Text(android.PathForArbitraryOutput(ctx, stagingDir).String())
|
Text(android.PathForArbitraryOutput(ctx, stagingDir).String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *filesystem) buildEventLogtagsFile(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) {
|
||||||
|
if !proptools.Bool(f.properties.Build_logtags) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
logtagsFilePaths := make(map[string]bool)
|
||||||
|
ctx.WalkDeps(func(child, parent android.Module) bool {
|
||||||
|
if logtagsInfo, ok := android.OtherModuleProvider(ctx, child, android.LogtagsProviderKey); ok {
|
||||||
|
for _, path := range logtagsInfo.Logtags {
|
||||||
|
logtagsFilePaths[path.String()] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
if len(logtagsFilePaths) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
etcPath := rebasedDir.Join(ctx, "etc")
|
||||||
|
eventLogtagsPath := etcPath.Join(ctx, "event-log-tags")
|
||||||
|
builder.Command().Text("mkdir").Flag("-p").Text(etcPath.String())
|
||||||
|
cmd := builder.Command().BuiltTool("merge-event-log-tags").
|
||||||
|
FlagWithArg("-o ", eventLogtagsPath.String()).
|
||||||
|
FlagWithInput("-m ", android.MergedLogtagsPath(ctx))
|
||||||
|
|
||||||
|
for _, path := range android.SortedKeys(logtagsFilePaths) {
|
||||||
|
cmd.Text(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type partition interface {
|
type partition interface {
|
||||||
PartitionType() string
|
PartitionType() string
|
||||||
}
|
}
|
||||||
|
@@ -453,6 +453,8 @@ func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries {
|
|||||||
if app.Name() != "framework-res" {
|
if app.Name() != "framework-res" {
|
||||||
android.SetAconfigFileMkEntries(&app.ModuleBase, entries, app.mergedAconfigFiles)
|
android.SetAconfigFileMkEntries(&app.ModuleBase, entries, app.mergedAconfigFiles)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entries.AddStrings("LOCAL_SOONG_LOGTAGS_FILES", app.logtagsSrcs.Strings()...)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
||||||
|
Reference in New Issue
Block a user