OSDN Git Service

releasetools: Allow using futility-host to sign old TF.zip.
authorTao Bao <tbao@google.com>
Sat, 18 Feb 2017 07:21:31 +0000 (23:21 -0800)
committerTao Bao <tbao@google.com>
Sat, 18 Feb 2017 07:27:44 +0000 (23:27 -0800)
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

tools/releasetools/common.py

index 7b3e9ba..027e9f5 100644 (file)
@@ -518,7 +518,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",