From 916901e36110c97dd5f8e7d52a4b6e9b1e7c2769 Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Wed, 17 Feb 2021 15:48:53 +0900 Subject: [PATCH] Allow uninstallable prebuilt_etc to be packaged Till now, prebuilt_etc has to be installable to be packaged. With this commit, packaging modules like filesystem now can include uninstallable prebuilt_etc. This can help when prebuilt_etc can conflict with other partitions e.g. system. Bug: 179340780 Test: build filesystem with uninstallable prebuilt_etc Change-Id: Id981fe7ce41f1189eb0f85f2d1677d973004423c --- etc/prebuilt_etc.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go index 57563eb07..e15324b3b 100644 --- a/etc/prebuilt_etc.go +++ b/etc/prebuilt_etc.go @@ -282,11 +282,14 @@ func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) { Input: p.sourceFilePath, }) - if p.Installable() { - installPath := ctx.InstallFile(p.installDirPath, p.outputFilePath.Base(), p.outputFilePath) - for _, sl := range p.properties.Symlinks { - ctx.InstallSymlink(p.installDirPath, sl, installPath) - } + if !p.Installable() { + p.SkipInstall() + } + + // Call InstallFile even when uninstallable to make the module included in the package + installPath := ctx.InstallFile(p.installDirPath, p.outputFilePath.Base(), p.outputFilePath) + for _, sl := range p.properties.Symlinks { + ctx.InstallSymlink(p.installDirPath, sl, installPath) } }