Merge changes from topic "sign_target_files_iot-aosp" am: dde5f11e6a

am: f5c481aee9

Change-Id: I036c3f5ca1dd6f6d6900e507de3c5c79656bd1c3
This commit is contained in:
Bryan Henry 2018-04-27 11:18:00 -07:00 committed by android-build-merger
commit 7db558c229
3 changed files with 21 additions and 7 deletions

View file

@ -2353,6 +2353,7 @@ OTATOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \
$(HOST_OUT_EXECUTABLES)/delta_generator \
$(AVBTOOL) \
$(BLK_ALLOC_TO_BASE_FS) \
$(BPTTOOL) \
$(BROTLI) \
$(BUILD_VERITY_METADATA) \
$(BUILD_VERITY_TREE)
@ -2402,6 +2403,8 @@ $(BUILT_OTATOOLS_PACKAGE): zip_root := $(call intermediates-dir-for,PACKAGING,ot
OTATOOLS_DEPS := \
system/extras/ext4_utils/mke2fs.conf \
external/avb/test/data/atx_metadata.bin \
external/avb/test/data/testkey_atx_psk.pem \
external/avb/test/data/testkey_rsa4096.pem \
$(sort $(shell find system/update_engine/scripts -name \*.pyc -prune -o -type f -print)) \
$(sort $(shell find build/target/product/security -type f -name \*.x509.pem -o -name \*.pk8 -o \

View file

@ -415,9 +415,10 @@ def AddVBMeta(output_zip, partitions):
assert found, 'failed to find %s' % (image_path,)
cmd.extend(split_args)
p = common.Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.communicate()
assert p.returncode == 0, "avbtool make_vbmeta_image failed"
p = common.Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdoutdata, _ = p.communicate()
assert p.returncode == 0, \
"avbtool make_vbmeta_image failed:\n{}".format(stdoutdata)
img.Write()
@ -427,7 +428,7 @@ def AddPartitionTable(output_zip):
img = OutputFile(
output_zip, OPTIONS.input_tmp, "IMAGES", "partition-table.img")
bpt = OutputFile(
output_zip, OPTIONS.input_tmp, "IMAGES", "partition-table.bpt")
output_zip, OPTIONS.input_tmp, "META", "partition-table.bpt")
# use BPTTOOL from environ, or "bpttool" if empty or not set.
bpttool = os.getenv("BPTTOOL") or "bpttool"
@ -444,9 +445,10 @@ def AddPartitionTable(output_zip):
if args:
cmd.extend(shlex.split(args))
p = common.Run(cmd, stdout=subprocess.PIPE)
p.communicate()
assert p.returncode == 0, "bpttool make_table failed"
p = common.Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdoutdata, _ = p.communicate()
assert p.returncode == 0, \
"bpttool make_table failed:\n{}".format(stdoutdata)
img.Write()
bpt.Write()

View file

@ -222,6 +222,15 @@ def LoadInfoDict(input_file, input_dir=None):
vendor_base_fs_file,))
del d["vendor_base_fs_file"]
# If board_bpt_input_files property is defined then bpttool is being used to
# generate the partition table. When signing target-files, the combined
# partition table definition is copied into META/partition-table.bpt since
# the original input files aren't available.
if "board_bpt_input_files" in d:
board_bpt_input_files = os.path.join(input_dir, "META", "partition-table.bpt")
if os.path.exists(board_bpt_input_files):
d["board_bpt_input_files"] = board_bpt_input_files
def makeint(key):
if key in d:
d[key] = int(d[key], 0)