diff options
author | 2025-02-19 00:55:10 +0000 | |
---|---|---|
committer | 2025-02-19 18:56:02 +0000 | |
commit | abec3ecb0a8e94773a8f1eb795f7720c883d0176 (patch) | |
tree | 4bb47a550bc656a6b71069629fb69c8d4aaa1817 /filesystem/filesystem.go | |
parent | f50d2e6a01ac220d29a1e3ba2ac42f1465a48cc2 (diff) |
Propagate owners info in filesystem provider
Owners contain information about the name and the variants of the
modules that are installed in the partition. This information can be
used to determine whether the dependency module is installed or not.
Utilization of this information will be done in a follow up change.
Test: m nothing
Bug: 395989947
Change-Id: I8c63ed5765a3f582ff0d2ce98f63e6e0fc6edad8
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r-- | filesystem/filesystem.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index f84993de7..aadb76262 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -384,6 +384,11 @@ type InstalledFilesStruct struct { Json android.Path } +type InstalledModuleInfo struct { + Name string + Variation string +} + type FilesystemInfo struct { // The built filesystem image Output android.Path @@ -428,6 +433,8 @@ type FilesystemInfo struct { SelinuxFc android.Path FilesystemConfig android.Path + + Owners []InstalledModuleInfo } // FullInstallPathInfo contains information about the "full install" paths of all the files @@ -673,6 +680,7 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { ErofsCompressHints: erofsCompressHints, SelinuxFc: f.selinuxFc, FilesystemConfig: f.generateFilesystemConfig(ctx, rootDir, rebasedDir), + Owners: f.gatherOwners(specs), } android.SetProvider(ctx, FilesystemProvider, fsInfo) @@ -1326,6 +1334,18 @@ func (f *filesystem) gatherFilteredPackagingSpecs(ctx android.ModuleContext) map return f.PackagingBase.GatherPackagingSpecsWithFilterAndModifier(ctx, f.filesystemBuilder.FilterPackagingSpec, f.filesystemBuilder.ModifyPackagingSpec) } +func (f *filesystem) gatherOwners(specs map[string]android.PackagingSpec) []InstalledModuleInfo { + var owners []InstalledModuleInfo + for _, p := range android.SortedKeys(specs) { + spec := specs[p] + owners = append(owners, InstalledModuleInfo{ + Name: spec.Owner(), + Variation: spec.Variation(), + }) + } + return owners +} + // Dexpreopt files are installed to system_other. Collect the packaingSpecs for the dexpreopt files // from this partition to export to the system_other partition later. func (f *filesystem) systemOtherFiles(ctx android.ModuleContext) map[string]android.PackagingSpec { |