summaryrefslogtreecommitdiff
path: root/scripts/update_payload
AgeCommit message (Collapse)Author
2021-03-11Improve load speed for python payload scriptKelvin Zhang
When using update_payload module to read a full OTA, it will attempt to load the entire payload into memory first, which is slow. Use mmap instead, as parsing manifest doesn't require the entire payload to be in memory, only the first couple of MB. In case of opening a zipfile, use zfp.open(), which returns a streaming interface. Test: import update_payload, load an OTA Change-Id: I3f7c7515dbf5576ccfda8d844fe22e9be34fdaed
2021-02-22Add vabc_compression parameter to update_metadataKelvin Zhang
Test: treehugger Change-Id: Icc65db9a7c4fbdf22376f9900016ae1b7058c611
2021-02-11Reland: Pass apex_info.pb file to delta_generatorKelvin Zhang
target_files contain META/apex_info.pb, which contains metadata about compressed apexes. Extract this file from target_file.zip, and pass it to delta_generator. delta_generator will then copy these data to update_metadata Test: generate an OTA, make sure a device running an older build can install the OTA Bug: 172911822 Change-Id: If0e185a32262a849d533c3316ffdf205cb6628b6
2021-02-04Reland: Add ApexInfo field to update_metadata.protoMohammad Samiul Islam
ApexInfo defination has been duplicated from ota_metadata.proto Bug: 172911822 Test: m Test: atest update_engine_unittests:PayloadPropertiesTest Change-Id: I25b11fdeff4a9ad927f5bcb866660f4b66e563fe
2021-01-30Revert "Add ApexInfo field to update_metadata.proto"Tianjie Xu
This reverts commit 8e2dce0ccc2699a0df9d8473fa586811f4b1b69c. Reason for revert: b/178908708 Change-Id: I76f09bdb467b4f9f13fe7a0ae28c55e08fea197a
2021-01-30Revert "Pass apex_info.pb file to delta_generator"Tianjie Xu
This reverts commit 4e5da3e9d7459e3d983db943ebf3cb4c36af9c60. Reason for revert: b/178908708 Change-Id: I616da64ffda5b94044f3493861d6d01aebfaad61
2021-01-30Revert "Regenerate checked-in update_metadata_pb2.py with aprotoc"Tianjie Xu
This reverts commit f650fa41940c0792b72f5c7299d952537bf6f3db. Reason for revert: b/178908708 Change-Id: I7ff38e1b6e776862777c42259ecbe84000cfdbb0
2021-01-29Regenerate checked-in update_metadata_pb2.py with aprotocYifan Hong
Fixes this error: AttributeError: 'module' object has no attribute '_internal_create_key' Test: run it Change-Id: I2621090c87e614bbc5ba6c9be22e60d7ed066173
2021-01-28Pass apex_info.pb file to delta_generatorKelvin Zhang
target_files contain META/apex_info.pb, which contains metadata about compressed apexes. Extract this file from target_file.zip, and pass it to delta_generator. delta_generator will then copy these data to update_metadata Test: generate an OTA Bug: 172911822 Change-Id: Ia4babb9e711a92f2b78ef8e1dd6ad35d0a2bb5a8
2021-01-27Add ApexInfo field to update_metadata.protoMohammad Samiul Islam
ApexInfo defination has been duplicated from ota_metadata.proto Bug: 172911822 Test: m Test: atest update_engine_unittests:PayloadPropertiesTest Change-Id: Ife95e27977be1e32999d9777b226e0eeb644f3fc
2021-01-20Add a "vabc_enabled" flag to update_metadataKelvin Zhang
When doing a downgrade build, the target build might not support vabc. So disable vabc in this case. Test: treehugger Change-Id: Ie5a56adf99b495a40d1caafbda6466181da1bc10
2020-12-14Add host side simulation python scriptKelvin Zhang
This enables host side simulation of partial updates with the original complete target file Bug: 171519321 Test: run this script with a partial update python3 simulate_ota.py --source ~/aosp/aosp_cf_x86_phone-target_files-6949164.zip --target ~/aosp/aosp_cf_x86_phone-target_files-6937553.zip ~/aosp/cf_x86_downgrade.zip Change-Id: Iec52d8ac585b499d50bdb0c89d203ea353f2e94f
2020-10-29Merge remote-tracking branch 'remotes/aosp/upstream-master' into merge-crosAmin Hassani
Merge back the recent update_engine changes back to Android. Created by: $ git merge remotes/aosp/upstream-master --commit -s recursive No special conflict to resolve. Bug: 163153182 Test: None Change-Id: I4c65eb9c57448847857e2339935a5d47c8cb690a
2020-10-12Add estimate_cow_size field to update metadataKelvin Zhang
Part of VAB project. When installing update through Virtual AB it is nice to have an estimate of COW image size. When generating an OTA update, delta_generator will fill in this field. Later on libsnapshot will use this as an hint when creating snapshots. Test: mm -j Change-Id: I56aa9dfa5e9d955f971a6464aea433b569cd9307
2020-09-29update_payload: Add support for minor version 7Amin Hassani
Although, we have not upreved to minor version 7, some of the current canary images have been moved to minor version 7. So temporarily add support for minor version 7. BUG=b:169526824 TEST=sudo FEATURES=test emerge update_payload TEST=cros_generate_update_payload --debug --tgt-image chromiumos_test_image.bin --src-image chromiumos_test_image.bin --output delta.bin --check --work-dir workdir Change-Id: Ifb32307ecee7814190028f5ee7033f67fc5c40db Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2437004 Reviewed-by: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org>
2020-09-28update_payload: Remove signature version checkingAmin Hassani
aosp/1130669 deprecated the 'version' field from the Signatures message. But the update_payload code wasn't updated, so this CL removes that check. BUG=b:169526824 TEST=cros_generate_update_payload --debug --tgt-image dlc.img --src-image dlc.img --output delta.bin --private-key ~/.ssh/testing_rsa --check Change-Id: I20aca13eeb33c5c1d2aa72513649198868ab00be Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2434552 Tested-by: Amin Hassani <ahassani@chromium.org> Auto-Submit: Amin Hassani <ahassani@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
2020-09-26Merge "update_engine: Merge remote-tracking branch 'cros/upstream' into ↵Commit Bot
cros/master"
2020-09-24payload_generator: Remove unused attributesVyshu
Some attributes are not used by the client. Removed all instances of of "ignored" and option ttributes from delta generation. Removed all instances of ImageInfo and moved target and source version to paygen_payload. BUG=b:163048638 TEST=FEATURES=test emerge-hatch update_engine TEST=FEATURES=test emerge update_payload TEST=./run_pytest lib/paygen/paygen_payload_lib_unittest.py Change-Id: I9102d37fcf054f2cbeb79e54113925a684de1cfb Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2388163 Reviewed-by: Amin Hassani <ahassani@chromium.org> Tested-by: Vyshu Khota <vyshu@google.com> Commit-Queue: Vyshu Khota <vyshu@google.com>
2020-08-25Support per-partition timestampsKelvin Zhang
update_engine is heading toward supporting partial updates, which an OTA update can update just a subset of all partitions. In this context, a single max_timestamp in OTA manifest is insufficient for checking potential downgrades, as different partitions can have different timestamps. This CL adds per-partition timestamp support on update_engine side. update_engine will accept a payload with per-partition timestamps and reject the update if any partition has an older timestamp. Changes made: 1. Add new version field to PartitionUpdate protobuf message. 2. Add new methods to HardwareInterface for fetching/checking timestamp of each partition. 3. Update delta_performer to invoke new APIs in 2 properly. 4. Add relevant testcases. Test: unittest Bug: 162553432 Change-Id: I767343e003fd35ce0d22197b15040488cf30be30
2020-08-19Update payload.py to work with OTA packages directlyKelvin Zhang
Test: python3 payload_info.py some_ota.zip Change-Id: Id688e87d4712f2f750320eb0cd86c6a2cc263313
2020-07-06Merge remote-tracking branch 'aosp/upstream-master' into mergeTianjie
It's a merge from chrome OS with some reverts. 1. the fd watcher change, because the libbrillo version isn't compatible in aosp. commit 6955bcc4ffe4cc9d62a88186b9a7e75d095a7897 commit 493fecb3f48c8478fd3ef244d631d857730dd14d 2. two libcurl unittest. Because the RunOnce() of the fake message loop seems to have different behavior in aosp. commit d3d84218cafbc1a95e7d6bbb775b495d1bebf4d2 Put preprocessor guards to use the old code in aosp. And we can switch to the new code in the other path after adopting the new libbrillo & libchrome. Test: unit tests pass, apply an OTA Change-Id: Id613599834b0f44f92841dbeae6303601db5490d
2019-11-27update_payload: Adapt subprocess.check_call to py3Andrew
In python3, file descriptors(fd) are not passed to child processes, so the call to 'puffin' fails because puffin cannot receive the file descriptors passed by applier.py. In python3, there is an option to set a fd inheritable so the subprocess can access the fd. BUG=chromium:1027199 TEST=cros_generate_update_payload --src_image ~/trunk/src/build/images/eve/R80-12705.0.2019_11_23_1521-a1/dlc/dummy-dlc/dummy-package/dlc.img --image ~/trunk/src/build/images/eve/R80-12713.0.2019_11_26_0806-a1/dlc/dummy-dlc/dummy-package/dlc.img --output ~/delete/ttt3 --check TEST=cros_generate_update_payload --src_image ~/trunk/src/build/images/eve/R80-12697.0.2019_11_21_1601-a1/chromiumos_test_image.bin --image ~/trunk/src/build/images/eve/R80-12713.0.2019_11_26_0806-a1/chromiumos_image.bin --check --output ~/delete/ttt5 Change-Id: I5d68d5a7ce0a128f2438b0d9f2e32167463661c2 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1938007 Tested-by: Andrew Lassalle <andrewlassalle@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org>
2019-11-26update_payload: Remove 'buffer' in applier.pyAndrew
'memoryview' replaces 'buffer' in python3, but not all the signatures are the same in both functions. The output of memoryview has to be converted to bytes, but buffer's doesn't. This difference could cause the script to fail when using python2. Set the type of multiple strings to byte. BUG=chromium:1027199 TEST=cros_generate_update_payload --image ~/trunk/src/build/images/eve/R80-12705.0.2019_11_23_1521-a1/chromiumos_image.bin --src_image ~/trunk/src/build/images/eve/R80-12705.0.2019_11_23_1521-a1/chromiumos_image.bin --output ~/delete/ttt2 --check TEST=cros_workon_make update_payload --test TEST=tryjob. Note: tryjob fails because tryjob runs without the updates to the sdk from this CL. see chromium:1028178 Change-Id: Ic05892d1e26f12e33a661b590039821329379042 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1933128 Tested-by: Andrew Lassalle <andrewlassalle@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Auto-Submit: Andrew Lassalle <andrewlassalle@chromium.org>
2019-11-25update_payload: Fix array type in applier.pyAndrew
In python3, the array type 'c' is no longer supported. Type 'c' arrays are replaced by type 'b'(signed char) and 'B'(unsigned char). 'B' is supported by python 2 and python3. Replaced deprecate function 'buffer' by memoryview in python3. BUG=chromium:1027199 TEST=unittest, cros_generate_update_payload, tryjob Change-Id: Id77ba2d1aac0005d31516da4e6ac4617027ca345 Exempt-From-Owner-Approval: -release builders are on fire Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1932226 Tested-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
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>
2019-10-29update_engine: Deprecate major version 1Amin Hassani
We have moved away from major version 1 in Chrome OS and already have a stepping stone for it in M53. So this cleanup makes the code much easier to understand. BUG=chromium:1008553 TEST=FEATURES="test" sudo emerge update_engine update_payload TEST=cros_generate_update_payload --image chromiumos_test_image.bin --check --output delta.bin Change-Id: I01815dfa5fdf395f8214ef162e01ecca2d42f7fc Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1857459 Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org> Commit-Queue: Amin Hassani <ahassani@chromium.org>
2019-10-08Update update_metadata_pb2.pyYifan Hong
Generated with: aprotoc --python_out scripts/update_payload update_metadata.proto Test: cd system/update_engine/scripts && ./run_unittests Change-Id: I68b0659e5de7545fb0143a930859c703ec50ae13
2019-10-03update_engine: Deprecate minor version 1Amin Hassani
Minor version 1 was for the old days where we rewrite the signle partition with an update (no A/B partitions). But those days are long over and we don't think there is any device out that has this capability anymore. Even if there is, we can always serve full payloads along with the stepping stone we have in M53. So this is safe to go. BUG=chromium:1008553 TEST=sudo FEATURES=test emerge update_engine TEST=ran cros flash two times. Change-Id: Ib928ade36af5136cd4013a30dfb39ee7fd5b07b1 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1829160 Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org> Commit-Queue: Amin Hassani <ahassani@chromium.org>
2019-03-20update_payload: deprecate unused flags from paycheck.pyXiaochu Liu
Some temporary workaround are placed to hack the parameters to some default value that the rest of the code is happy with. This CL removes them. part_sizes should be default None (it was default [None, None]). when part_sizes is None, part sizes are not checked (same behavior as [None, None]). src_part_paths should be default None (it was default [None, None]). when src_part_paths is None, we set args.assert_type=_TYPE_FULL (same behavior as [None, None]). dst_part_paths (out_dst_part_paths) should be default None (it was default [None, None]). when dst_part_paths (and out_dst_part_paths) is None, dargs is not set (same behavior as [None, None]). out_dst_part_paths is rarely used and we often chose to use dst_part_path. Old flags (deprecated) are removed as well. BUG=chromium:926045 TEST=test_paycheck.sh chromeos_11844.0.0_kevin-arcnext_canary-channel_full_kevin-mp.bin-6f7f58b3c9a1a84ea15ab67f84cd5387.signed chromeos_11844.0.0-11869.0.0_kevin-arcnext_canary-channel_delta_kevin-mp.bin-fc6014025415e0b5e780c0739a3b0461.signed chromeos_11869.0.0_kevin-arcnext_canary-channel_full_kevin-mp.bin-1be744e0723534e02084c762dea316c0.signed Change-Id: Ifdf872ddfa03d5759a8ee4021e296e4dc4571d9c Reviewed-on: https://chromium-review.googlesource.com/1525289 Commit-Ready: Xiaochu Liu <xiaochu@chromium.org> Tested-by: Xiaochu Liu <xiaochu@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org>
2019-01-10update_payload: uprev to minor version 6Amin Hassani
BUG=chromium:920699 TEST=unittest TEST=check_update_payload --check # with a delta payload Change-Id: I40bc1e535ed241b74c6d889757a8dcf046bac0de
2019-01-04Merge aosp/upstream-master into aosp/master.Sen Jiang
Added BinderUpdateEngineClient::AttemptInstall(). Test: update_engine_unittests Change-Id: Id6911f49d763b0d572658acb7d66857016bf6969
2018-12-15update_payload: Fix problem with signature size on unsigned payloadsAmin Hassani
If the payload is unsigned (e.g. for test image), then the checker.sigs_file would not exist. So check for that variable before using it. BUG=chromium:794404 BUG=chromium:914705 TEST=manually signing the payload ran update_payload_check with signed and unsigned image TEST=unittests Change-Id: I871137eadef00d012ee926d12fd4eee36a454487 Reviewed-on: https://chromium-review.googlesource.com/1375023 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2018-12-10update_payload: Add the remaining major version 2 signature supportsAmin Hassani
This patch fixes the issues with signatures (sizes) in major version 2 and a few minor issues with the payload and metadata sizes. BUG=chromium:862679 TEST=manually signing the payload and running update_payload_check TEST=unittests Change-Id: I9b431379b0574a150474a913f1ec4a11e86288ae Reviewed-on: https://chromium-review.googlesource.com/1363339 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2018-11-15Update update_metadata_pb2.pySen Jiang
Generated with: protoc --python_out scripts/update_payload update_metadata.proto Bug: 119222724 Test: None Change-Id: I384f370358a3e97e038b2350416f422d47fe999a
2018-07-11update_payload: Make paycheck take "root" instead of "rootfs"Tudor Brindus
This commit makes paycheck take "root" as the rootfs partition label instead of "rootfs", which makes it consistent with other tooling like delta_generator. BUG=chromium:794404 TEST=test_paycheck.sh and run_unittests Change-Id: I20835e93adbcde459bc86d832e695b38bca55e38 Reviewed-on: https://chromium-review.googlesource.com/1132843 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
2018-06-26update_payload: Implement applying for major version 2 payloadsTudor Brindus
This commit adds payload major version 2 support to paycheck.py applying. BUG=b:794404 TEST=no errors during run_unittests and paycheck.py <major version 2 payload> --part_names boot system --out_dst_part_paths /tmp/boot_part /tmp/system_part (./test_paycheck.sh does not pass for major version 2 payloads since it currently does not detect version 2 payloads, and specifies rootfs/kernel as the partitions to paycheck.py instead of system/boot; no regressions when running on major version 1 payloads) Change-Id: Ic411607cee6f032851d1fa9545bed68fe2d3da77 Reviewed-on: https://chromium-review.googlesource.com/1106656 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
2018-06-26update_payload: Implement checking for major version 2 payloadsTudor Brindus
This commit adds payload major version 2 support to paycheck.py --check. For consistency, report messages for affected fields are kept the same across both major version 1 and 2 checks, even if the particular field name does not exist in one version. BUG=b:794404 TEST=no errors during run_unittests and paycheck.py --check <major version 2 payload> (./test_paycheck.sh does not pass for major version 2 payloads since applying is not implemented yet; no regressions when running on major version 1 payloads) Change-Id: I3c5d0cbca3336c8136326ca52b19f659c7c741c9 Reviewed-on: https://chromium-review.googlesource.com/1105610 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
2018-06-25update_payload: Allow specifying partition options for major version 2Tudor Brindus
This commit adds the ability to specify partition options for more than just kernel/rootfs. This supersedes -p/--root-part-size, -P/--kern-part-size, --dst_kern, --dst_root, --src_kern, --src_root, --out_dst_kern, and --out_dst_root. They are replaced by --part_names used in conjunction with --part_sizes, --dst_part_paths, --src_part_paths, and --out_dst_part_paths. Backwards-compatibility with the old flags is kept, so long as they are not used alongside the new flags. BUG=b:794404 TEST=no errors during run_unittests and test_paycheck.sh Change-Id: Icc1118abbf89dd268be3eafe41723657c5178197 Reviewed-on: https://chromium-review.googlesource.com/1103063 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
2018-06-21update_payload: De-duplicate paycheck partition handling for major version 2Tudor Brindus
This commit makes handling of major version 2 rootfs/kernel partitions more generic, with the goal of reusing the same code paths for major version 2 (which has an arbitrary number of partitions per payload). BUG=b:794404 TEST=no errors during run_unittests and test_paycheck.sh Change-Id: Ic6e8cdaae557c10dfbd302dba0e52ff8b2870c9f Reviewed-on: https://chromium-review.googlesource.com/1101500 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
2018-06-04Merge remote-tracking branch 'cros/upstream' into cros/masterAmin Hassani
BUG=chromium:815356 TEST=unittest TEST=precq TEST=cros flash Change-Id: I8d9c37411708d0cae61613b285123a090ce6deb1
2018-04-04Correct some spellings.Sen Jiang
Test: mma Change-Id: Icc49a4ee76f12d302ed18982d334f2f70b7263a8
2018-03-23update_payload: Allow check for given metadata sizeAmin Hassani
Allow passing metadata size to check_update_payload so we can verify the metadata size in omaha equals to the one in the payload. BUG=chromium:820243 TEST=run paycheck.py with both valid and invalid metadata sizes reports as expected TEST=unittests Change-Id: Ib41ce77af77636fffec6752201c363e7fbbf868d Reviewed-on: https://chromium-review.googlesource.com/955679 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
2018-03-09Merge remote-tracking branch 'aosp/upstream-master'.Sen Jiang
Bug: 30989362 Test: update_engine_unittests Change-Id: I04417ac21508f4da3ead29b1dea34886f2fc84af Merged-In: I04417ac21508f4da3ead29b1dea34886f2fc84af
2018-02-08update_engine: Disable puffin in minor version 4Amin Hassani
This patch disables puffin for minor version 4, but keeps BROTLI_BSDIFF in the same minor version. Also adds puffin for minor version 5, but it does not enable it. BUG=b:72815313 BUG=chromium:810184 TEST=update_engine unittests pass TEST=update_payload unittests pass TEST=test_paycheck.sh on two images with minor version 4 pass TEST=brill_update_payload generate/verify pass Change-Id: I814fc126d67207501d419cff9c575cd13d877b48 Reviewed-on: https://chromium-review.googlesource.com/907223 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Amin Hassani <ahassani@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-29update_payload: remove block tracerAmin Hassani
block tracing was useful for minor version 1 with move operations (before having A/B updates). But, we do not create that operation anymore and we are in the process of moving to major version 2. So this needs to go BUG=chromium:794404 TEST=unit tests Change-Id: I56d24ef81e8f37c481669d47e5878eb3a321131f Reviewed-on: https://chromium-review.googlesource.com/888546 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
2018-01-23Relanding 'update_payload: Add XZ compression support'Amin Hassani
This patch adds support for checking a payload that has REPLACE_XZ operations. REPLACE_XZ was added in minor version 3. BUG=chromium:758792 TEST=unittests pass; paycheck.py with a xz generated payload pass; CQ-DEPEND=CL:823234 Change-Id: I6ec8068e233f2d595fda93a985923d85c59f150e Reviewed-on: https://chromium-review.googlesource.com/872124 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2018-01-11Merge remote-tracking branch 'goog/upstream-master'.Sen Jiang
The following commits were reverted: 840703a Fix update over cellular network on guest account eaad5d0 Do not merge to AOSP: Fixes the link to brillo-clang-format in CrOS 740efad Reboot even if a system update is not available. Fixed a few sign compare warnings. Had to ifdef out 2 SquashfsFilesystemTest because it depends on unsquashfs -m. Test: update_engine_unittests Change-Id: I6f4ca5003e78c76064ec60d0797505d8c18d00bf Merged-In: I6f4ca5003e78c76064ec60d0797505d8c18d00bf
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>
2018-01-04Fix pylint issue in payload.pySen Jiang
************* Module update_payload.payload W: 12, 0: Relative import 'applier', should be 'update_payload.applier' (relative-import) W: 13, 0: Relative import 'block_tracer', should be 'update_payload.block_tracer' (relative-import) W: 14, 0: Relative import 'checker', should be 'update_payload.checker' (relative-import) W: 15, 0: Relative import 'common', should be 'update_payload.common' (relative-import) W: 16, 0: Relative import 'error', should be 'update_payload.error' (relative-import) W: 17, 0: Relative import 'update_metadata_pb2', should be 'update_payload.update_metadata_pb2' (relative-import) C:222, 4: Missing function docstring (missing-docstring) E:261,33: Instance of 'DeltaArchiveManifest' has no 'partitions' member (no-member) Test: repo upload Change-Id: Ib3e99c6a3a5ea4575b442e672a871adc7b985289 (cherry picked from commit c2527f492e7a1389b2a3f248bd2b22d6cf5d9eb8) Reviewed-on: https://chromium-review.googlesource.com/834874 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>