summaryrefslogtreecommitdiff
path: root/android/module_context.go
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2024-05-01 16:14:38 +0900
committer Jiyong Park <jiyong@google.com> 2024-05-01 22:43:45 +0900
commit3f627e661a272b6f5b231880815e90f11a60ffe2 (patch)
tree2dc17eea96295851eeb8121bfd09f293da1f1909 /android/module_context.go
parent0141b4acad94d7ccffd6fbbce3cba5eae48a9b95 (diff)
Use no_full_install: true instead of installable: false
So far, we have used `instalable: false` to avoid collision with the other modules that are installed to the same path. A typical example was <foo> and <foo>.microdroid. The latter is a modified version of the former for the inclusion of the microdroid image. They however both have the same instalation path (ex: system/bin) and stem (ex: foo) so that we can reference them using the same path regardless of whether we are in Android or microdroid. However, the use of `installable: false` for the purpose is actually incorrect, because `installable: false` also means, obviously, "this module shouldn't be installed". The only reason this incorrect way has worked is simply because packaging modules (ex: android_filesystem) didn't respect the property when gathering the modules. As packaging modules are now fixed to respect `installable: false`, we need a correct way of avoiding the collision. `no_full_install: true` is it. If a module has this property set to true, it is never installed to the full instal path like out/target/product/<partition>/... It can be installed only via packaging modules. Bug: 338160898 Test: m Change-Id: Iee9be674951d0bf3d5e26432fcbae9afebb6007b
Diffstat (limited to 'android/module_context.go')
-rw-r--r--android/module_context.go21
1 files changed, 18 insertions, 3 deletions
diff --git a/android/module_context.go b/android/module_context.go
index dea22bab4..605d3baeb 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -444,6 +444,21 @@ func (m *moduleContext) skipInstall() bool {
return false
}
+// Tells whether this module is installed to the full install path (ex:
+// out/target/product/<name>/<partition>) or not. If this returns false, the install build rule is
+// not created and this module can only be installed to packaging modules like android_filesystem.
+func (m *moduleContext) requiresFullInstall() bool {
+ if m.skipInstall() {
+ return false
+ }
+
+ if proptools.Bool(m.module.base().commonProperties.No_full_install) {
+ return false
+ }
+
+ return true
+}
+
func (m *moduleContext) InstallFile(installPath InstallPath, name string, srcPath Path,
deps ...InstallPath) InstallPath {
return m.installFile(installPath, name, srcPath, deps, false, true, nil)
@@ -490,7 +505,7 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat
m.module.base().hooks.runInstallHooks(m, srcPath, fullInstallPath, false)
}
- if !m.skipInstall() {
+ if m.requiresFullInstall() {
deps = append(deps, InstallPaths(m.module.base().installFilesDepSet.ToList())...)
deps = append(deps, m.module.base().installedInitRcPaths...)
deps = append(deps, m.module.base().installedVintfFragmentsPaths...)
@@ -563,7 +578,7 @@ func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, src
if err != nil {
panic(fmt.Sprintf("Unable to generate symlink between %q and %q: %s", fullInstallPath.Base(), srcPath.Base(), err))
}
- if !m.skipInstall() {
+ if m.requiresFullInstall() {
if m.Config().KatiEnabled() {
// When creating the symlink rule in Soong but embedding in Make, write the rule to a
@@ -612,7 +627,7 @@ func (m *moduleContext) InstallAbsoluteSymlink(installPath InstallPath, name str
fullInstallPath := installPath.Join(m, name)
m.module.base().hooks.runInstallHooks(m, nil, fullInstallPath, true)
- if !m.skipInstall() {
+ if m.requiresFullInstall() {
if m.Config().KatiEnabled() {
// When creating the symlink rule in Soong but embedding in Make, write the rule to a
// makefile instead of directly to the ninja file so that main.mk can add the