summaryrefslogtreecommitdiff
path: root/filesystem
diff options
context:
space:
mode:
Diffstat (limited to 'filesystem')
-rw-r--r--filesystem/avb_add_hash_footer.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/filesystem/avb_add_hash_footer.go b/filesystem/avb_add_hash_footer.go
index f3fecd042..dabbc461b 100644
--- a/filesystem/avb_add_hash_footer.go
+++ b/filesystem/avb_add_hash_footer.go
@@ -68,6 +68,9 @@ type avbAddHashFooterProperties struct {
// List of properties to add to the footer
Props []avbProp
+ // The index used to prevent rollback of the image on device.
+ Rollback_index *int64
+
// Include descriptors from images
Include_descriptors_from_images []string `android:"path,arch_variant"`
}
@@ -128,6 +131,14 @@ func (a *avbAddHashFooter) GenerateAndroidBuildActions(ctx android.ModuleContext
addAvbProp(ctx, cmd, prop)
}
+ if a.properties.Rollback_index != nil {
+ rollbackIndex := proptools.Int(a.properties.Rollback_index)
+ if rollbackIndex < 0 {
+ ctx.PropertyErrorf("rollback_index", "Rollback index must be non-negative")
+ }
+ cmd.Flag(fmt.Sprintf(" --rollback_index %x", rollbackIndex))
+ }
+
cmd.FlagWithOutput("--image ", a.output)
builder.Build("avbAddHashFooter", fmt.Sprintf("avbAddHashFooter %s", ctx.ModuleName()))