summaryrefslogtreecommitdiff
path: root/common/dynamic_partition_control_interface.h
Commit message (Collapse)AuthorAgeFilesLines
* Allow forward merge on powerwash.Yifan Hong2020-03-271-1/+1
| | | | | | | | | | | | | If package schedules powerwash, snapshots on a Virtual A/B device will be deleted. Tell SnapshotManager to handle this case. Test: apply downgrade package Test: apply package with wipe Test: apply package then manually wipe Bug: 152094219 Change-Id: I8601b661924abcc82956788e2f33cdb70d71f778 (cherry picked from commit 7b3910a58bd0b8d9f0bd316fad5776ef0a8494ba) Merged-In: I8601b661924abcc82956788e2f33cdb70d71f778
* ResetStatus deletes snapshots for VAB.Yifan Hong2020-03-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When ResetStatus() is called, delete snapshots to free up space on VAB devices. On regular A/B, there is no need to cancel the update completely so that the update may be resumed next time. However, on VAB devices, a cancelled update should not occupy previously allocated space. Test: manually call update_engine_client --cancel when an update is in progress, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Test: manually kill update_engine when an update is in progress, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Test: manually apply an update until UPDATED_NEED_REBOOT, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Test: manually apply an update until UPDATED_NEED_REBOOT, then kill update_engine, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Bug: 147696014 Change-Id: Ic7049772091a34e0e666fd7ae361ef474d5a28aa Merged-In: Ic7049772091a34e0e666fd7ae361ef474d5a28aa
* ShouldSkipOperation -> OptimizeOperationYifan Hong2020-03-121-3/+8
| | | | | | | | | | | | | | | | For SOURCE_COPY operations like 563412 -> 123456 OptimizeOperation optimizes it to 5612 -> 1256 and skip writing blocks that does not need to be written for snapshot partitions. Bug: 148623880 Test: update_engine_unittests Test: apply incremental OTA Change-Id: Ifd2c3851f703f272a74c8f0e9a1c9a82dbcce3e3 Merged-In: Ifd2c3851f703f272a74c8f0e9a1c9a82dbcce3e3
* Delete DynamicPartitionControl::CleanupSuccessfulUpdateYifan Hong2020-03-051-9/+0
| | | | | | | | | It is replaced with GetCleanupPreviousUpdateAction now. Test: builds Bug: 147696014 Change-Id: I8cb281bf811052d1dfea6c14c8685a90915cafa8 Merged-In: I8cb281bf811052d1dfea6c14c8685a90915cafa8
* UpdateAttempterAndroid::Init initiates mergeYifan Hong2020-03-051-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On update_engine starts, schedule CleanupPreviousUpdateAction that calls CleanupSuccessfulUpdate to do necessary cleanup as soon as possible. In the good case, update_engine initiates merge when sys.boot_completed, and clean up snapshots. If the update is rolled back or partitions are flashed, the following happens (on a Virtual A/B device): - UpdateAttempterAndroid::CleanupSuccessfulUpdate is called - DynamicPartitionControlAndroid::CleanupSuccessfulUpdate is called - SnapshotManager::InitiateMergeAndWait is called - SnapshotManager::RemoveAllUpdateState(before_cancel) is called - before_cancel is called, DeltaPerformer::ResetUpdateProgress is called - All update states in update_engine is reset. - SnapshotManager proceeds to delete snapshots - All update states in SnapshotManager is reset. Hence, on an VAB device, when an update is rolled back or partitions are flashed, the whole update needs to be re-applied (while in A/B, it skips writing and directly start verifying hashes of the target partitions because the update markers are still there). Bug: 147696014 Test: apply OTA then reboot, inspect logs and do `snapshotctl dump` Change-Id: I0fc5e7768dfb53e4fd474f2d8d85d2a1b615a88b Merged-In: I0fc5e7768dfb53e4fd474f2d8d85d2a1b615a88b
* Add DynamicPartitionControlInterface::CleanupSuccessfulUpdateYifan Hong2020-01-221-0/+9
| | | | | | | | | | This is a wrapper over SnapshotManager::WaitForMerge. It waits until the previous update is merged, then return. Bug: 138808328 Test: manual with update_engine_client Change-Id: If44854810f37dd959ffdf3f62f26528867a71fc8
* DynamicPartitionControl: Add required_size to PrepareYifan Hong2020-01-161-1/+6
| | | | | | | | | | | Add out parameter required_size to PreparePartitionsForUpdate to indicate the total size required on /userdata in order to apply the update. Bug: 138808058 Test: update_engine_unittests Change-Id: I2768d13671e212fd24a1a22811b50c9738834459
* DynamicPartitionControl: document FinishUpdateYifan Hong2020-01-151-0/+2
| | | | | Test: none Change-Id: I05d38e913671b120bc804a867cc82a442e8dd379
* Only skip operation on snapshot partitionsYifan Hong2019-12-041-2/+6
| | | | | | | | | On Virtual A/B devices, don't skip SOURCE_COPY on static partitions. Test: update_engine_unittest Test: incremental update to self Change-Id: I5c93b501e09f50f559151eb77d83052373c90d0d
* SkipInstallOperation placeholdersAlessio Balsini2019-11-271-0/+3
| | | | | | | | | | | | | | For some devices, some InstallOperations can be skipped during the update process. An example is the SOURCE_COPY operation with same source and destination locations for Virtual A/B devices. This patch extents the DynamicPartitionControl interface with the ShouldSkipOperation() method to query if given operation should be skipped or not. Bug: 141207436 Test: build Change-Id: I94dbf1d33d531944e04cb2ffcba274106e866d5d Signed-off-by: Alessio Balsini <balsini@google.com>
* Move DynamicPartitionControlInterface to common/Yifan Hong2019-11-131-0/+70
Test: builds Change-Id: Iae63dee2e2c4f768690d27261347f56b90bdf2c5