diff options
author | 2025-03-21 15:08:30 -0700 | |
---|---|---|
committer | 2025-03-21 15:08:30 -0700 | |
commit | 273bf6e9b6e00141ad726b532032b5a290d67ad7 (patch) | |
tree | 51c761d7c5d9fc5d335f24f6cdd1c3ee2eaafe2f /filesystem/android_device.go | |
parent | 780dd8642a6f35c5b0b6810713fc874f8c52c827 (diff) | |
parent | a85dbb2bef1f34f0c08d1b418ca699aed43e91f9 (diff) |
Merge changes from topic "export_flash_block_size_to_soong" into main
* changes:
Add some OTA related properties to android_device
Add `avb_custom_vbmeta_images_partition_list` to misc_info.txt
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r-- | filesystem/android_device.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go index feb000dc4..aa7100887 100644 --- a/filesystem/android_device.go +++ b/filesystem/android_device.go @@ -90,6 +90,10 @@ type DeviceProperties struct { Releasetools_extension *string `android:"path"` FastbootInfo *string `android:"path"` + Partial_ota_update_partitions []string + Flash_block_size *string + Bootloader_in_update_package *bool + // The kernel version in the build. Will be verified against the actual kernel. // If not provided, will attempt to extract it from the loose kernel or the kernel inside // the boot image. The version is later used to decide whether or not to enable uffd_gc @@ -840,14 +844,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 { @@ -883,6 +898,14 @@ func (a *androidDevice) addMiscInfo(ctx android.ModuleContext) android.Path { builder.Command().Text("cat").Input(bootImgInfo.PropFileForMiscInfo).Textf(" >> %s", miscInfo) } + builder.Command().Textf("echo blocksize=%s >> %s", proptools.String(a.deviceProps.Flash_block_size), miscInfo) + if proptools.Bool(a.deviceProps.Bootloader_in_update_package) { + builder.Command().Textf("echo bootloader_in_update_package=true >> %s", miscInfo) + } + if len(a.deviceProps.Partial_ota_update_partitions) > 0 { + builder.Command().Textf("echo partial_ota_update_partitions_list=%s >> %s", strings.Join(a.deviceProps.Partial_ota_update_partitions, " "), miscInfo) + } + // Sort and dedup builder.Command().Textf("sort -u %s -o %s", miscInfo, miscInfo) |