summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShikha Panwar <shikhapanwar@google.com>2023-02-04 01:38:34 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-02-04 01:38:34 +0000
commit288d7b1d1f6457c5a4337a904f4f99529a9a87ad (patch)
tree89f63298e60d1fe8bf8b240ca01839bf8e3d230e
parentb813c9c180ba07810110e3369a1ae8015d7e4092 (diff)
parent99b130a95ddd50c7ca0dcefcbf745ad689462c2e (diff)
Expose avb_hash_algorithm as a property. am: f3d1e8c24c am: 99b130a95d
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/21142901 Change-Id: I3e06cbc0adce11a820624a10c420b0475b23e8c1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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)
}