From 19241c11bd1cf039bcd74859426ad22282849912 Mon Sep 17 00:00:00 2001 From: Alex Deymo Date: Thu, 4 Feb 2016 22:29:29 -0800 Subject: [PATCH] ota_from_target_files: Include the payload properties. When building an A/B OTA package, include the payload.bin properties as a key-value pairs text file, so it can easily be passed to update_engine during payload application. Bug: 26991255 TEST=`ota_from_target_files out/dist/${BOARD}-target_files.zip full-ota.zip` includes the properties. Change-Id: I445c8a8e412a8e16b48b6ee626db8e27d48a38a9 --- tools/releasetools/ota_from_target_files.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index a56776011..ed300a7c7 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -1186,7 +1186,18 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file, p1.wait() assert p1.returncode == 0, "brillo_update_payload sign failed" - # Add the signed payload file into the zip. + # 4. Dump the signed payload properties. + properties_file = common.MakeTempFile(prefix="payload-properties-", + suffix=".txt") + cmd = ["brillo_update_payload", "properties", + "--payload", signed_payload_file, + "--properties_file", properties_file] + p1 = common.Run(cmd, stdout=subprocess.PIPE) + p1.wait() + assert p1.returncode == 0, "brillo_update_payload properties failed" + + # Add the signed payload file and properties into the zip. + common.ZipWrite(output_zip, properties_file, arcname="payload_properties.txt") common.ZipWrite(output_zip, signed_payload_file, arcname="payload.bin", compress_type=zipfile.ZIP_STORED) WriteMetadata(metadata, output_zip)