summaryrefslogtreecommitdiff
path: root/scripts/update_device.py
Commit message (Collapse)AuthorAgeFilesLines
* Improve payload magic header handlingKelvin Zhang2021-07-031-4/+31
| | | | | | | | | | | | | | | Currently, we use central directory's extra fields and filenames to determine starting position of a zipentry's file data. However, central directory's extra field might differ from extra field in local file header. For example, the Extended-Timestamp field has different formats depending on whether it's in local file header or central directory. We should use local file header for computing offsets. CRs-Fixed: 2804037 Test: Serve an OTA by update_device.py Change-Id: I00d150d874b9c874bb713569ea14938e036f854e (cherry picked from commit aba70abe81618542044dc20907f281a56b8b500e)
* Allow update_device install the secondary payloadTianjie Xu2019-11-021-8/+17
| | | | | | | | | | Add an option to support installation of the secondary payload. This is used to verify an android factory OTA, where it has one step to install the secondary payload. The payload and its property file store under the secondary/ directory of the update package. Test: install a secondary payload from a factory OTA package Change-Id: I1d2e1d6945f1daa9afaab6af8ce9aad0f7c2100f
* A/B update: Replace the zip FileHeader mechanism for update packageShashikant Baviskar2018-08-211-1/+3
| | | | | | | | | | | | | | | When the update package gets larger than 2 GiB, payload.bin offset mentioned in metadata file for ota-streaming-property-files gets shifted (CrAU of payload.bin) because ZipInfo FileHeader() returns incorrect value. To solve the issue, offset is re-calculated from fixed bytes of central directory file header, filename length and extra length. Test: manually create an A/B update package and run it using update_device.py Bug: 111198589 Change-Id: Iadb2e8bbff478d9b006bb155d57fea35968d84b7
* update_device.py: support passing extra headers.Sen Jiang2017-10-311-4/+6
| | | | | Test: update_device.py --extra-headers 'SWITCH_SLOT_ON_REBOOT=0' ... Change-Id: I5902153329243e6dc55d767d87bc974f206d32e0
* update_device.py: Handle the package push without 'adb root'.Tao Bao2017-10-251-1/+6
| | | | | | | | | | | | When using '--file' (and without '--no-push'), it tries to push the package to /data/ota_package/debug.zip. However, that's not allowed directly with 'adb push', unless by restarting adb with 'adb root'. This CL works around the issue by pushing the file to /data/local/tmp first, then moving it over to the desired place. Test: update_device.py --file <marlin-ota.zip> Change-Id: I608284cc90918fc01cf7584569d4d7d4165148ca
* Defaults update_device to use only compatible python versionsmarkdr2017-10-211-1/+1
| | | | | | | | | update_device imports BaseHTTPServer, which is python2 only. If python3 is the default python, an import error will be thrown. Test: Set default python to 3.4. Call update_device.py Change-Id: Id053e695c334c597736b9844e11be389264700ea
* update_device.py: support OTA zip if use omaha too.Sen Jiang2017-09-301-19/+39
| | | | | | | | Pass the offset and size to UpdateHandler. Also added support for payload offset in update_payload.Payload. Test: applied a local OTA Change-Id: Ib116ef2c23a11e298118f203814c4ea8dd1629af
* update_device.py: use the appid from request.Sen Jiang2017-09-301-7/+22
| | | | | | | | Recent changes in update_engine are now comparing the appid against the product id. Test: applied a local OTA Change-Id: I2907e94a89bea5ebfa8236c96eec7601af8ad4e5
* Add support for omaha in update_device.pySen Jiang2017-08-161-5/+106
| | | | | | | | | | | | | Automatically detect if the device is running an update_engine with USE_OMAHA or not, and use different command based on that. Made the http server serving payload a fake omaha server as well. Added support for overriding the payload public key on the device. Bug: 27316596 Test: update a device that uses omaha Change-Id: I230d58ff105189dc8a624d46ee79cbe90c5f09b0
* Fix pylint warnings in update_device.pySen Jiang2017-08-161-5/+5
| | | | | | | | | | | | | We weren't actually using our own pylintrc file in repo upload hook, which will be fixed by https://android-review.googlesource.com/#/c/platform/tools/repohooks/+/458996/ Even though both camel case and snake case are allowed for function and method names, they still have to be consistent in a single file. https://pylint.readthedocs.io/en/latest/user_guide/options.html#multiple-naming-styles Bug: 27316596 Test: repo upload Change-Id: I98adba957a547115ef3d8b00fe2e3e4931707b31
* scripts: New script to update a device connected via adbAlex Deymo2017-03-211-0/+301
This new script allows to execute the update flow on an Android device connected via adb to the host. At the moment, it supports both providing the payload over the network with an "adb reverse" connection and to push the payload to a file on the device. Bug: 35903885 Test: system/update_engine/scripts/update_device.py ota.zip Change-Id: I1c6d4df97ce85b6e30367a53b351353a954efbdc