OSDN Git Service

Specify --max_timestamp when calling brillo_update_payload.
authorTao Bao <tbao@google.com>
Tue, 3 Oct 2017 21:17:57 +0000 (14:17 -0700)
committerTao Bao <tbao@google.com>
Tue, 3 Oct 2017 21:18:33 +0000 (14:18 -0700)
Bug: 36232423
Test: Create OTA packages (full, incremental and downgrade) with
      ota_from_target_files.py; check the parameters passed down to
      brillo_update_payload.
Change-Id: I3af397f05fe16f4a9f0eb73e8272bac6afdc002a

tools/releasetools/ota_from_target_files.py

index a9e1606..9ca6bde 100755 (executable)
@@ -1125,6 +1125,11 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file,
          "--target_image", target_file]
   if source_file is not None:
     cmd.extend(["--source_image", source_file])
+  if OPTIONS.downgrade:
+    max_timestamp = GetBuildProp("ro.build.date.utc", OPTIONS.source_info_dict)
+  else:
+    max_timestamp = metadata["post-timestamp"]
+  cmd.extend(["--max_timestamp", max_timestamp])
   p1 = common.Run(cmd, stdout=log_file, stderr=subprocess.STDOUT)
   p1.communicate()
   assert p1.returncode == 0, "brillo_update_payload generate failed"