From d06f07eef48005a3fa99fdd0ca5380d60c5ae459 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Thu, 9 Jun 2016 14:18:45 -0700 Subject: [PATCH] Add build.version.incremental to metadata Add the build property "build.version.incremental" of the source (if present) and target files to the metadata of the ota update package. Example of metadata: .... post-build-incremental=2951741 post-timestamp=1465345123 pre-build-incremental=2943039 pre-device=bullhead ... Bug: 28658632 Change-Id: I889e8ccf39633b1b35590751001a42d1b05d5514 --- tools/releasetools/ota_from_target_files.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 861c4850de..4eb15cf9ae 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -834,6 +834,10 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip): OPTIONS.target_info_dict) metadata["pre-build"] = source_fp metadata["post-build"] = target_fp + metadata["pre-build-incremental"] = GetBuildProp( + "ro.build.version.incremental", OPTIONS.source_info_dict) + metadata["post-build-incremental"] = GetBuildProp( + "ro.build.version.incremental", OPTIONS.target_info_dict) source_boot = common.GetBootableImage( "/tmp/boot.img", "boot.img", OPTIONS.source_tmp, "BOOT", @@ -1178,6 +1182,8 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file, metadata = { "post-build": CalculateFingerprint(oem_props, oem_dict, OPTIONS.info_dict), + "post-build-incremental" : GetBuildProp("ro.build.version.incremental", + OPTIONS.info_dict), "pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict, OPTIONS.info_dict), "post-timestamp": GetBuildProp("ro.build.date.utc", OPTIONS.info_dict), @@ -1188,6 +1194,8 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file, if source_file is not None: metadata["pre-build"] = CalculateFingerprint(oem_props, oem_dict, OPTIONS.source_info_dict) + metadata["pre-build-incremental"] = GetBuildProp( + "ro.build.version.incremental", OPTIONS.source_info_dict) # 1. Generate payload. payload_file = common.MakeTempFile(prefix="payload-", suffix=".bin") @@ -1493,6 +1501,10 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip): metadata["pre-build"] = source_fp metadata["post-build"] = target_fp + metadata["pre-build-incremental"] = GetBuildProp( + "ro.build.version.incremental", OPTIONS.source_info_dict) + metadata["post-build-incremental"] = GetBuildProp( + "ro.build.version.incremental", OPTIONS.target_info_dict) source_boot = common.GetBootableImage( "/tmp/boot.img", "boot.img", OPTIONS.source_tmp, "BOOT",