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
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 7b3e9ba..027e9f5 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -518,7 +518,13 @@
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",