Add verity support to `make dist`.
Without this, system images will be built that do not contain the
necessary bits for verification.
Change-Id: Icaa636085dbfd386424c90dfbe404c5960df0fe4
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index d3f7144..2fb9e23 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -222,8 +222,10 @@
fs_type = prop_dict.get("fs_type", "")
run_fsck = False
+ is_verity_partition = prop_dict.get("mount_point") == prop_dict.get("verity_mountpoint")
+ verity_supported = prop_dict.get("verity") == "true"
# adjust the partition size to make room for the hashes if this is to be verified
- if prop_dict.get("verity") == "true":
+ if verity_supported and is_verity_partition:
partition_size = int(prop_dict.get("partition_size"))
adjusted_size = AdjustPartitionSizeForVerity(partition_size)
if not adjusted_size:
@@ -258,7 +260,7 @@
return False
# create the verified image if this is to be verified
- if prop_dict.get("verity") == "true":
+ if verity_supported and is_verity_partition:
if not MakeVerityEnabledImage(out_file, prop_dict):
return False
@@ -301,7 +303,8 @@
"verity",
"verity_block_device",
"verity_key",
- "verity_signer_cmd"
+ "verity_signer_cmd",
+ "verity_mountpoint"
)
for p in common_props:
copy_prop(p, p)