From ac4076de9d5c517e144090487dc165538d15b0d2 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 15 Mar 2021 23:21:30 +0900 Subject: bootimg signs image using verity_utils Previously, bootimg signed the image using avbtool. This didn't work because avbtool always requires that the partition size is given via '--partition_size' parameter. The partition size is hard to estimate especially when the image is not for a real physical partition, but for a logical partition in a composite image. With this change, the signing of bootimg is done by verity_utils.py which internally uses avbtool. The python script is capable of calculating the minimum required partition size when the partition size is not given. In addition, this change adds 'partition_name' property to the `android_filesystem` module type so that we can customize the partition name field in the vbmeta descriptor. Bug: 180676957 Test: m microdroid-boot-5.10 Change-Id: I2e4aa626cf06a2177b4a8d90ff9b9006d2927ae4 --- filesystem/filesystem.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'filesystem/filesystem.go') diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 3b0a7ae5a..7f36308df 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -55,6 +55,9 @@ type filesystemProperties struct { // Hash and signing algorithm for avbtool. Default is SHA256_RSA4096. Avb_algorithm *string + // Name of the partition stored in vbmeta desc. Defaults to the name of this module. + Partition_name *string + // Type of the filesystem. Currently, ext4, cpio, and compressed_cpio are supported. Default // is ext4. Type *string @@ -279,7 +282,8 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (propFile android. 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") - addStr("partition_name", f.Name()) + partitionName := proptools.StringDefault(f.properties.Partition_name, f.Name()) + addStr("partition_name", partitionName) } if proptools.String(f.properties.File_contexts) != "" { -- cgit v1.2.3-59-g8ed1b