Add system_other partition props to Soong's misc_info.txt
Implementation Details
- Expand FilesystemInfo with some Avb* props. `system_other` will use
this info exported by `system` to create system_other entries for
misc_info.txt. This is necessary since system_other does not contain
sufficient information to create a standalone buildPropFile, and reuses
the buildPropFile of system in `build_image` invocation
- Harcode rollback_index to the timestamp parsed from
`PlatformSecurityPatch`. Most products (including cuttlefish) do not
use a product config variable to override the rollback_index.
Eventually, we should dynamically get this value from one of the vbmeta
partitions.
Bug: 398036609
Test: Built Make and Soong misc_info.txt
Test: No diff in system_other entries
Change-Id: Iadb0ee34d948cb15cd5a59b0dff7bf7fc64024ed
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index af14e81..411770b 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -455,6 +455,14 @@
HasFsverity bool
PropFileForMiscInfo android.Path
+
+ // Additional avb and partition size information.
+ // `system_other` will use this information of `system` dep for misc_info.txt processing.
+ PartitionSize *int64
+ UseAvb bool
+ AvbAlgorithm string
+ AvbHashAlgorithm string
+ AvbKey android.Path
}
// FullInstallPathInfo contains information about the "full install" paths of all the files
@@ -711,6 +719,15 @@
Owners: f.gatherOwners(specs),
HasFsverity: f.properties.Fsverity.Inputs.GetOrDefault(ctx, nil) != nil,
PropFileForMiscInfo: propFileForMiscInfo,
+ PartitionSize: f.properties.Partition_size,
+ }
+ if proptools.Bool(f.properties.Use_avb) {
+ fsInfo.UseAvb = true
+ fsInfo.AvbAlgorithm = proptools.StringDefault(f.properties.Avb_algorithm, "SHA256_RSA4096")
+ fsInfo.AvbHashAlgorithm = proptools.StringDefault(f.properties.Avb_hash_algorithm, "sha256")
+ if f.properties.Avb_private_key != nil {
+ fsInfo.AvbKey = android.PathForModuleSrc(ctx, *f.properties.Avb_private_key)
+ }
}
android.SetProvider(ctx, FilesystemProvider, fsInfo)