summaryrefslogtreecommitdiff
path: root/scripts/blockdiff.py
AgeCommit message (Collapse)Author
2019-11-19update_payload: Port scripts to python3Andrew Lassalle
Update the update_payload scripts to be compatible with python2 and python3. Python2 compatibility is needed since the repo is shared with Android. BUG=chromium:1011631 TEST=Executed aosp/system/update_engine/scripts/run_unittests and cros_generate_update_payload Cq-Depend: chromium:1904837, chromium:1911499 Change-Id: Ie450b80b5f7550051b38d320173ccc0c915f65e7 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1904310 Commit-Queue: Andrew Lassalle <andrewlassalle@chromium.org> Tested-by: Andrew Lassalle <andrewlassalle@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Auto-Submit: Andrew Lassalle <andrewlassalle@chromium.org>
2018-01-30update_payload: migrate the license headers to AOSPAmin Hassani
update_engine/scripts/* have CROS license but the rest of UE have android license. This cl just migrates all CROS licenses to AOSP. BUG=None TEST=repo upload did not complain about the mismatched licenses. Change-Id: Id947be3e860baf7a523163965336f47d268c6808 Reviewed-on: https://chromium-review.googlesource.com/891688 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
2018-01-23update_payload: use argparseAmin Hassani
optparse is deprecated (or going to be). Change paycheck.py and blockdiff.py to use argparse instead. Both of these files are being used manually and it would be a good time to fix these before major changes in update_payload. paycheck.sh -h: usage: paycheck.py [-h] [-c] [-D] [-r FILE] [-t {full,delta}] [-z NUM] [-u] [-d] [-k FILE] [-m FILE] [-p NUM] [-P NUM] [-x] [--bspatch-path FILE] [--puffpatch-path FILE] [--dst_kern FILE] [--dst_root FILE] [--src_kern FILE] [--src_root FILE] [-b BLOCK] [-B BLOCK] [-s NUM] PAYLOAD Applies a Chrome OS update PAYLOAD to src_kern and src_root emitting dst_kern and dst_root, respectively. src_kern and src_root are only needed for delta payloads. When no partitions are provided, verifies the payload integrity. positional arguments: PAYLOAD the payload file optional arguments: -h, --help show this help message and exit Checking payload integrity: -c, --check force payload integrity check (e.g. before applying) -D, --describe Print a friendly description of the payload. -r FILE, --report FILE dump payload report (`-' for stdout) -t {full,delta}, --type {full,delta} assert the payload type -z NUM, --block-size NUM assert a non-default (4096) payload block size -u, --allow-unhashed allow unhashed operations -d , --disabled_tests space separated list of tests to disable. allowed options include: dst-pseudo-extents, move-same-src- dst-block, payload-sig -k FILE, --key FILE override standard key used for signature validation -m FILE, --meta-sig FILE verify metadata against its signature -p NUM, --root-part-size NUM override rootfs partition size auto-inference -P NUM, --kern-part-size NUM override kernel partition size auto-inference Applying payload: -x, --extract-bsdiff use temp input/output files with BSDIFF operations (not in-place) --bspatch-path FILE use the specified bspatch binary --puffpatch-path FILE use the specified puffpatch binary --dst_kern FILE destination kernel partition file --dst_root FILE destination root partition file --src_kern FILE source kernel partition file --src_root FILE source root partition file Block tracing: -b BLOCK, --root-block BLOCK trace the origin for a rootfs block -B BLOCK, --kern-block BLOCK trace the origin for a kernel block -s NUM, --skip NUM skip first NUM occurrences of traced block Note: a payload may verify correctly but fail to apply, and vice versa; this is by design and can be thought of as static vs dynamic correctness. A payload that both verifies and applies correctly should be safe for use by the Chrome OS Update Engine. Use --check to verify a payload prior to applying it. BUG=chromium:796338 TEST=unitests TEST=test_paycheck.sh TEST=blockdiff.py Change-Id: I794b5f61e6ba6f92939947c97c432f9fea0b6b3c Reviewed-on: https://chromium-review.googlesource.com/834876 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2018-01-05update_payload: Fix most of lint styling issues.Amin Hassani
This patch fixes a lot of pylint issues in the update_engine scripts. Majority of this changes are based on recommendation found in: https://www.chromium.org/chromium-os/python-style-guidelines It is a good idea to do these changes now, because if there are many pylint errors when performing 'repo upload', serious problems can be overshadowed by a lot of noise and eventually cause problems. These fixes include: - Fixing executable shebangs to /usr/bin/python2. - Fixing import-error problems by disabiling them. - Removing pylint disables that are not valid anymore. - Changing all imports to proper absolute import format. - Change the import of PayloadError from update_payload.PayloadError for simplicity. - Add pydoc strings for functions and classes that were missing. The remaining unchanged pylint problmes include: - The header files of these scripts are in CrOS copyright format, but the the cros lint hook is configured to AoSP copyright format. - The test* functions in unittests are not compatible with CamelCase format. BUG=chromium:796338 TEST=unittests pass TEST=start_devserver TEST=cros flash TEST=scripts/paycheck.py Change-Id: I7eed4d1625eb7c510c7949fada120de5a6a26c7b Reviewed-on: https://chromium-review.googlesource.com/834875 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2017-10-06scripts: import blockdiffMike Frysinger
This was added to dev/host/ for debug helping with paycheck.py, so move it here so it's alongside that script. BUG=None TEST=None Change-Id: I63ae858464cc13344335613093907673052a9859 Reviewed-on: https://chromium-review.googlesource.com/704200 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>