summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* CheckSuperPartitionAllocatableSpace: based on device propHEADr11.1Yifan Hong2021-07-062-22/+93
| | | | | | | | | | | | | | | | | | | | | | | | | Check allocatable space in super based on whether VAB is enabled on the device, instead of basing on whether snapshot is used for this update. On VAB devices where snapshot is not used, e.g. secondary update, we don't want to divide allocatable space by half. The logic changes from: if (!retrofit DAP && ! update uses snapshot && !sideload) allocatable_space /= 2 to if (!retrofit DAP && ! VAB enabled) allocatable_space /= 2 All other changes are cosmetic. Test: pass Bug: 185552745 Change-Id: If182da4fdbc4b39160347205ccfa50642afc5511
* Check the super partiton size in VAB caseTianjie2021-07-063-30/+68
| | | | | | | | | | When the snapshot is used, we should check that the maximum size of all dynamic partition groups doesn't exceed the super partition size. Bug: 182431975 Test: primary payload fails as expected Pixel21 Change-Id: I5df8976e6b7e011284b29fd554dda80e31305698
* Check allocatable space correctly when sideloading on VABYifan Hong2021-07-064-7/+130
| | | | | | | | | | | | | | | | On a device with Virtual A/B, when sideloading and there's not enough space in super partition to hold CoW, update_engine falls back to overwriting all source partitions. In that case, the allocatable space should be the whole super partition, not a half of it. Also update doc comments. Test: unit test. RecoveryErrorShouldDeleteSource fails without the patch but succeeds with the patch. Bug: 163613538 Change-Id: I6bd6895a7eabeb4e8436e57b0ac6830c11d1e98f
* Merge "Improve payload magic header handling" into r11.1Semavi Ulusoy2021-07-052-5/+44
|\
| * Improve payload magic header handlingKelvin Zhang2021-07-032-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | Merge "Check allocatable space correctly when sideloading on VAB" into r11.1Semavi Ulusoy2021-07-051-1/+6
|\|
| * Check allocatable space correctly when sideloading on VABEric Arseneau2021-07-031-1/+6
| | | | | | | | | | | | | | | | | | Picked single logical fix for this error. See bug for details. Test: pre-submit Bug: 169781891 Change-Id: I4facf2cd157143846c873e2b458d37356692d68c
* | Revert "update_engine: Run backuptool only in debuggable builds"Pranav Vashi2021-06-302-9/+0
|/ | | | | | This reverts commit 5374eaa2b1824e0c7e6f2628c34baa438626127f. Change-Id: I36dd04f86612682344b08ff8674d3f1c8442661d
* [SQUASH] Merge tag 'android-11.0.0_r38' into r11.1Kevin F. Haggerty2021-06-101-0/+1
| | | | | | | | | | | Android 11.0.0 Release 38 (RQ3A.210605.005) * tag 'android-11.0.0_r38': Fix a potential wild pointer error when markSlotSuccessful comes late https://github.com/haggertk/android_system_update_engine/tree/lineage-18.1_merge-android-11.0.0_r38 Change-Id: I097ff97959d7e931202df6ed4da9cf64df5e354e
* Merge tag 'android-11.0.0_r32' into r11.1Ali B2021-03-021-20/+17
|\ | | | | | | | | | | Android 11.0.0 Release 32 (RQ2A.210305.006) Change-Id: I45f91ed8ffefbe0adec5bc01f52278cbd08ffb4a
| * Snap for 7041858 from 1205ea684e81a6f14db7d5556f3eda2fd014b8d8 to ↵android-build-team Robot2020-12-191-20/+17
| |\ | | | | | | | | | | | | | | | rvc-qpr2-release Change-Id: I86cab4f88ef1b4cc2c97370fbaa5ddc2a371df16
| | * Validate payload data for each operationTianjie2020-07-101-20/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For streaming update, we currently verify: 1. the hash of manifest before applying ops 2. the hash of the entire payload after we apply all ops 3. the final patched on filesystems after the update So there is some potential to exploit the patching libraries, if some attacker manage to provide us malicious patch data after the manifest verification. Therefore, this cl enables the validation of patch data for each install operation. The hash itself is embedded in the payload manifest; and thus has been verified upfront. Bug: 160800689 Test: unittests, apply an OTA Change-Id: Idd4cbe167ce63f197d821752f75e45add0ea829c (cherry picked from commit ef49160c9bd2621dd3084fa061f09d176304ca49)
* | Move performance mode to top appLuca Stefani2021-02-101-1/+0
| | | | | | | | Change-Id: I436102b4f8d046b8f3d897882613ec46acf9e2c5
* | Improve ASCII look while flashingNathan Chancellor2021-02-101-5/+23
| | | | | | | | | | | | | | | | | | | | | | 1. Add the spacing that should have been there by using a space. 2. Add some separation between the D and the U, looks better I think. * Adding support for Pixels to use DU ASCII in update_engine AICP'fied Change-Id: I93c33265c319af2e5ae76e4d3c80a12c61cfaab8
* | Ignore timestamp check in DeltaPerformerSurge Raval2021-02-101-0/+2
| | | | | | | | Change-Id: I744addf6a87025515040cdad203c235c4a678de9
* | Report more info in sideload UISurge Raval2021-02-101-12/+9
| | | | | | | | Change-Id: I87f80b53cb2a295e1a18ebdb7b8db682f39ceb11
* | Add sideload UI and split reporting into thirdsSurge Raval2021-02-101-3/+18
| | | | | | | | Change-Id: I671c3d0bdce5c99c577af0fe1891415ab8aea729
* | update_engine: Boost update_attempter thread priorityHarsh Shandilya2021-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | Rather than switch between foreground and background prio with performance mode, switch to always being a foreground task and using top-app in performance mode. This brings significant speed gains to the update process without any noticeable hit on battery consumption. Change-Id: I813acd12243e415546257e4abe7c1662d6aebfdc
* | update_engine: Always disable signature and downgrade checksjhenrique092021-02-042-4/+5
| | | | | | | | Change-Id: Ibd9ca7d69f3824d5302c7c76c0baf4b9d41fced6
* | Don't verify payload signatures in recoveryAlessandro Astone2020-12-201-1/+6
| | | | | | | | Change-Id: I0ce626ef993c2a7c87e03f705ef2e866a3391db1
* | update_engine: Run backuptool only in debuggable buildsLuca Stefani2020-12-122-0/+9
| | | | | | | | Change-Id: If4da655396546ac3c13b9eb556055caa58bafcf0
* | update_engine: Transition to backuptool domainLuca Stefani2020-12-122-0/+14
| | | | | | | | | | | | | | * This way we can make backuptool permissive while leaving update_engine rules as clean as possible Change-Id: Ied17f31f7d0258319371f3badc891c7a6ecee901
* | update_engine: Run backuptool script before normal postinstall scriptDan Pasanen2020-12-121-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Check if the currently running /system has ever been mounted R/W. If it has, we can assume that running backuptool_ab scripts won't do anything catastrophic like break verity. Also this is a good indicator that the partition has been messed with since the initial installation of the rom (for instance if a gapps or su package had been added). * Mount the new target slot's /system partition at /postinstall R/W, before the normal dex preopt script is run, and perform backuptool_ab operations. This will allow retaining addon packages, similar to what we've historically used in recovery flashes for non-A/B devices. This, since it mounts the new /system R/W, will also ensure it gets triggered again on the next flash. * This assume that all backuptool operations are contained in /system and that we won't ever screw around with retaining things on /vendor. Change-Id: I00ca479ccc24080bf3457334a6c9e4c07dd20f45
* | update_engine: Add performance modeGabriele M2020-12-129-1/+37
|/ | | | | | | | | | | | | | | | | | | | | | Author: Gabriele M <moto.falcon.git@gmail.com> Date: Thu Jun 14 01:10:09 2018 +0200 update_engine: Add performance mode Allow to move update_engine from the system-background cgroup to the foreground cgroup to speed up the installation of the updates. Change-Id: Iaa531a925f9e1a26e834d7448c4755151adcfea2 Author: Luca Stefani <luca.stefani.ge1@gmail.com> Date: Mon Mar 4 14:57:28 2019 +0100 Move performance mode to top app Change-Id: I436102b4f8d046b8f3d897882613ec46acf9e2c5 Change-Id: Id7e27b0c42d80c4a3ce1dc7f8540313a7042db53
* Fix update_engine libchrome log tag. am: c3fd86a8be am: 84875e0c9bYifan Hong2020-06-171-2/+2
|\ | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/system/update_engine/+/11893835 Change-Id: I9b44e466169d9c2a6af284cf5d6149214ef8bd2a
| * Fix update_engine libchrome log tag. am: c3fd86a8beYifan Hong2020-06-171-2/+2
| |\ | | | | | | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/system/update_engine/+/11893835 Change-Id: I27728223fbe278ebda071603cef6ba272c0cfe28
| | * Fix update_engine libchrome log tag.Yifan Hong2020-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Test: boot and inspect logcat Fixes: 158030597 Bug: 158817816 Change-Id: I931af4faf6219ce42ff94080ea834721726dc0ba (cherry picked from commit 550ade4e44a72708354597307122a3f46e43a7d6)
* | | Check for system_other existence in recovery mode as well. am: ddf27738af ↵P.Adarsh Reddy2020-06-101-11/+8
|\| | | | | | | | | | | | | | | | | | | | | | | am: 8ca09e94c4 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/update_engine/+/11796618 Change-Id: I9be53bbff95af23b75aa73f90dca8d052ec149ab
| * | Check for system_other existence in recovery mode as well. am: ddf27738afP.Adarsh Reddy2020-06-101-11/+8
| |\| | | | | | | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/system/update_engine/+/11796618 Change-Id: Ia82f42a31f047525ba49b055c4a18b1756bc60ed
| | * Check for system_other existence in recovery mode as well.P.Adarsh Reddy2020-06-081-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the recovery mode conditional, to ensure we check for the existence of system_other in recovery mode as well, before going ahead with performing avb related operations on system_other. Bug: 155053192 Test: adb sideload of OTA zip in recovery mode now passes on a device which doesn't have system_other enabled. Change-Id: I1884755aad2a8d37f540dbee73c7c7baab2759e7 Merged-In: I1884755aad2a8d37f540dbee73c7c7baab2759e7
* | | Report super partition size, slot size and free space am: e2ad4d3beb am: ↵Alessio Balsini2020-05-311-1/+52
|\| | | | | | | | | | | | | | | | | a818ead4d0 Change-Id: Ib952c7172973fa223d5ce6a0423395a5102324e2
| * | Report super partition size, slot size and free space am: e2ad4d3bebAlessio Balsini2020-05-311-1/+52
| |\| | | | | | | | | | Change-Id: I719fd9192ccbaa8db363c0710346093ad2f12f7a
| | * Report super partition size, slot size and free spaceAlessio Balsini2020-05-291-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following metrics to the update attempter: - super_partition_size_bytes: that tells the total size of the super partition, - slot_size_bytes: total size of all the partition groups in the current slot, and - super_free_space: available free space in the super partition. Bug: 154016862 Test: Manual OTA Signed-off-by: Alessio Balsini <balsini@google.com> Change-Id: I159a31fb3b71a3ae4c6fb63c81c55635645cc82a
* | | Report retrofit and COW image size am: 4ed0512acc am: 56a11fe57cAlessio Balsini2020-05-311-3/+13
|\| | | | | | | | | | | Change-Id: I14e50a3ec86594e3f8378037a11ebe03f8c0e3eb
| * | Report retrofit and COW image size am: 4ed0512accAlessio Balsini2020-05-311-3/+13
| |\| | | | | | | | | | Change-Id: I9d48f06a1cf7765897cbd2f6eaace0c5d017d958
| | * Report retrofit and COW image sizeAlessio Balsini2020-05-291-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add is_vab_retrofit (that tells if the device upgraded to Virtual A/B or was natively supporting the feature) and cow_file_size_bytes (the total size of the space allocated in /data for the dm-snapshot COW images). Bug: 154016862 Test: Manual OTA Signed-off-by: Alessio Balsini <balsini@google.com> Change-Id: I529028bc208b7dd12df0bc28974f65b821d14cd9
* | | Merge "Do not erase system_other if zero length." into rvc-dev am: ↵Yifan Hong2020-05-141-0/+7
|\| | | | | | | | | | | | | | | | | 46aa61ec59 am: 887305edfb Change-Id: Ia5817b3a2aedb949e61da715671c4d20c7a6e700
| * | Merge "Do not erase system_other if zero length." into rvc-dev am: 46aa61ec59Yifan Hong2020-05-141-0/+7
| |\| | | | | | | | | | Change-Id: Ib0ea06015fa9c680eebefba5ea3434b3c8f44eb7
| | * Merge "Do not erase system_other if zero length." into rvc-devYifan Hong2020-05-141-0/+7
| | |\
| | | * Do not erase system_other if zero length.Yifan Hong2020-05-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be precise, do not erase it if the partition size is smaller than the AVB_FOOTER_SIZE, because it doesn't make sense to erase. Test: pass Bug: 155263137 Change-Id: I20778a8965526beb7ece1d79100646e770d0aa2e Merged-In: I20778a8965526beb7ece1d79100646e770d0aa2e
* | | | Allow non-existing fstab.postinstall am: 4b28a53926 am: f1f1b77196Yifan Hong2020-04-281-1/+4
|\| | | | | | | | | | | | | | | Change-Id: I6e1099bc6407690244492153065695b5728d9c9c
| * | | Allow non-existing fstab.postinstall am: 4b28a53926Yifan Hong2020-04-281-1/+4
| |\| | | | | | | | | | | | | | Change-Id: I2a40679b63b16cb64a5b7a76410192fa95370b9d
| | * | Allow non-existing fstab.postinstallYifan Hong2020-04-281-1/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This file is only installed when cppreopts.sh is installed. However, the latter might not be installed if system_other is not used. Bug: 155053192 Test: pass Change-Id: I8569d72c03a260bd1be9dcccb5b9ae670117179c (cherry picked from commit 93cde30635c844c9a78b78dcea283af0e70767ee) Merged-In: I8569d72c03a260bd1be9dcccb5b9ae670117179c
* | | Avoid VAB merge when running a DSU am: 2327992678 am: eabac7a6edHoward Chen2020-04-231-0/+7
|\| | | | | | | | | | | Change-Id: I832af5ea10995811def8d43b01865e7ba024f370
| * | Avoid VAB merge when running a DSU am: 2327992678Howard Chen2020-04-231-0/+7
| |\| | | | | | | | | | Change-Id: I1f6b0d96d400751ccca44a545d26325508ea3b55
| | * Avoid VAB merge when running a DSUHoward Chen2020-04-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 147071959 Test: ota_e2etest.py Merged-In: I9c8dcb4a2648d814672a966ce951516c1682d5f2 Change-Id: I9c8dcb4a2648d814672a966ce951516c1682d5f2
* | | Merge "Allow to skip mounting metadata in recovery." into rvc-dev am: ↵Yifan Hong2020-04-093-15/+98
|\| | | | | | | | | | | | | | | | | 9764582021 am: 845b9eb98b Change-Id: I2e5f971ab4cce40cc28a2767e028d49ebebd98fa
| * | Merge "Allow to skip mounting metadata in recovery." into rvc-dev am: 9764582021Yifan Hong2020-04-093-15/+98
| |\| | | | | | | | | | Change-Id: Ie65a1a467bc7e3ef9c0c3d80bd45f63bc3fa447b
| | * Merge "Allow to skip mounting metadata in recovery." into rvc-devYifan Hong2020-04-093-15/+98
| | |\
| | | * Allow to skip mounting metadata in recovery.Yifan Hong2020-04-083-15/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After factory data reset, metadata has no valid ext4 fs, and it is not formatted when recovery is started. Hence, it is possible that recovery can't mount metadata. Use fallback path for sideloading full OTAs on Virtual A/B devices in this case. Test: the following: fastboot reboot fastboot -w fastboot reboot recovery adb root adb shell mount -t ext4 /dev/block/by-name/metadata /metadata # fails adb reboot sideload adb sideload ota.zip # successful Bug: 152352037 Change-Id: I51ae3e5918b0c00054f309832c45823d80e46c69 (cherry picked from commit 77141004ba643a1d6b9d8a663cfb0791c2fe6b92) Merged-In: I51ae3e5918b0c00054f309832c45823d80e46c69