Merge "releasetools: Kill the use of os.getenv('AVBTOOL')."
am: e3f9dc6113
Change-Id: I31c769d45d049a0867aed3db84790fb8b2db1c6d
This commit is contained in:
@@ -260,7 +260,7 @@ def AddDtbo(output_zip):
|
|||||||
|
|
||||||
# AVB-sign the image as needed.
|
# AVB-sign the image as needed.
|
||||||
if OPTIONS.info_dict.get("avb_enable") == "true":
|
if OPTIONS.info_dict.get("avb_enable") == "true":
|
||||||
avbtool = os.getenv('AVBTOOL') or OPTIONS.info_dict["avb_avbtool"]
|
avbtool = OPTIONS.info_dict["avb_avbtool"]
|
||||||
part_size = OPTIONS.info_dict["dtbo_size"]
|
part_size = OPTIONS.info_dict["dtbo_size"]
|
||||||
# The AVB hash footer will be replaced if already present.
|
# The AVB hash footer will be replaced if already present.
|
||||||
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
||||||
@@ -428,7 +428,7 @@ def AddVBMeta(output_zip, partitions, name, needed_partitions):
|
|||||||
logger.info("%s.img already exists; not rebuilding...", name)
|
logger.info("%s.img already exists; not rebuilding...", name)
|
||||||
return img.name
|
return img.name
|
||||||
|
|
||||||
avbtool = os.getenv('AVBTOOL') or OPTIONS.info_dict["avb_avbtool"]
|
avbtool = OPTIONS.info_dict["avb_avbtool"]
|
||||||
cmd = [avbtool, "make_vbmeta_image", "--output", img.name]
|
cmd = [avbtool, "make_vbmeta_image", "--output", img.name]
|
||||||
common.AppendAVBSigningArgs(cmd, name)
|
common.AppendAVBSigningArgs(cmd, name)
|
||||||
|
|
||||||
|
@@ -739,6 +739,7 @@ def SaveGlobalDict(filename, glob_dict):
|
|||||||
with open(filename, "w") as f:
|
with open(filename, "w") as f:
|
||||||
f.writelines(["%s=%s" % (key, value) for (key, value) in glob_dict.items()])
|
f.writelines(["%s=%s" % (key, value) for (key, value) in glob_dict.items()])
|
||||||
|
|
||||||
|
|
||||||
def ExtractSystemOtherAvbKey(in_dir, glob_dict):
|
def ExtractSystemOtherAvbKey(in_dir, glob_dict):
|
||||||
if glob_dict.get("avb_system_extract_system_other_key") != "true":
|
if glob_dict.get("avb_system_extract_system_other_key") != "true":
|
||||||
return
|
return
|
||||||
@@ -754,12 +755,13 @@ def ExtractSystemOtherAvbKey(in_dir, glob_dict):
|
|||||||
|
|
||||||
# Extracts the public key used to sign system_other.img, into system.img:
|
# Extracts the public key used to sign system_other.img, into system.img:
|
||||||
# /system/etc/security/avb/system_other.avbpubkey.
|
# /system/etc/security/avb/system_other.avbpubkey.
|
||||||
avbtool = os.getenv('AVBTOOL') or glob_dict.get("avb_avbtool")
|
avbtool = glob_dict.get("avb_avbtool")
|
||||||
extract_from = glob_dict.get("avb_system_other_key_path")
|
extract_from = glob_dict.get("avb_system_other_key_path")
|
||||||
cmd = [avbtool, "extract_public_key", "--key", extract_from,
|
cmd = [avbtool, "extract_public_key", "--key", extract_from,
|
||||||
"--output", extract_to]
|
"--output", extract_to]
|
||||||
common.RunAndCheckOutput(cmd, verbose=False)
|
common.RunAndCheckOutput(cmd, verbose=False)
|
||||||
|
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
if len(argv) < 4 or len(argv) > 5:
|
if len(argv) < 4 or len(argv) > 5:
|
||||||
print(__doc__)
|
print(__doc__)
|
||||||
|
@@ -704,7 +704,7 @@ def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None,
|
|||||||
|
|
||||||
# AVB: if enabled, calculate and add hash to boot.img or recovery.img.
|
# AVB: if enabled, calculate and add hash to boot.img or recovery.img.
|
||||||
if info_dict.get("avb_enable") == "true":
|
if info_dict.get("avb_enable") == "true":
|
||||||
avbtool = os.getenv('AVBTOOL') or info_dict["avb_avbtool"]
|
avbtool = info_dict["avb_avbtool"]
|
||||||
part_size = info_dict[partition_name + "_size"]
|
part_size = info_dict[partition_name + "_size"]
|
||||||
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
||||||
"--partition_size", str(part_size), "--partition_name",
|
"--partition_size", str(part_size), "--partition_name",
|
||||||
|
Reference in New Issue
Block a user