OSDN Git Service

build: Let the verity signer and metadata builders ask for a password
authorRicardo Cerqueira <ricardo@cyngn.com>
Mon, 4 Jul 2016 15:34:19 +0000 (16:34 +0100)
committerSteve Kondik <steve@cyngn.com>
Sun, 4 Sep 2016 04:47:36 +0000 (21:47 -0700)
Don't grab stdin/out for these tools. We want to know when a password
is being requested (and be able to actually provide one) if the corresponding
key needs it

Change-Id: I8dd439322b7d8942adc9ce7ce0912fb20c69654f
Ref: CYNGNOS-3156

tools/releasetools/build_image.py
tools/releasetools/common.py

index 37c52f2..5a2bd42 100755 (executable)
@@ -176,10 +176,14 @@ def BuildVerityMetadata(image_size, verity_metadata_path, root_hash, salt,
   cmd = cmd_template % (image_size, verity_metadata_path, root_hash, salt,
                         block_device, signer_path, key)
   print(cmd)
-  status, output = getstatusoutput(cmd)
-  if status:
-    print("Could not build verity metadata! Error: %s" % output)
+  runcmd = ["system/extras/verity/build_verity_metadata.py", image_size, verity_metadata_path, root_hash, salt, block_device, signer_path, key];
+  sp = subprocess.Popen(runcmd)
+  sp.wait()
+
+  if sp.returncode != 0:
+    print("Could not build verity metadata!")
     return False
+
   return True
 
 def Append2Simg(sparse_image_path, unsparse_image_path, error_message):
index 24b6b29..c4d2373 100755 (executable)
@@ -584,7 +584,7 @@ def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None,
     cmd.extend([path, img.name,
                 info_dict["verity_key"] + ".pk8",
                 info_dict["verity_key"] + ".x509.pem", img.name])
-    p = Run(cmd, stdout=subprocess.PIPE)
+    p = Run(cmd)
     p.communicate()
     assert p.returncode == 0, "boot_signer of %s image failed" % path