summaryrefslogtreecommitdiff
path: root/filesystem/filesystem.go
diff options
context:
space:
mode:
authorMatt Lee <matthewhlee@google.com>2023-03-02 14:23:51 -0800
committerMatt Lee <matthewhlee@google.com>2023-03-02 14:23:51 -0800
commitee181be03f0da2d752b6b31d4c698026b41c7f44 (patch)
tree1afd9af5b30999f16df84fce9e989cd4cc3b3b16 /filesystem/filesystem.go
parent616151ebbfbae6bb1f9cab420e5f3cfb27d71a21 (diff)
parentab123c3736ddaae9eb1230fb2310cccac81625f0 (diff)
Merge t-qpr-2023-03
Change-Id: I61ec429dddae7971efe2a62fd5f1c173a896ee15
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r--filesystem/filesystem.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index ccf9e9d3b..665faaaed 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -66,9 +66,13 @@ type filesystemProperties struct {
// TODO(jiyong): allow apex_key to be specified here
Avb_private_key *string `android:"path"`
- // Hash and signing algorithm for avbtool. Default is SHA256_RSA4096.
+ // Signing algorithm for avbtool. Default is SHA256_RSA4096.
Avb_algorithm *string
+ // Hash algorithm used for avbtool (for descriptors). This is passed as hash_algorithm to
+ // avbtool. Default used by avbtool is sha1.
+ Avb_hash_algorithm *string
+
// Name of the partition stored in vbmeta desc. Defaults to the name of this module.
Partition_name *string
@@ -318,7 +322,11 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (propFile android.
addStr("avb_algorithm", algorithm)
key := android.PathForModuleSrc(ctx, proptools.String(f.properties.Avb_private_key))
addPath("avb_key_path", key)
- addStr("avb_add_hashtree_footer_args", "--do_not_generate_fec")
+ avb_add_hashtree_footer_args := "--do_not_generate_fec"
+ if hashAlgorithm := proptools.String(f.properties.Avb_hash_algorithm); hashAlgorithm != "" {
+ avb_add_hashtree_footer_args += " --hash_algorithm " + hashAlgorithm
+ }
+ addStr("avb_add_hashtree_footer_args", avb_add_hashtree_footer_args)
partitionName := proptools.StringDefault(f.properties.Partition_name, f.Name())
addStr("partition_name", partitionName)
}