From 4d86107c8490066814fd3b0e0de6680349bf1d38 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 3 Mar 2021 20:02:42 +0900 Subject: [PATCH] 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 --- android/module.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/android/module.go b/android/module.go index e8fb7497e..9f923e2d0 100644 --- a/android/module.go +++ b/android/module.go @@ -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...) }