summaryrefslogtreecommitdiff
path: root/scripts/update_payload/test_utils.py
diff options
context:
space:
mode:
authorGilad Arnold <garnold@chromium.org>2015-07-13 18:06:33 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-17 00:06:02 +0000
commit06eea33088be4418264d12820f94c700977e3fa6 (patch)
tree3c2c1d424bb8009cef625351b376bc6c33960198 /scripts/update_payload/test_utils.py
parentb92167f787b4d9ea4db453b2464509489e1e606b (diff)
paycheck: Properly infer usable target partition size.
The payload checker used to restrict read/write block indexes to the reported target filesystem size, unless explicitly given a partition size value to use instead. So far this value was easy for clients (like paygen) to come up with, because it was constant at 2GB for all known boards. However this is no longer the case, and there is no an easy way for clients to know the actual target partition size after the payload has been generated (nor is it encoded in the payload). This adds logic for inferring the usable target partition size into PayloadChecker() itself, as follows: 1) If a partition size was given, use that. 2) Else, if this is an old delta (minor version < 2), use the aforementioned default. This is necessary because older deltas may actually read/write data beyond the filesystem size. It is also sufficient because any old delta payload we generate should write to a 2GB target partition. 3) In all other cases, just use the new filesystem size, as encoded in the payload. This is a safe choice for full updates and newer deltas. The command-line tool is updated accordingly. Note that the usable kernel partition size inference remains unaffected. BUG=chromium:508566 TEST=Unit tests (revised) Change-Id: I987f28fdfe1d82d0f6f565ae9852b7b11bce13e8 Reviewed-on: https://chromium-review.googlesource.com/285447 Reviewed-by: Gilad Arnold <garnold@chromium.org> Tested-by: Gilad Arnold <garnold@chromium.org> Commit-Queue: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'scripts/update_payload/test_utils.py')
0 files changed, 0 insertions, 0 deletions