History log of /system/update_engine/scripts/update_payload/common.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
92161a7b83c3a491871a167a4d46e4e6b6101e81 29-Jun-2016 Sen Jiang <senj@google.com> paycheck: Support minor version 4.

From https://chromium-review.googlesource.com/#/c/333160/

Bug: 27156473
Test: ./scripts/update_payload/checker_unittest.py

Change-Id: I940debd5c878f622970e214fce75588f96d78407
/system/update_engine/scripts/update_payload/common.py
c2538fab9a7fc01c0216520874d711c8a9fbd9d3 24-Feb-2016 Sen Jiang <senj@chromium.org> update_payload: Regenerate protobuf to include IMGDIFF.

Generated from update_metadata.proto using protoc 2.5.0

BUG=b:26456666
TEST=./checker_unittest.py

Change-Id: I9dc7db00be8afb2f78e80bec910f9ca83a55a9a1
Reviewed-on: https://chromium-review.googlesource.com/329237
Commit-Ready: Sen Jiang <senj@chromium.org>
Tested-by: Sen Jiang <senj@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
/system/update_engine/scripts/update_payload/common.py
d6122bb9df5b593a3ab1fc35fab7f1a0caa53928 11-Dec-2015 Sen Jiang <senj@chromium.org> paycheck: Allow minor version 3 in applier.

Also fixed nits in checker.

BUG=chromium:568473
TEST=./checker_unittest.py

Change-Id: Ia791f4dc636e9c3a2921aeaa5f9dd01c247bf5bb
Reviewed-on: https://chromium-review.googlesource.com/317780
Trybot-Ready: Sen Jiang <senj@chromium.org>
Tested-by: Sen Jiang <senj@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Sen Jiang <senj@chromium.org>
/system/update_engine/scripts/update_payload/common.py
ef49735f40d0319151fd1e50abdbe377ab49ce72 15-Oct-2015 Alex Deymo <deymo@chromium.org> Parse Payload v2 header.

The update payload v2 contains an extra field in the header with the
size of the metadata signatures and the metadata signatures stored
right after the metadata. This patch parses the new payload format.

BUG=b:22024447
TEST=cros payload show payload-v2.bin; served a payload v2 with devserver.py

Change-Id: I8ce85af1df505f82f62a9d1cd57910cee6921f84
Reviewed-on: https://chromium-review.googlesource.com/306090
Commit-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
/system/update_engine/scripts/update_payload/common.py
2846677f9ec7725d9cf9513768477c873c19ba78 12-Sep-2015 Alex Deymo <deymo@chromium.org> paycheck: Update generated protobuf code.

This patch updates the generated update_metadata_pb2.py file with the
latest changes in the udpate_metadata.proto file. Some other changes in
the update_payload library were required to match the changes in the
.proto file.

BUG=b:23179128
TEST=paycheck unittests

Change-Id: I482d67d4a35f69438a26395eea77286994108b7a
Reviewed-on: https://chromium-review.googlesource.com/299498
Commit-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
/system/update_engine/scripts/update_payload/common.py
e4beff7dacb170298f86bb5bde1946b9b827b174 16-Jul-2015 Gilad Arnold <garnold@google.com> paycheck: Fix printing of operation index while tracing.

The block tracer is meant to scan operations in reverse order, to
discover the latest operation that writes to a block. Strangely, it only
reversed the operation indexes but scanned the actual operations in the
original order, which is both incorrect in the general case, but even
when it works the printed results are confusing (operations shown with
the wrong index). This fixes it.

Also some cosmetic changes to pacify the linter.

BUG=chromium:510909
TEST=paycheck -B now prints the correct operation indexes.

Change-Id: I65c44eeb450c229a2d5251737a0953716e124687
Reviewed-on: https://chromium-review.googlesource.com/286220
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
/system/update_engine/scripts/update_payload/common.py
cf6f30dd7ef1db9955f2e318c0e47ee00271f358 11-Jun-2015 Alex Deymo <deymo@chromium.org> update_payload: Remove ctypes dependency.

ctypes requires libffi.so to be installed in the system, but old
test_images don't have it, preventing "cros flash" to work there.
This patch removes the need for ctypes from common.py so cros flash
can work.

BUG=None
TEST=cros flash from R29 on link.

Change-Id: Idd0732660780081c26375a5214167b53f625e3ed
Reviewed-on: https://chromium-review.googlesource.com/277070
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/system/update_engine/scripts/update_payload/common.py
12f59aa1cffec0ee531daccc6de7469870f86302 06-Apr-2015 Allie Wood <alliewood@chromium.org> update_payload: Add SOURCE operations to applier.

Add support for SOURCE_COPY and SOURCE_BSDIFF to paycheck by adding
functions to apply these operations in applier. Also remove the source
to destination partition copy in the applier when minor version is 2.

Adds constants for source and inplace minor versions to common.py.

BUG=chromium:461635
TEST=unit tests and ./test_paycheck.sh with sample payloads.
CQ-DEPEND=CL:263747

Change-Id: I72d354d0609d205aab374dbdca6f30eb4de6a819
Reviewed-on: https://chromium-review.googlesource.com/264931
Tested-by: Allie Wood <alliewood@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Allie Wood <alliewood@chromium.org>
Trybot-Ready: Allie Wood <alliewood@chromium.org>
/system/update_engine/scripts/update_payload/common.py
c11dc7338639296ab99f89964a94bcc486500ba3 19-Feb-2015 Allie Wood <alliewood@chromium.org> update_payload: Regenerate proto file with new operation codes.

