summaryrefslogtreecommitdiff
path: root/filesystem/system_image.go
diff options
context:
space:
mode:
author Jeongik Cha <jeongik@google.com> 2024-02-08 10:44:37 +0900
committer Jeongik Cha <jeongik@google.com> 2024-02-08 11:14:43 +0900
commit54bf875c9725719cc92d2b83aafe3b31a5ae47d7 (patch)
tree5cec0d6b80e424fe39ced6f9b5d1b511daf8aae7 /filesystem/system_image.go
parentc21f548fd42f10a6d801f7f76bd46c9661a40587 (diff)
Add GatherPackagingSpecsWithFilter
android_system_image used GatherPackagingSpecs and then filter only system modules. But some modules were omitted in this logic because there are modules which has the same relative path, so the later one is ignored even though its partition info is what we're looking for. So add filter logic in GatherPackagingSpecs to avoid this problem Bug: 323793487 Test: build android_system_image, and then check if it contains every module we want Change-Id: Iec8ae920736d3d1920eecad71ba0f8f2fe848e6c
Diffstat (limited to 'filesystem/system_image.go')
-rw-r--r--filesystem/system_image.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/filesystem/system_image.go b/filesystem/system_image.go
index 75abf702e..34f4ffb6d 100644
--- a/filesystem/system_image.go
+++ b/filesystem/system_image.go
@@ -37,7 +37,7 @@ func systemImageFactory() android.Module {
module := &systemImage{}
module.AddProperties(&module.properties)
module.filesystem.buildExtraFiles = module.buildExtraFiles
- module.filesystem.filterPackagingSpecs = module.filterPackagingSpecs
+ module.filesystem.filterPackagingSpec = module.filterPackagingSpec
initFilesystemModule(&module.filesystem)
return module
}
@@ -73,10 +73,6 @@ func (s *systemImage) buildLinkerConfigFile(ctx android.ModuleContext, root andr
// Filter the result of GatherPackagingSpecs to discard items targeting outside "system" partition.
// Note that "apex" module installs its contents to "apex"(fake partition) as well
// for symbol lookup by imitating "activated" paths.
-func (s *systemImage) filterPackagingSpecs(specs map[string]android.PackagingSpec) {
- for k, ps := range specs {
- if ps.Partition() != "system" {
- delete(specs, k)
- }
- }
+func (s *systemImage) filterPackagingSpec(ps android.PackagingSpec) bool {
+ return ps.Partition() == "system"
}