init_rc and vintf_fragments appear in PackagingSpecs()

init_rc and vintf_fragments have been directly translated into
LOCAL_INIT_RC and LOCAL_VINTF_FRAGMENTS and then installed completely in
Make. This is causing problem when a module having either of the
properties is included in an android_filesystem module. The rc or
fragment files are not included in the filesystem module because Soong
doesn't track the files.

This change fixes the problem by calling PackageFile() on the two types
of files so that they appear in PackagingSpecs().

Bug: 181728384
Test: m microdroid_super and inspect the image. It has
/system/etc/init/servicemanager.rc

Change-Id: Ie1443696369b5d2b1e8f520f0f218d33a3dd67b7
This commit is contained in:
Jiyong Park 2021-03-03 20:02:42 +09:00
parent 3bed960399
commit 4d86107c84
1 changed files with 12 additions and 2 deletions

View File

@ -1832,6 +1832,18 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
return
}
m.initRcPaths = PathsForModuleSrc(ctx, m.commonProperties.Init_rc)
rcDir := PathForModuleInstall(ctx, "etc", "init")
for _, src := range m.initRcPaths {
ctx.PackageFile(rcDir, filepath.Base(src.String()), src)
}
m.vintfFragmentsPaths = PathsForModuleSrc(ctx, m.commonProperties.Vintf_fragments)
vintfDir := PathForModuleInstall(ctx, "etc", "vintf", "manifest")
for _, src := range m.vintfFragmentsPaths {
ctx.PackageFile(vintfDir, filepath.Base(src.String()), src)
}
// Create the set of tagged dist files after calling GenerateAndroidBuildActions
// as GenerateTaggedDistFiles() calls OutputFiles(tag) and so relies on the
// output paths being set which must be done before or during
@ -1844,8 +1856,6 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
m.installFiles = append(m.installFiles, ctx.installFiles...)
m.checkbuildFiles = append(m.checkbuildFiles, ctx.checkbuildFiles...)
m.packagingSpecs = append(m.packagingSpecs, ctx.packagingSpecs...)
m.initRcPaths = PathsForModuleSrc(ctx, m.commonProperties.Init_rc)
m.vintfFragmentsPaths = PathsForModuleSrc(ctx, m.commonProperties.Vintf_fragments)
for k, v := range ctx.phonies {
m.phonies[k] = append(m.phonies[k], v...)
}