summaryrefslogtreecommitdiff
path: root/scripts/update_payload/payload.py
diff options
context:
space:
mode:
authorGilad Arnold <garnold@chromium.org>2013-05-08 13:12:53 -0700
committerChromeBot <chrome-bot@google.com>2013-05-13 19:31:11 -0700
commit272a499e2db9d72a64490ca5ccbebe8155fc2966 (patch)
treed43741ced85b1740f1acbc26da3b94da0b4dddcb /scripts/update_payload/payload.py
parent16416600a92a60294cd57aceec170a13ed72ed19 (diff)
paycheck: support for in-place BSDIFF operations
When applying BSDIFF operations in payloads, we used to extract the block sequences from the old partition and serialize it into a temporary file, and vice versa for the new partition. This worked but did not allow us to test bspatch as it is actually being used by the update engine. This CLs allows paycheck to invoke bspatch so that it reads/writes block extents directly from/to the partition file, in the same way it's being used by the update engine. Since performance is the same, this is the new default behavior; users can opt for the aforementioned old behavior using a command-line flag (-x or --extract-bsdiff). BUG=chromium:229705 TEST=bspatch invoked differently depending on the -x flag TEST=Passes unit/integration tests Change-Id: I8821754e1163b357617ece6befa42d1c2e575930 Reviewed-on: https://gerrit.chromium.org/gerrit/50486 Tested-by: Gilad Arnold <garnold@chromium.org> Reviewed-by: Darin Petkov <petkov@chromium.org> Commit-Queue: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'scripts/update_payload/payload.py')
-rw-r--r--scripts/update_payload/payload.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/update_payload/payload.py b/scripts/update_payload/payload.py
index 34ebaae7..fefc7e4f 100644
--- a/scripts/update_payload/payload.py
+++ b/scripts/update_payload/payload.py
@@ -206,7 +206,7 @@ class Payload(object):
report_out_file=report_out_file)
def Apply(self, new_kernel_part, new_rootfs_part, old_kernel_part=None,
- old_rootfs_part=None):
+ old_rootfs_part=None, bsdiff_in_place=True):
"""Applies the update payload.
Args:
@@ -214,6 +214,7 @@ class Payload(object):
new_rootfs_part: name of dest rootfs partition file
old_kernel_part: name of source kernel partition file (optional)
old_rootfs_part: name of source rootfs partition file (optional)
+ bsdiff_in_place: whether to perform BSDIFF operations in-place (optional)
Raises:
PayloadError if payload application failed.
@@ -221,7 +222,7 @@ class Payload(object):
self._AssertInit()
# Create a short-lived payload applier object and run it.
- helper = applier.PayloadApplier(self)
+ helper = applier.PayloadApplier(self, bsdiff_in_place=bsdiff_in_place)
helper.Run(new_kernel_part, new_rootfs_part,
old_kernel_part=old_kernel_part,
old_rootfs_part=old_rootfs_part)