Add vbmeta_*.img files to IMAGES/ in soong built target_files.zip
Bug: 388635097
Test: built the soong target_files.zip locally
Test: verified that vbmeta*img files are included, although they are not
bit-identical
Change-Id: Ifed30cec8122ba14635ab2b8fd1edbd3eb05f9a1
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 6a939e8..86f853c 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -213,6 +213,11 @@
if a.deviceProps.Bootloader != nil {
builder.Command().Textf("cp ").Input(android.PathForModuleSrc(ctx, proptools.String(a.deviceProps.Bootloader))).Textf(" %s/IMAGES/bootloader", targetFilesDir.String())
}
+ // Copy the vbmeta img files to IMAGES/
+ for _, vbmetaPartition := range a.partitionProps.Vbmeta_partitions {
+ vbmetaInfo, _ := android.OtherModuleProvider(ctx, ctx.GetDirectDepWithTag(vbmetaPartition, filesystemDepTag), vbmetaPartitionProvider)
+ builder.Command().Textf("cp ").Input(vbmetaInfo.Output).Textf(" %s/IMAGES/", targetFilesDir.String())
+ }
for _, zipCopy := range toCopy {
if zipCopy.srcModule == nil {
diff --git a/filesystem/vbmeta.go b/filesystem/vbmeta.go
index c8b4675..d468186 100644
--- a/filesystem/vbmeta.go
+++ b/filesystem/vbmeta.go
@@ -121,6 +121,9 @@
// The path to the public key of the private key used to sign this partition. Derived from
// the private key.
PublicKey android.Path
+
+ // The output of the vbmeta module
+ Output android.Path
}
var vbmetaPartitionProvider = blueprint.NewProvider[vbmetaPartitionInfo]()
@@ -301,6 +304,7 @@
Name: v.partitionName(),
RollbackIndexLocation: ril,
PublicKey: extractedPublicKey,
+ Output: output,
})
ctx.SetOutputFiles([]android.Path{output}, "")