summaryrefslogtreecommitdiff
path: root/filesystem/vbmeta.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-11-13 16:09:23 -0800
committer Cole Faust <colefaust@google.com> 2024-11-13 16:48:50 -0800
commit4e9f5923c0e7cf0d7f845b90c7da65c24e44bcee (patch)
tree6d9fc3cdf89401a385e24e9e35ab67765cdef02d /filesystem/vbmeta.go
parent06540bb808debb9efe410e518ce9f420bac9042c (diff)
Use fewer OutputPaths
A lot of the time, you really mean android.Path or android.WriteablePath instead of OutputPath. Also, many modules were holding onto OutputPaths/WriteablePaths after the files had already been generated, meaning they should no longer be treated as writable paths and are instead inputs into other actions. Change the type of those paths to just android.Path. Test: verified ninja files were unchanged on aosp_arm64-trunk_staging-userdebug Change-Id: Id773171bef59d855ba33c4b85cef268031cbec39
Diffstat (limited to 'filesystem/vbmeta.go')
-rw-r--r--filesystem/vbmeta.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/filesystem/vbmeta.go b/filesystem/vbmeta.go
index ebb3ff951..6a4785933 100644
--- a/filesystem/vbmeta.go
+++ b/filesystem/vbmeta.go
@@ -44,7 +44,7 @@ type vbmeta struct {
properties VbmetaProperties
- output android.OutputPath
+ output android.Path
installDir android.InstallPath
}
@@ -161,8 +161,6 @@ func (v *vbmeta) partitionName() string {
const vbmetaMaxSize = 64 * 1024
func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- v.output = android.PathForModuleOut(ctx, v.installFileName()).OutputPath
-
builder := android.NewRuleBuilder(pctx, ctx)
cmd := builder.Command().BuiltTool("avbtool").Text("make_vbmeta_image")
@@ -274,18 +272,19 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) {
cmd.Implicit(publicKey)
}
- cmd.FlagWithOutput("--output ", v.output)
+ output := android.PathForModuleOut(ctx, v.installFileName())
+ cmd.FlagWithOutput("--output ", output)
// libavb expects to be able to read the maximum vbmeta size, so we must provide a partition
// which matches this or the read will fail.
builder.Command().Text("truncate").
FlagWithArg("-s ", strconv.Itoa(vbmetaMaxSize)).
- Output(v.output)
+ Output(output)
builder.Build("vbmeta", fmt.Sprintf("vbmeta %s", ctx.ModuleName()))
v.installDir = android.PathForModuleInstall(ctx, "etc")
- ctx.InstallFile(v.installDir, v.installFileName(), v.output)
+ ctx.InstallFile(v.installDir, v.installFileName(), output)
extractedPublicKey := android.PathForModuleOut(ctx, v.partitionName()+".avbpubkey")
ctx.Build(pctx, android.BuildParams{
@@ -300,7 +299,8 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) {
PublicKey: extractedPublicKey,
})
- ctx.SetOutputFiles([]android.Path{v.output}, "")
+ ctx.SetOutputFiles([]android.Path{output}, "")
+ v.output = output
}
// Returns the embedded shell command that prints the rollback index