From af2b25c6155ae442b703d8aadbfcdd1f020ab823 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Wed, 19 Mar 2025 16:31:24 -0700 Subject: 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 --- filesystem/system_other.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'filesystem/system_other.go') diff --git a/filesystem/system_other.go b/filesystem/system_other.go index 348c01035..32a6cc784 100644 --- a/filesystem/system_other.go +++ b/filesystem/system_other.go @@ -120,8 +120,11 @@ func (m *systemOtherImage) GenerateAndroidBuildActions(ctx android.ModuleContext // 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 @@ func (m *systemOtherImage) GenerateAndroidBuildActions(ctx android.ModuleContext 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 { -- cgit v1.2.3-59-g8ed1b