summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-11 14:11:29 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-02-11 14:11:29 -0800
commitbd69dc6c6d83a7a641f5f6c8b3488c83085afb69 (patch)
tree8166d3b9edef2bde88a7735c9d541715f7b55157
parent863578e5ed81c44cb8d3d43d0fb9792993a2fc23 (diff)
parent0a5e1f385864efd1192e35e0ec3c7730935ef1f0 (diff)
Merge "Ensure AVB rollback_index_location >= 1" into main am: 0a5e1f3858
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3482599 Change-Id: I0ad49047fb5b7d9ce506c8f8a2b6a62edf911cf1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--filesystem/filesystem.go2
-rw-r--r--filesystem/vbmeta.go14
2 files changed, 8 insertions, 8 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 0ce31b293..9f2b239a0 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -131,7 +131,7 @@ type FilesystemProperties struct {
// The index used to prevent rollback of the image. Only used if use_avb is true.
Rollback_index *int64
- // Rollback index location of this image. Must be 0, 1, 2, etc.
+ // Rollback index location of this image. Must be 1, 2, 3, etc.
Rollback_index_location *int64
// Name of the partition stored in vbmeta desc. Defaults to the name of this module.
diff --git a/filesystem/vbmeta.go b/filesystem/vbmeta.go
index 91826b244..e5809d31b 100644
--- a/filesystem/vbmeta.go
+++ b/filesystem/vbmeta.go
@@ -97,7 +97,7 @@ type ChainedPartitionProperties struct {
// Name of the chained partition
Name *string
- // Rollback index location of the chained partition. Must be 0, 1, 2, etc. Default is the
+ // Rollback index location of the chained partition. Must be 1, 2, 3, etc. Default is the
// index of this partition in the list + 1.
Rollback_index_location *int64
@@ -225,8 +225,8 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
ril := info.RollbackIndexLocation
- if ril < 0 {
- ctx.PropertyErrorf("chained_partitions", "rollback index location must be 0, 1, 2, ...")
+ if ril < 1 {
+ ctx.PropertyErrorf("chained_partitions", "rollback index location must be 1, 2, 3, ...")
continue
} else if seenRils[ril] {
ctx.PropertyErrorf("chained_partitions", "Multiple chained partitions with the same rollback index location %d", ril)
@@ -241,13 +241,13 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) {
for _, cpm := range v.properties.Chained_partition_metadata {
name := proptools.String(cpm.Name)
if name == "" {
- ctx.PropertyErrorf("chained_partitions", "name must be specified")
+ ctx.PropertyErrorf("chained_partition_metadata", "name must be specified")
continue
}
- ril := proptools.IntDefault(cpm.Rollback_index_location, -1)
- if ril < 0 {
- ctx.PropertyErrorf("chained_partition_metadata", "rollback index location must be 0, 1, 2, ...")
+ ril := proptools.IntDefault(cpm.Rollback_index_location, 0)
+ if ril < 1 {
+ ctx.PropertyErrorf("chained_partition_metadata", "rollback index location must be 1, 2, 3, ...")
continue
} else if seenRils[ril] {
ctx.PropertyErrorf("chained_partition_metadata", "Multiple chained partitions with the same rollback index location %d", ril)