From ade0d3f4a2b0f0cb361fb20c79de74b3e674f17f Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 21 Aug 2019 16:37:11 -0700 Subject: [PATCH] merge_target_files: Checks VINTF metadata of resulting target files Bug: 139300422 Bug: 131425279 Test: test_merge_target_files Change-Id: I972db2fc40555ab0fc38316f0a6e6f5e8f163371 --- tools/releasetools/Android.bp | 1 + tools/releasetools/merge_target_files.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tools/releasetools/Android.bp b/tools/releasetools/Android.bp index a920ffb13d..fa65767a2e 100644 --- a/tools/releasetools/Android.bp +++ b/tools/releasetools/Android.bp @@ -335,6 +335,7 @@ python_binary_host { libs: [ "releasetools_add_img_to_target_files", "releasetools_build_super_image", + "releasetools_check_target_files_vintf", "releasetools_common", "releasetools_img_from_target_files", "releasetools_ota_from_target_files", diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py index 916c803744..61c4f4ecc9 100755 --- a/tools/releasetools/merge_target_files.py +++ b/tools/releasetools/merge_target_files.py @@ -87,6 +87,7 @@ import zipfile import add_img_to_target_files import build_super_image +import check_target_files_vintf import common import img_from_target_files import ota_from_target_files @@ -906,6 +907,9 @@ def merge_target_files(temp_dir, framework_target_files, framework_item_list, vendor_target_files, vendor_item_list, framework_misc_info_keys, rebuild_recovery) + if not check_target_files_vintf.CheckVintf(output_target_files_temp_dir): + raise RuntimeError("Incompatible VINTF metadata") + generate_images(output_target_files_temp_dir, rebuild_recovery) generate_super_empty_image(output_target_files_temp_dir, output_super_empty)