diff options
| author | 2021-04-15 02:06:01 +0000 | |
|---|---|---|
| committer | 2021-04-15 02:06:01 +0000 | |
| commit | ccaf57c65aa0074db751da542aea973b9c526323 (patch) | |
| tree | 08b95a4b5a65b43931183c856f433c2f41da1298 | |
| parent | fb545bf2f39019014b53e36bb0b344e747a087f1 (diff) | |
| parent | da2d6ee7a266c0c8889e82ad40319c9762379391 (diff) | |
Merge "Truncate vbmeta to 64KB"
| -rw-r--r-- | filesystem/vbmeta.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/filesystem/vbmeta.go b/filesystem/vbmeta.go index f823387b0..3f16c0d71 100644 --- a/filesystem/vbmeta.go +++ b/filesystem/vbmeta.go @@ -110,6 +110,9 @@ func (v *vbmeta) partitionName() string { return proptools.StringDefault(v.properties.Partition_name, v.BaseModuleName()) } +// See external/avb/libavb/avb_slot_verify.c#VBMETA_MAX_SIZE +const vbmetaMaxSize = 64 * 1024 + func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) { extractedPublicKeys := v.extractPublicKeys(ctx) @@ -172,6 +175,13 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) { } cmd.FlagWithOutput("--output ", v.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) + builder.Build("vbmeta", fmt.Sprintf("vbmeta %s", ctx.ModuleName())) v.installDir = android.PathForModuleInstall(ctx, "etc") |