Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 852a5b53 authored by Baligh Uddin's avatar Baligh Uddin Committed by Tao Bao
Browse files

Add bootsigner path as an option

Change-Id: I3d804b7937aafea8274b06edab097a6dca8f04cd
(cherry picked from commit e204868f)
parent 44158945
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ class Options(object):
    self.java_args = "-Xmx2048m" # JVM Args
    self.public_key_suffix = ".x509.pem"
    self.private_key_suffix = ".pk8"
    # use otatools built boot_signer by default
    self.boot_signer_path = "boot_signer"
    self.verbose = False
    self.tempfiles = []
    self.device_specific = None
@@ -359,7 +361,8 @@ def BuildBootableImage(sourcedir, fs_config_file, info_dict=None):

  if info_dict.get("verity_key", None):
    path = "/" + os.path.basename(sourcedir).lower()
    cmd = ["boot_signer", path, img.name, info_dict["verity_key"] + ".pk8",
    cmd = [OPTIONS.boot_signer_path, path, img.name,
           info_dict["verity_key"] + ".pk8",
           info_dict["verity_key"] + ".x509.pem", img.name]
    p = Run(cmd, stdout=subprocess.PIPE)
    p.communicate()
@@ -653,7 +656,8 @@ def ParseOptions(argv,
        argv, "hvp:s:x:" + extra_opts,
        ["help", "verbose", "path=", "signapk_path=", "extra_signapk_args=",
         "java_path=", "java_args=", "public_key_suffix=",
         "private_key_suffix=", "device_specific=", "extra="] +
         "private_key_suffix=", "boot_signer_path=", "device_specific=",
         "extra="] +
        list(extra_long_opts))
  except getopt.GetoptError as err:
    Usage(docstring)
@@ -680,6 +684,8 @@ def ParseOptions(argv,
      OPTIONS.public_key_suffix = a
    elif o in ("--private_key_suffix",):
      OPTIONS.private_key_suffix = a
    elif o in ("--boot_signer_path",):
      OPTIONS.boot_signer_path = a
    elif o in ("-s", "--device_specific"):
      OPTIONS.device_specific = a
    elif o in ("-x", "--extra"):