summaryrefslogtreecommitdiff
path: root/fsgen/filesystem_creator.go
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2025-01-17 19:22:44 +0000
committer Cole Faust <colefaust@google.com> 2025-01-21 18:17:11 -0800
commit2f0d193a9d12afd44060e16dd6af324df123fdff (patch)
tree66351c0e8747aef0cd6d604c01898380c529fba8 /fsgen/filesystem_creator.go
parent102c2ae2b4d8d64cc484ccf03ec764ac4d0e63f3 (diff)
Modify autogen vbmeta chain and include partitions logic
This change modifies the logic in selecting the chain and include partitions for the top level vbmeta partition generation to follow that in make. Implementation details: - Introduce separate functions for selecting the include and chain partitions - Set vbmetaPartitionProvider in boot images and filesystem modules given that boot images can be selected as chained partitions. Test: compare soong and make generated vbmeta partitions command Bug: 390204058 Change-Id: I7940629212c4624e88d25b162755205503cfa469
Diffstat (limited to 'fsgen/filesystem_creator.go')
-rw-r--r--fsgen/filesystem_creator.go26
1 files changed, 18 insertions, 8 deletions
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index d2f00cd26..ebcc68b2b 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -178,7 +178,7 @@ func (f *filesystemCreator) createInternalModules(ctx android.LoadHookContext) {
)
}
- for _, x := range createVbmetaPartitions(ctx, finalSoongGeneratedPartitions) {
+ for _, x := range f.createVbmetaPartitions(ctx, finalSoongGeneratedPartitions) {
f.properties.Vbmeta_module_names = append(f.properties.Vbmeta_module_names, x.moduleName)
f.properties.Vbmeta_partition_names = append(f.properties.Vbmeta_partition_names, x.partitionName)
}
@@ -865,6 +865,8 @@ func generateFsProps(ctx android.EarlyModuleContext, partitionType string) (*fil
fsProps.Avb_algorithm = avbInfo.avbAlgorithm
// BOARD_AVB_SYSTEM_ROLLBACK_INDEX
fsProps.Rollback_index = avbInfo.avbRollbackIndex
+ // BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION
+ fsProps.Rollback_index_location = avbInfo.avbRollbackIndexLocation
fsProps.Avb_hash_algorithm = avbInfo.avbHashAlgorithm
fsProps.Partition_name = proptools.StringPtr(partitionType)
@@ -893,13 +895,14 @@ func generateFsProps(ctx android.EarlyModuleContext, partitionType string) (*fil
}
type avbInfo struct {
- avbEnable *bool
- avbKeyPath *string
- avbkeyFilegroup *string
- avbAlgorithm *string
- avbRollbackIndex *int64
- avbMode *string
- avbHashAlgorithm *string
+ avbEnable *bool
+ avbKeyPath *string
+ avbkeyFilegroup *string
+ avbAlgorithm *string
+ avbRollbackIndex *int64
+ avbRollbackIndexLocation *int64
+ avbMode *string
+ avbHashAlgorithm *string
}
func getAvbInfo(config android.Config, partitionType string) avbInfo {
@@ -946,6 +949,13 @@ func getAvbInfo(config android.Config, partitionType string) avbInfo {
}
result.avbRollbackIndex = &parsed
}
+ if specificPartitionVars.BoardAvbRollbackIndexLocation != "" {
+ parsed, err := strconv.ParseInt(specificPartitionVars.BoardAvbRollbackIndexLocation, 10, 64)
+ if err != nil {
+ panic(fmt.Sprintf("Rollback index location must be an int, got %s", specificPartitionVars.BoardAvbRollbackIndexLocation))
+ }
+ result.avbRollbackIndexLocation = &parsed
+ }
// Make allows you to pass arbitrary arguments to avbtool via this variable, but in practice
// it's only used for --hash_algorithm. The soong module has a dedicated property for the