diff options
Diffstat (limited to 'filesystem/vbmeta.go')
| -rw-r--r-- | filesystem/vbmeta.go | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/filesystem/vbmeta.go b/filesystem/vbmeta.go index 63e0abaac..0c6e7f428 100644 --- a/filesystem/vbmeta.go +++ b/filesystem/vbmeta.go @@ -63,6 +63,17 @@ type vbmetaProperties struct { // List of chained partitions that this vbmeta deletages the verification. Chained_partitions []chainedPartitionProperties + + // List of key-value pair of avb properties + Avb_properties []avbProperty +} + +type avbProperty struct { + // Key of given avb property + Key *string + + // Value of given avb property + Value *string } type chainedPartitionProperties struct { @@ -135,6 +146,20 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) { } cmd.FlagWithArg("--rollback_index_location ", strconv.Itoa(ril)) + for _, avb_prop := range v.properties.Avb_properties { + key := proptools.String(avb_prop.Key) + if key == "" { + ctx.PropertyErrorf("avb_properties", "key must be specified") + continue + } + value := proptools.String(avb_prop.Value) + if value == "" { + ctx.PropertyErrorf("avb_properties", "value must be specified") + continue + } + cmd.FlagWithArg("--prop ", key+":"+value) + } + for _, p := range ctx.GetDirectDepsWithTag(vbmetaPartitionDep) { f, ok := p.(Filesystem) if !ok { @@ -186,6 +211,8 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) { v.installDir = android.PathForModuleInstall(ctx, "etc") ctx.InstallFile(v.installDir, v.installFileName(), v.output) + + ctx.SetOutputFiles([]android.Path{v.output}, "") } // Returns the embedded shell command that prints the rollback index @@ -263,13 +290,3 @@ func (v *vbmeta) OutputPath() android.Path { func (v *vbmeta) SignedOutputPath() android.Path { return v.OutputPath() // vbmeta is always signed } - -var _ android.OutputFileProducer = (*vbmeta)(nil) - -// Implements android.OutputFileProducer -func (v *vbmeta) OutputFiles(tag string) (android.Paths, error) { - if tag == "" { - return []android.Path{v.output}, nil - } - return nil, fmt.Errorf("unsupported module reference tag %q", tag) -} |