diff options
| author | 2025-01-21 21:17:57 -0800 | |
|---|---|---|
| committer | 2025-01-21 21:17:57 -0800 | |
| commit | da481ebb2866117f03278654e0aed4dd8362f6bc (patch) | |
| tree | 19a5addc51ae27d4a6e7453d38e118e93373d0bf /filesystem/filesystem.go | |
| parent | 3bbb3911e27daf036b96448b27fa5ef515955d99 (diff) | |
| parent | 2f0d193a9d12afd44060e16dd6af324df123fdff (diff) | |
Merge "Modify autogen vbmeta chain and include partitions logic" into main
Diffstat (limited to 'filesystem/filesystem.go')
| -rw-r--r-- | filesystem/filesystem.go | 30 | 
1 files changed, 30 insertions, 0 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 68cbee95f..357ec32ba 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -131,6 +131,9 @@ type FilesystemProperties struct {  	// The index used to prevent rollback of the image. Only used if use_avb is true.  	Rollback_index *int64 +	// Rollback index location of this image. Must be 0, 1, 2, etc. +	Rollback_index_location *int64 +  	// Name of the partition stored in vbmeta desc. Defaults to the name of this module.  	Partition_name *string @@ -537,6 +540,33 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) {  	if proptools.Bool(f.properties.Unchecked_module) {  		ctx.UncheckedModule()  	} + +	f.setVbmetaPartitionProvider(ctx) +} + +func (f *filesystem) setVbmetaPartitionProvider(ctx android.ModuleContext) { +	var extractedPublicKey android.ModuleOutPath +	if f.properties.Avb_private_key != nil { +		key := android.PathForModuleSrc(ctx, proptools.String(f.properties.Avb_private_key)) +		extractedPublicKey = android.PathForModuleOut(ctx, f.partitionName()+".avbpubkey") +		ctx.Build(pctx, android.BuildParams{ +			Rule:   extractPublicKeyRule, +			Input:  key, +			Output: extractedPublicKey, +		}) +	} + +	var ril int +	if f.properties.Rollback_index_location != nil { +		ril = proptools.Int(f.properties.Rollback_index_location) +	} + +	android.SetProvider(ctx, vbmetaPartitionProvider, vbmetaPartitionInfo{ +		Name:                  f.partitionName(), +		RollbackIndexLocation: ril, +		PublicKey:             extractedPublicKey, +		Output:                f.output, +	})  }  func (f *filesystem) getMapFile(ctx android.ModuleContext) android.WritablePath {  |