From 31a0de00a4b44fa1a8ac32c44cf16e609bd70225 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 17 Feb 2017 23:21:31 -0800 Subject: [PATCH] releasetools: Allow using futility-host to sign old TF.zip. Commit e98fb7a8d3a460891f6c21fafbe62a86b50d3d1d switched to using futility-host instead of the prebuilt futility. This CL adds support to handle signing old TF.zip that still says "futility=prebuilt/..." in META/misc_info.txt. Bug: 35467608 Test: Generate otatools.zip and sign an old ryu TF.zip. Change-Id: I48a9cc918c7afce361e1ec9bc4f85f74fa92566e (cherry picked from commit 4f104d1b94990a101031c1b806aab00594b3e5b4) --- tools/releasetools/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index a4862a6ab..43e387068 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -497,7 +497,13 @@ def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None, elif info_dict.get("vboot", None): path = "/" + os.path.basename(sourcedir).lower() img_keyblock = tempfile.NamedTemporaryFile() - cmd = [info_dict["vboot_signer_cmd"], info_dict["futility"], + # We have switched from the prebuilt futility binary to using the tool + # (futility-host) built from the source. Override the setting in the old + # TF.zip. + futility = info_dict["futility"] + if futility.startswith("prebuilts/"): + futility = "futility-host" + cmd = [info_dict["vboot_signer_cmd"], futility, img_unsigned.name, info_dict["vboot_key"] + ".vbpubk", info_dict["vboot_key"] + ".vbprivk", info_dict["vboot_subkey"] + ".vbprivk", -- 2.11.0