Regenerate update_metadata_pb2.py to include SOURCE_COPY and
SOURCE_BSDIFF, the new a to b operations for delta minor version 2.

BUG=chromium:459363
TEST=unit tests and `cbuildbot --remote link-release --hwtest`

Change-Id: I3631c7af97f57d48f86a34c37f97ec8c3cef088d
Reviewed-on: https://chromium-review.googlesource.com/250954
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Allie Wood <alliewood@chromium.org>
Tested-by: Allie Wood <alliewood@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
/system/update_engine/scripts/update_payload/common.py
a7aa0bcfa25b0d303447482980eca0973d4e939a 12-Nov-2013 Gilad Arnold <garnold@chromium.org> paycheck: strip newlines off of hash digest strings

This is an annoyance I'd like to get rid of.

BUG=None
TEST=None

Change-Id: I6119163ffc4944dd2f857bad055822b37229a692
Reviewed-on: https://chromium-review.googlesource.com/176478
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
/system/update_engine/scripts/update_payload/common.py
382df5ce2f4b67bf0998b01c6fedcdb5c35ebef9 03-May-2013 Gilad Arnold <garnold@chromium.org> paycheck: enforce physical partition size correctly

During payload checking, payload has wrongly interpreted the size
reported in the update payload to be the physical partition size,
whereas this is in fact the size of the filesystem portion only (a
misnomer). This sometimes caused it to emit errors on out-of-bounds
operations, which are otherwise harmless in real-world scenarios.

This CL makes a clear distinction between the two, with the following
semantics:

- The payload's embedded filesystem size must by <= the physical
partition sizes.

- Reading/writing from/to the new partition must be within the physical
partition size boundaries, and not the filesystem ones.

- Reading from the old partition is only allowed from filesystem
boundaries; this is unchanged from current behavior and appears to be
consistent with how we perform delta updates.

- Old/new SHA256 verification during payload application is now limited
to the allotted filesystem portion only (and not the full partition
size). This is consistent with the update engine's semantics.

- Other than that, this change currently has no further effect on
payload application, which remains more permissive wrt to partition
sizes. This also means that the sizes of partitions resulting from
a payload application will not necessarily abide by the predetermined
physical partition sizes. This is in line with the prevailing
division of responsibilities between payload checking (strict) and
application (relaxed).

BUG=chromium:221847
TEST=Payload checking respects partition size override
TEST=Unit tests pass
TEST=Integration tests pass

Change-Id: I0dbc88d538c0cc53b7551f4dfa8f543bcf480cd5
Reviewed-on: https://gerrit.chromium.org/gerrit/50103
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
/system/update_engine/scripts/update_payload/common.py
5502b56f34f9703cf053be46e4ea5685c0c9ac26 08-Mar-2013 Gilad Arnold <garnold@chromium.org> paycheck: unit tests + fixes to checker module

This adds missing unit tests for the checker module, bundled with fixes
to some bugs that surfaced due to unit tests. This includes:

* A fake extent (signified by start_block == UINT64_MAX) that
accompanies a signature data blob bears different requirements than
previously implemented. Specifically, the extent sequence must have
exactly one extent; and the number of blocks is not necessarily one,
rather it is the correct number that corresponds to the actual length
of the signature blob.

* REPLACE/REPLACE_BZ operations must contain data.

* MOVE operation validation must ensure that all of the actual message
extents are being used.

* BSDIFF operation must contain data (the diff).

* Signature pseudo-operation should be a REPLACE.

BUG=chromium-os:34911,chromium-os:33607,chromium-os:7597
TEST=Passes unittests (upcoming); works with actual payloads.

Change-Id: I4d839d1d4da1fbb4a493b208958a139368e2c8ca
Reviewed-on: https://gerrit.chromium.org/gerrit/45429
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
/system/update_engine/scripts/update_payload/common.py
857223b4118d7b4d9bd988d996db00d7ea313029 29-Mar-2013 Chris Sosa <sosa@chromium.org> Modify paycheck to print out hashes in base64.

Both the update engine and sha256_partitions.sh print out hashes in
base64 encoding. Let's stay consistent with ourselves so we can diagnose
hash mismatches correctly.

BUG=None
TEST=Ran it with a delta payload and compared hashes with sha256_partitions.sh
and logs from applying it in the update_engine.

Change-Id: I90c511b936792a073fbe069065ff53c24f47041c
Reviewed-on: https://gerrit.chromium.org/gerrit/46910
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
/system/update_engine/scripts/update_payload/common.py
553b0ec49bc64fc4b7df4358cd31396a87276d2b 26-Jan-2013 Gilad Arnold <garnold@chromium.org> Update payload library + command-line tool

An initial implementation of a Python module for parsing, checking and
applying a Chrome OS update payload. Comes with a command-line tool
(paycheck.py) for applying such operations on payload files, and a test
script (test_paycheck.sh) for ensuring that the library and tool are
working correctly.

Since update_payload is introduced as a package, we're moving some
previously merged utilities into the package's directory.

(Unit testing for this code will be uploaded on a separate CL; see
chromium-os:39663)

BUG=chromium-os:34911,chromium-os:33607,chromium-os:7597
TEST=test_paycheck.sh successful on MP-signed payloads
CQ-DEPEND=I5746a1d80e822a575f0d96f94d0b4e765fc64507

Change-Id: I77123a1fffbb2059c239b7145c6922968fdffb6a
Reviewed-on: https://gerrit.chromium.org/gerrit/43041
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
/system/update_engine/scripts/update_payload/common.py