summaryrefslogtreecommitdiff
path: root/scripts/update_payload/payload.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/update_payload/payload.py')
-rw-r--r--scripts/update_payload/payload.py26
1 files changed, 10 insertions, 16 deletions
diff --git a/scripts/update_payload/payload.py b/scripts/update_payload/payload.py
index 15f66d02..2a0cb58d 100644
--- a/scripts/update_payload/payload.py
+++ b/scripts/update_payload/payload.py
@@ -274,8 +274,8 @@ class Payload(object):
def Check(self, pubkey_file_name=None, metadata_sig_file=None,
metadata_size=0, report_out_file=None, assert_type=None,
- block_size=0, rootfs_part_size=0, kernel_part_size=0,
- allow_unhashed=False, disabled_tests=()):
+ block_size=0, part_sizes=None, allow_unhashed=False,
+ disabled_tests=()):
"""Checks the payload integrity.
Args:
@@ -285,8 +285,7 @@ class Payload(object):
report_out_file: file object to dump the report to
assert_type: assert that payload is either 'full' or 'delta'
block_size: expected filesystem / payload block size
- rootfs_part_size: the size of (physical) rootfs partitions in bytes
- kernel_part_size: the size of (physical) kernel partitions in bytes
+ part_sizes: map of partition label to (physical) size in bytes
allow_unhashed: allow unhashed operation blobs
disabled_tests: list of tests to disable
@@ -302,20 +301,17 @@ class Payload(object):
helper.Run(pubkey_file_name=pubkey_file_name,
metadata_sig_file=metadata_sig_file,
metadata_size=metadata_size,
- rootfs_part_size=rootfs_part_size,
- kernel_part_size=kernel_part_size,
+ part_sizes=part_sizes,
report_out_file=report_out_file)
- def Apply(self, new_kernel_part, new_rootfs_part, old_kernel_part=None,
- old_rootfs_part=None, bsdiff_in_place=True, bspatch_path=None,
- puffpatch_path=None, truncate_to_expected_size=True):
+ def Apply(self, new_parts, old_parts=None, bsdiff_in_place=True,
+ bspatch_path=None, puffpatch_path=None,
+ truncate_to_expected_size=True):
"""Applies the update payload.
Args:
- new_kernel_part: name of dest kernel partition file
- 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)
+ new_parts: map of partition name to dest partition file
+ old_parts: map of partition name to partition file (optional)
bsdiff_in_place: whether to perform BSDIFF operations in-place (optional)
bspatch_path: path to the bspatch binary (optional)
puffpatch_path: path to the puffpatch binary (optional)
@@ -333,6 +329,4 @@ class Payload(object):
self, bsdiff_in_place=bsdiff_in_place, bspatch_path=bspatch_path,
puffpatch_path=puffpatch_path,
truncate_to_expected_size=truncate_to_expected_size)
- helper.Run(new_kernel_part, new_rootfs_part,
- old_kernel_part=old_kernel_part,
- old_rootfs_part=old_rootfs_part)
+ helper.Run(new_parts, old_parts=old_parts)