summaryrefslogtreecommitdiff
path: root/filesystem/bootimg.go
diff options
context:
space:
mode:
author Wei Li <weiwli@google.com> 2025-03-07 22:08:52 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-03-07 22:08:52 -0800
commit3639838f5e5700774f251ef8a2324015d3b1ad77 (patch)
treeaf256e3dfc7dacc8ede2403f372be05b81193cd7 /filesystem/bootimg.go
parentc4123f6638ff86dcaec2b8aaac325e6dabb0ba38 (diff)
parent583bc3639b7a41f4f29f07f0478ee62f7b69fecb (diff)
Merge "Include kernel and dtb.img information in SBOM built in soong-only" into main
Diffstat (limited to 'filesystem/bootimg.go')
-rw-r--r--filesystem/bootimg.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go
index 2bf0d5905..c06c20048 100644
--- a/filesystem/bootimg.go
+++ b/filesystem/bootimg.go
@@ -201,7 +201,8 @@ func (b *bootimg) GenerateAndroidBuildActions(ctx android.ModuleContext) {
return
}
- unsignedOutput := b.buildBootImage(ctx, b.getKernelPath(ctx))
+ kernelPath := b.getKernelPath(ctx)
+ unsignedOutput := b.buildBootImage(ctx, kernelPath)
output := unsignedOutput
if proptools.Bool(b.properties.Use_avb) {
@@ -212,7 +213,7 @@ func (b *bootimg) GenerateAndroidBuildActions(ctx android.ModuleContext) {
case "default":
output = b.signImage(ctx, unsignedOutput)
case "make_legacy":
- output = b.addAvbFooter(ctx, unsignedOutput, b.getKernelPath(ctx))
+ output = b.addAvbFooter(ctx, unsignedOutput, kernelPath)
default:
ctx.PropertyErrorf("avb_mode", `Unknown value for avb_mode, expected "default" or "make_legacy", got: %q`, *b.properties.Avb_mode)
}
@@ -235,10 +236,11 @@ func (b *bootimg) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
// Set BootimgInfo for building target_files.zip
+ dtbPath := b.getDtbPath(ctx)
android.SetProvider(ctx, BootimgInfoProvider, BootimgInfo{
Cmdline: b.properties.Cmdline,
- Kernel: b.getKernelPath(ctx),
- Dtb: b.getDtbPath(ctx),
+ Kernel: kernelPath,
+ Dtb: dtbPath,
Bootconfig: b.getBootconfigPath(ctx),
Output: output,
})
@@ -265,6 +267,16 @@ func (b *bootimg) GenerateAndroidBuildActions(ctx android.ModuleContext) {
})
// Dump compliance metadata
+ complianceMetadataInfo := ctx.ComplianceMetadataInfo()
+ prebuiltFilesCopied := make([]string, 0)
+ if kernelPath != nil {
+ prebuiltFilesCopied = append(prebuiltFilesCopied, kernelPath.String()+":kernel")
+ }
+ if dtbPath != nil {
+ prebuiltFilesCopied = append(prebuiltFilesCopied, dtbPath.String()+":dtb.img")
+ }
+ complianceMetadataInfo.SetPrebuiltFilesCopied(prebuiltFilesCopied)
+
if ramdisk := proptools.String(b.properties.Ramdisk_module); ramdisk != "" {
buildComplianceMetadata(ctx, bootimgRamdiskDep)
}