summaryrefslogtreecommitdiff
path: root/filesystem/android_device.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2025-03-21 16:56:06 +0000
committer Spandan Das <spandandas@google.com> 2025-03-21 20:18:11 +0000
commit1bf169a34ce865e686feae2a239ac6c099b56f00 (patch)
treedd081e88f08576e4f42fe5e44aa3c8f6c6e9ec29 /filesystem/android_device.go
parenta9e6b29feef1d0a1ffc56931f2632087677073d9 (diff)
Add `avb_custom_vbmeta_images_partition_list` to misc_info.txt
Make generates this from `BOARD_AVB_VBMETA_CUSTOM_PARTITIONS`. To generate this in Soong, a new Filesytem_partition_type is added to vbmeta modules. For the chained vbmeta partitions for cuttlefish, this will be - system - vendor - system_dlkm - vendor_dlkm android_device will query this information from its vbmeta partitions, and filter out system and vendor. Bug: 398036609 Test: Built and diff'd misc_info.txt locally Change-Id: I8ff3fe5e5e50504e49abbf89f7d50be472e64e30
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r--filesystem/android_device.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 02bad0a3c..18276d43e 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -840,14 +840,25 @@ func (a *androidDevice) addMiscInfo(ctx android.ModuleContext) android.Path {
Textf("echo avb_enable=true >> %s", miscInfo).
Textf("&& echo avb_building_vbmeta_image=true >> %s", miscInfo).
Textf("&& echo avb_avbtool=avbtool >> %s", miscInfo)
+
+ var allChainedVbmetaPartitionTypes []string
for _, vbmetaPartitionName := range a.partitionProps.Vbmeta_partitions {
img := ctx.GetDirectDepProxyWithTag(vbmetaPartitionName, filesystemDepTag)
if provider, ok := android.OtherModuleProvider(ctx, img, vbmetaPartitionProvider); ok {
builder.Command().Text("cat").Input(provider.PropFileForMiscInfo).Textf(" >> %s", miscInfo)
+ if provider.FilesystemPartitionType != "" { // the top-level vbmeta.img
+ allChainedVbmetaPartitionTypes = append(allChainedVbmetaPartitionTypes, provider.FilesystemPartitionType)
+ }
} else {
ctx.ModuleErrorf("vbmeta dep %s does not set vbmetaPartitionProvider\n", vbmetaPartitionName)
}
}
+ // Determine the custom vbmeta partitions by removing system and vendor
+ customVbmetaPartitionTypes := android.RemoveListFromList(allChainedVbmetaPartitionTypes, []string{"system", "vendor"})
+ builder.Command().Textf("echo avb_custom_vbmeta_images_partition_list=%s >> %s",
+ strings.Join(android.SortedUniqueStrings(customVbmetaPartitionTypes), " "),
+ miscInfo,
+ )
}
if a.partitionProps.Boot_partition_name != nil {