am 602a84e0: fix releasetools for non-linux architectures
Merge commit '602a84e0bbf1807a9403cfa50184241f6fc035c4' * commit '602a84e0bbf1807a9403cfa50184241f6fc035c4': fix releasetools for non-linux architectures
This commit is contained in:
commit
d6fb2d40b5
|
@ -887,6 +887,7 @@ $(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR)
|
||||||
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) otatools
|
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) otatools
|
||||||
@echo "Package OTA: $@"
|
@echo "Package OTA: $@"
|
||||||
$(hide) ./build/tools/releasetools/ota_from_target_files \
|
$(hide) ./build/tools/releasetools/ota_from_target_files \
|
||||||
|
-p $(HOST_OUT) \
|
||||||
-b $(TARGET_DEVICE_DIR)/BoardConfig.mk \
|
-b $(TARGET_DEVICE_DIR)/BoardConfig.mk \
|
||||||
-k $(KEY_CERT_PAIR) \
|
-k $(KEY_CERT_PAIR) \
|
||||||
$(BUILT_TARGET_FILES_PACKAGE) $@
|
$(BUILT_TARGET_FILES_PACKAGE) $@
|
||||||
|
@ -1012,6 +1013,7 @@ INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
|
||||||
$(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) otatools
|
$(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) otatools
|
||||||
@echo "Package: $@"
|
@echo "Package: $@"
|
||||||
$(hide) ./build/tools/releasetools/img_from_target_files \
|
$(hide) ./build/tools/releasetools/img_from_target_files \
|
||||||
|
-p $(HOST_OUT) \
|
||||||
-b $(TARGET_DEVICE_DIR)/BoardConfig.mk \
|
-b $(TARGET_DEVICE_DIR)/BoardConfig.mk \
|
||||||
$(BUILT_TARGET_FILES_PACKAGE) $@
|
$(BUILT_TARGET_FILES_PACKAGE) $@
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,7 @@ if not hasattr(os, "SEEK_SET"):
|
||||||
|
|
||||||
class Options(object): pass
|
class Options(object): pass
|
||||||
OPTIONS = Options()
|
OPTIONS = Options()
|
||||||
OPTIONS.signapk_jar = "out/host/linux-x86/framework/signapk.jar"
|
OPTIONS.search_path = "out/host/linux-x86"
|
||||||
OPTIONS.dumpkey_jar = "out/host/linux-x86/framework/dumpkey.jar"
|
|
||||||
OPTIONS.max_image_size = {}
|
OPTIONS.max_image_size = {}
|
||||||
OPTIONS.verbose = False
|
OPTIONS.verbose = False
|
||||||
OPTIONS.tempfiles = []
|
OPTIONS.tempfiles = []
|
||||||
|
@ -154,7 +153,7 @@ def GetKeyPasswords(keylist):
|
||||||
no_passwords.append(k)
|
no_passwords.append(k)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
p = subprocess.Popen(["openssl", "pkcs8", "-in", k+".pk8",
|
p = Run(["openssl", "pkcs8", "-in", k+".pk8",
|
||||||
"-inform", "DER", "-nocrypt"],
|
"-inform", "DER", "-nocrypt"],
|
||||||
stdin=devnull.fileno(),
|
stdin=devnull.fileno(),
|
||||||
stdout=devnull.fileno(),
|
stdout=devnull.fileno(),
|
||||||
|
@ -188,7 +187,8 @@ def SignFile(input_name, output_name, key, password, align=None):
|
||||||
else:
|
else:
|
||||||
sign_name = output_name
|
sign_name = output_name
|
||||||
|
|
||||||
p = subprocess.Popen(["java", "-jar", OPTIONS.signapk_jar,
|
p = Run(["java", "-jar",
|
||||||
|
os.path.join(OPTIONS.search_path, "framework", "signapk.jar"),
|
||||||
key + ".x509.pem",
|
key + ".x509.pem",
|
||||||
key + ".pk8",
|
key + ".pk8",
|
||||||
input_name, sign_name],
|
input_name, sign_name],
|
||||||
|
@ -201,7 +201,7 @@ def SignFile(input_name, output_name, key, password, align=None):
|
||||||
raise ExternalError("signapk.jar failed: return code %s" % (p.returncode,))
|
raise ExternalError("signapk.jar failed: return code %s" % (p.returncode,))
|
||||||
|
|
||||||
if align:
|
if align:
|
||||||
p = subprocess.Popen(["zipalign", "-f", str(align), sign_name, output_name])
|
p = Run(["zipalign", "-f", str(align), sign_name, output_name])
|
||||||
p.communicate()
|
p.communicate()
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise ExternalError("zipalign failed: return code %s" % (p.returncode,))
|
raise ExternalError("zipalign failed: return code %s" % (p.returncode,))
|
||||||
|
@ -230,8 +230,8 @@ def CheckSize(data, target):
|
||||||
|
|
||||||
COMMON_DOCSTRING = """
|
COMMON_DOCSTRING = """
|
||||||
-p (--path) <dir>
|
-p (--path) <dir>
|
||||||
Prepend <dir> to the list of places to search for binaries run
|
Prepend <dir>/bin to the list of places to search for binaries
|
||||||
by this script.
|
run by this script, and expect to find jars in <dir>/framework.
|
||||||
|
|
||||||
-v (--verbose)
|
-v (--verbose)
|
||||||
Show command lines being executed.
|
Show command lines being executed.
|
||||||
|
@ -273,15 +273,13 @@ def ParseOptions(argv,
|
||||||
elif o in ("-v", "--verbose"):
|
elif o in ("-v", "--verbose"):
|
||||||
OPTIONS.verbose = True
|
OPTIONS.verbose = True
|
||||||
elif o in ("-p", "--path"):
|
elif o in ("-p", "--path"):
|
||||||
os.environ["PATH"] = a + os.pathsep + os.environ["PATH"]
|
OPTIONS.search_path = a
|
||||||
path_specified = True
|
|
||||||
else:
|
else:
|
||||||
if extra_option_handler is None or not extra_option_handler(o, a):
|
if extra_option_handler is None or not extra_option_handler(o, a):
|
||||||
assert False, "unknown option \"%s\"" % (o,)
|
assert False, "unknown option \"%s\"" % (o,)
|
||||||
|
|
||||||
if not path_specified:
|
os.environ["PATH"] = (os.path.join(OPTIONS.search_path, "bin") +
|
||||||
os.environ["PATH"] = ("out/host/linux-x86/bin" + os.pathsep +
|
os.pathsep + os.environ["PATH"])
|
||||||
os.environ["PATH"])
|
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,9 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip):
|
||||||
# recovery uses a version of the key that has been slightly
|
# recovery uses a version of the key that has been slightly
|
||||||
# predigested (by DumpPublicKey.java) and put in res/keys.
|
# predigested (by DumpPublicKey.java) and put in res/keys.
|
||||||
|
|
||||||
p = common.Run(["java", "-jar", OPTIONS.dumpkey_jar] + mapped_keys,
|
p = common.Run(["java", "-jar",
|
||||||
|
os.path.join(OPTIONS.search_path, "framework", "dumpkey.jar")]
|
||||||
|
+ mapped_keys,
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
data, _ = p.communicate()
|
data, _ = p.communicate()
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
|
|
Loading…
Reference in New Issue