diff options
Diffstat (limited to 'filesystem/filesystem.go')
| -rw-r--r-- | filesystem/filesystem.go | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index e640c5dae..61127bf16 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -20,6 +20,7 @@ import (  	"io"  	"path/filepath"  	"slices" +	"strconv"  	"strings"  	"android/soong/android" @@ -82,6 +83,9 @@ type filesystemProperties struct {  	// avbtool. Default used by avbtool is sha1.  	Avb_hash_algorithm *string +	// The index used to prevent rollback of the image. Only used if use_avb is true. +	Rollback_index *int64 +  	// Name of the partition stored in vbmeta desc. Defaults to the name of this module.  	Partition_name *string @@ -352,6 +356,13 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (propFile android.  		if hashAlgorithm := proptools.String(f.properties.Avb_hash_algorithm); hashAlgorithm != "" {  			avb_add_hashtree_footer_args += " --hash_algorithm " + hashAlgorithm  		} +		if f.properties.Rollback_index != nil { +			rollbackIndex := proptools.Int(f.properties.Rollback_index) +			if rollbackIndex < 0 { +				ctx.PropertyErrorf("rollback_index", "Rollback index must be non-negative") +			} +			avb_add_hashtree_footer_args += " --rollback_index " + strconv.Itoa(rollbackIndex) +		}  		securityPatchKey := "com.android.build." + f.partitionName() + ".security_patch"  		securityPatchValue := ctx.Config().PlatformSecurityPatch()  		avb_add_hashtree_footer_args += " --prop " + securityPatchKey + ":" + securityPatchValue |