Build compliance metadata for files on system_other partition
Bug: 401369898
Test: presubmits
Test: m sbom, and /system_other/system-other-odex-marker is in SBOM
Change-Id: Ib32ee91ac4eaae8438a16e46dd1b04df7ae3bf33
diff --git a/filesystem/system_other.go b/filesystem/system_other.go
index 348c010..32a6cc7 100644
--- a/filesystem/system_other.go
+++ b/filesystem/system_other.go
@@ -120,8 +120,11 @@
// TOOD: CopySpecsToDir only exists on PackagingBase, but doesn't use any fields from it. Clean this up.
(&android.PackagingBase{}).CopySpecsToDir(ctx, builder, specs, stagingDir)
+ fullInstallPaths := []string{}
if len(m.properties.Preinstall_dexpreopt_files_from) > 0 {
builder.Command().Textf("touch %s", filepath.Join(stagingDir.String(), "system-other-odex-marker"))
+ installPath := android.PathForModuleInPartitionInstall(ctx, "system_other", "system-other-odex-marker")
+ fullInstallPaths = append(fullInstallPaths, installPath.String())
}
builder.Command().Textf("touch").Output(stagingDirTimestamp)
builder.Build("assemble_filesystem_staging_dir", "Assemble filesystem staging dir")
@@ -186,6 +189,10 @@
ctx.SetOutputFiles(android.Paths{output}, "")
ctx.CheckbuildFile(output)
+
+ // Dump compliance metadata
+ complianceMetadataInfo := ctx.ComplianceMetadataInfo()
+ complianceMetadataInfo.SetFilesContained(fullInstallPaths)
}
func (s *systemOtherImage) generateFilesystemConfig(ctx android.ModuleContext, stagingDir, stagingDirTimestamp android.Path) android.Path {