summaryrefslogtreecommitdiff
path: root/filesystem
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-03-18 11:28:27 -0700
committer Cole Faust <colefaust@google.com> 2025-03-18 13:18:22 -0700
commita9fa8acf4a3d686f1e5322bf75674bff7a7910f5 (patch)
tree9b91b4112dafedbe2393d69ead875f216cb2a82b /filesystem
parent764aaca0f6a57c182f2ecfd6ea6c1dce3ff715f0 (diff)
Make rollback_index configurable
Per user request. Bug: 355539748 Test: Presubmits Change-Id: I66f9f064e2b619167772ed33ab401e45649c93c0
Diffstat (limited to 'filesystem')
-rw-r--r--filesystem/avb_add_hash_footer.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/filesystem/avb_add_hash_footer.go b/filesystem/avb_add_hash_footer.go
index 327a41fda..c7760120d 100644
--- a/filesystem/avb_add_hash_footer.go
+++ b/filesystem/avb_add_hash_footer.go
@@ -70,7 +70,7 @@ type avbAddHashFooterProperties struct {
Props []avbProp
// The index used to prevent rollback of the image on device.
- Rollback_index *int64
+ Rollback_index proptools.Configurable[int64] `android:"replace_instead_of_append"`
// Include descriptors from images
Include_descriptors_from_images []string `android:"path,arch_variant"`
@@ -134,8 +134,9 @@ func (a *avbAddHashFooter) GenerateAndroidBuildActions(ctx android.ModuleContext
addAvbProp(ctx, cmd, prop)
}
- if a.properties.Rollback_index != nil {
- rollbackIndex := proptools.Int(a.properties.Rollback_index)
+ rollbackIndex := a.properties.Rollback_index.Get(ctx)
+ if rollbackIndex.IsPresent() {
+ rollbackIndex := rollbackIndex.Get()
if rollbackIndex < 0 {
ctx.PropertyErrorf("rollback_index", "Rollback index must be non-negative")
}