summaryrefslogtreecommitdiff
path: root/filesystem/filesystem.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-06 19:10:16 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-03-06 19:10:16 -0800
commitaef03537446a674206379c9d91248bd47dee6bb2 (patch)
tree58424db5ca157cbf8090b6777ed1fedebca8bbc6 /filesystem/filesystem.go
parent4001c291d82003e15e6c443fc781cfece35fa0a2 (diff)
parent7b8455f5c23b600b117cde216280b584ca6b9a1d (diff)
Merge "Add support for SBOM generation in soong-only builds" into main
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r--filesystem/filesystem.go27
1 files changed, 23 insertions, 4 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 8b3b51e89..79db988a0 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -701,6 +701,14 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
f.setVbmetaPartitionProvider(ctx)
+
+ // Dump metadata that can not be done in android/compliance-metadata.go
+ complianceMetadataInfo := ctx.ComplianceMetadataInfo()
+ filesContained := make([]string, 0, len(fullInstallPaths))
+ for _, file := range fullInstallPaths {
+ filesContained = append(filesContained, file.FullInstallPath.String())
+ }
+ complianceMetadataInfo.SetFilesContained(filesContained)
}
func (f *filesystem) fileystemStagingDirTimestamp(ctx android.ModuleContext) android.WritablePath {
@@ -885,13 +893,24 @@ func (f *filesystem) buildNonDepsFiles(
builder.Command().Text("mkdir -p").Text(filepath.Dir(dst.String()))
builder.Command().Text("ln -sf").Text(proptools.ShellEscape(target)).Text(dst.String())
f.appendToEntry(ctx, dst)
- // Only add the fullInstallPath logic for files in the rebased dir. The root dir
- // is harder to install to.
- if strings.HasPrefix(name, rebasedPrefix) {
+ // Add the fullInstallPath logic for files in the rebased dir, and for non-rebased files in "system" partition
+ // the fullInstallPath is changed to "root" which aligns to the behavior in Make.
+ if f.PartitionType() == "system" {
+ installPath := android.PathForModuleInPartitionInstall(ctx, f.PartitionType(), strings.TrimPrefix(name, rebasedPrefix))
+ if !strings.HasPrefix(name, rebasedPrefix) {
+ installPath = android.PathForModuleInPartitionInstall(ctx, "root", name)
+ }
*fullInstallPaths = append(*fullInstallPaths, FullInstallPathInfo{
- FullInstallPath: android.PathForModuleInPartitionInstall(ctx, f.PartitionType(), strings.TrimPrefix(name, rebasedPrefix)),
+ FullInstallPath: installPath,
SymlinkTarget: target,
})
+ } else {
+ if strings.HasPrefix(name, rebasedPrefix) {
+ *fullInstallPaths = append(*fullInstallPaths, FullInstallPathInfo{
+ FullInstallPath: android.PathForModuleInPartitionInstall(ctx, f.PartitionType(), strings.TrimPrefix(name, rebasedPrefix)),
+ SymlinkTarget: target,
+ })
+ }
}
}