Merge "Add support for rollback_index to android_filesystem module" into main
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"slices"
|
"slices"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
@@ -82,6 +83,9 @@ type filesystemProperties struct {
|
|||||||
// avbtool. Default used by avbtool is sha1.
|
// avbtool. Default used by avbtool is sha1.
|
||||||
Avb_hash_algorithm *string
|
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.
|
// Name of the partition stored in vbmeta desc. Defaults to the name of this module.
|
||||||
Partition_name *string
|
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 != "" {
|
if hashAlgorithm := proptools.String(f.properties.Avb_hash_algorithm); hashAlgorithm != "" {
|
||||||
avb_add_hashtree_footer_args += " --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"
|
securityPatchKey := "com.android.build." + f.partitionName() + ".security_patch"
|
||||||
securityPatchValue := ctx.Config().PlatformSecurityPatch()
|
securityPatchValue := ctx.Config().PlatformSecurityPatch()
|
||||||
avb_add_hashtree_footer_args += " --prop " + securityPatchKey + ":" + securityPatchValue
|
avb_add_hashtree_footer_args += " --prop " + securityPatchKey + ":" + securityPatchValue
|
||||||
|
Reference in New Issue
Block a user