releasetools: Kill the use of os.getenv('AVBTOOL').

OTA tools should pick up the avbtool, as listed in dict['avb_avbtool'],
from the current PATH (plus bin/ under the dir specified via `--path`),
the same way as handling all other host tools.

Test: `m dist`
Change-Id: I3eb4d2c61979b03d9c23b2403d9a38cf052d87ea
This commit is contained in:
Tao Bao
2019-03-18 14:01:38 -07:00
parent 0573298a18
commit f88e0ce01d
3 changed files with 6 additions and 4 deletions

View File

@@ -739,6 +739,7 @@ def SaveGlobalDict(filename, glob_dict):
with open(filename, "w") as f:
f.writelines(["%s=%s" % (key, value) for (key, value) in glob_dict.items()])
def ExtractSystemOtherAvbKey(in_dir, glob_dict):
if glob_dict.get("avb_system_extract_system_other_key") != "true":
return
@@ -754,12 +755,13 @@ def ExtractSystemOtherAvbKey(in_dir, glob_dict):
# Extracts the public key used to sign system_other.img, into system.img:
# /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")
cmd = [avbtool, "extract_public_key", "--key", extract_from,
"--output", extract_to]
common.RunAndCheckOutput(cmd, verbose=False)
def main(argv):
if len(argv) < 4 or len(argv) > 5:
print(__doc__)