Revert "Revert "releasetools: Allow using futility-host to sign old TF.zip.""
am: 77620b5a45

Change-Id: Id9071f867b430c74231003be3b40b43aa4f72141
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 3874c1f..d69192e 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -505,7 +505,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",