summaryrefslogtreecommitdiff
path: root/dynamic_partition_control_interface.h
Commit message (Collapse)AuthorAgeFilesLines
* Move DynamicPartitionControlInterface to common/Yifan Hong2019-11-131-70/+0
| | | | | Test: builds Change-Id: Iae63dee2e2c4f768690d27261347f56b90bdf2c5
* Proper split of BootControl and DynamicPartitionControl.Yifan Hong2019-11-131-44/+0
| | | | | | | | | | | | | | | | | | | | | All dynamic/static partitions stuff are moved to DynamicPartitionControlAndroid. After this patch: (1) BootControl remains a simple shim over the boot control HAL. (BootControl still have two calls that is a delegate to DynamicPartitionControl, which will be cleaned up in follow up CLs.) (2) DynamicPartitionControlInterface API is minimized. All libdm and other Android specific details are hidden from the API surface now. Also move tests from boot_control_unittest to dynamic_partition_control_unittest because functionalities are moved. Test: update_engine_unittests Change-Id: I6ed902197569f9f0ef40e02703634e9078a4b060
* Sanity check that no downgrade package on launch VAB device.Yifan Hong2019-10-231-0/+1
| | | | | | | | | | | | If the OTA server were misconfigured, OTA client can reject the OTA if the current device launches with VAB but is trying to update to a build that does not support VAB. This operation is only permitted on retrofit devices. Bug: 138258570 Test: pass Change-Id: I159ff2edc81555fee8bfa6296e0c6c969f2f4f6d
* DynamicPartitionControl: only create snapshot when snapshot_enabledYifan Hong2019-10-171-4/+5
| | | | | | | | | | | | Do not create snapshot when applying downgrade to non-Virtual-A/B packages and secondary OTAs. Test: apply downgrade OTA on Virtual A/B devices Bug: 138733621 (secondary OTA) Fixes: 138258570 (downgrades) Change-Id: I13318f57613d6bd60a5b7e81ebb3e35b3c225a0c
* Call SnapshotManager::FinishedSnapshotWritesYifan Hong2019-09-231-0/+2
| | | | | | | | | | | ... when the update has finished. This allows SnapshotManager to conclude the update and prepare for reboot. Test: builds Test: apply OTA on Virtual A/B device, then check /metadata/ota/snapshot-boot exists, then reboot Bug: 138816109 Change-Id: I2a4699865b09358ef018313bed64e34617a78e3c
* [REFACTOR] Pass DeltaArchiveManifest to DynamicPartitionControlYifan Hong2019-09-231-2/+3
| | | | | | | | | | | | | | DynamicPartitionControl need the list of operations to calculate COW sizes. - Remove BootControlInterface::PartitionMetadata. Replace all references with DeltaArchiveManifest. DeltaArchiveManifest has all information that PartitionMetadata has. - Rename all InitPartitionMetadata to PreparePartitionsForUpdate - Change all PreparePartitionsForUpdate to use new signature Bug: 138816109 Test: update_enigne_unittests --gtest_filter=*BootControl*:*Dynamic* Change-Id: I4389ba2b1801addf8c3bc8395e2ea6a9a3ed27a0
* DynamicPartitionsControl: Add Virtual A/B feature flag.Yifan Hong2019-08-291-0/+3
| | | | | | Test: unittest Bug: 138816109 Change-Id: I7ae65ba0bf36a6ca5085bc4ec2c46245288b4703
* [REFACTOR] DynamicPartitionControl: Add GetSuperPartitionNameYifan Hong2019-07-311-0/+4
| | | | | | | | | | | | | fs_mgr_get_super_partition_name() should be mocked because it is an external dependency to libfs_mgr. In tests, deliberately make GetSuperDevice() to return "fake_super" instead of "super" to make sure it is mocked properly. Test: run unittests Test: manually apply OTA Change-Id: I0f05d99bf168b6e658052b4bd67dc1e82ab36471
* [REFACTOR] DynamicPartitionControl: combine DAP feature flag APIsYifan Hong2019-07-311-5/+15
| | | | | | | | | | Combine IsDynamicPartitionsEnabled/Retrofit into one API that returns a FeatureFlag struct instead. This allows us to add new feature flags more easily. Test: unittest Change-Id: I32f0f0c4d5c636d2eac3bf99d6f92fcc6b71c7a9
* [REFACTOR] DynamicPartitionControl: minimize APIYifan Hong2019-07-311-16/+10
| | | | | | | | | | | | | | | - Move UpdatePartitionMetadata in boot_control_android.cc to DynamicPartitionControlAndroid::PreparePartitionsForUpdate to reflect code ownership better. - Minimize the API by removing unused functions now that we have PreparePartitionsForUpdate - Fix tests: replace MockDynamicPartitionControl to MockDynamicPartitionControlAndroid because it tests DynamicPartitionControlAndroid. Test: unit test Test: manually apply full OTA Change-Id: I2959270bd89c4f8ddaa45cf45ba93acdec850f67
* Fix build for API change to DestroyLogicalPartition().David Anderson2019-07-131-1/+1
| | | | | | | | This method no longer uses a timeout parameter. Bug: 135771280 Test: update_engine and update_engine_unittests build Change-Id: If4764bf2d60c6b3aac1e8052c7fbb013c7b3349d
* Retrofit devices do not do allocatable space / 2.Yifan Hong2018-11-201-0/+3
| | | | | | | | | Retrofit devices have two supers, so the allocatable space does not need to be halved. Test: manual OTA Bug: 118506262 Change-Id: I31c77b9318e7c0b6bc6d1a8ae6efa70a3383b05f
* DynamicPartitionControl: support retrofit devicesYifan Hong2018-11-151-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | On retrofit devices: * The retrofit update includes block devices at source slot (for example, system_a, vendor_a, product_a). This is done automatically because the retrofit update does not look different from regular updates in OTA client's perspective. * The first update after the retrofit update includes the rest of the block devices (in the above example, system_b, vendor_b and product_b). In order to do the second, * use NewForUpdate() API from liblp to automatically include block devices at the target slot when the metadata is loaded. * Use FlashPartitionTable() API to flash metadata to system_b directly without reading existing metadata from it. Test: manual OTA on retrofit devices Bug: 118506262 Change-Id: Ib2c15b8a1a04271320bfef408813723a5b2a7bd7
* Add force_writable to MapPartitionOnDeviceMapperYifan Hong2018-10-301-0/+1
| | | | | | | | | | In sideloading we will map source partitions with force_writable = false. Test: manual sideloading Bug: 117101719 Change-Id: I7629b8ecce07a9bd2c9e24ac6b64617386067ca5
* update_engine resize dynamic partitions during OTA.Yifan Hong2018-09-281-0/+90
update_engine uses device mapper to resize dynamic partitions before opening the devices to apply the update. * DeltaPerformer calls BootControlInterface::InitPartitionMetadata when parsing the update manifest. The implementation for BootControlAndroid::InitPartitionMetadata does the following if sizes for dynamic partitions are incorrect (assuming updating from slot A to B): * Load metadata from metadata slot A * Delete all extents of partitions at slot B (with _b suffix) * Add extents for partitions at slot B * Write metadata to metadata slot B * Re-map all partitions at slot B using metadata slot B with force_writable = true * BootControlAndroid::GetPartitionDevice() checks device-mapper before returning static partitions. * PostinstallRunnerAction::Cleanup calls BootControlInterface::Cleanup which unmaps all partitions at slot B. A partition "foo" is considered dynamic if foo_a exists as a dynamic partition OR foo_b does NOT exist as a static partition. Bug: 110717529 Test: manual ota Test: update_engine_unittests --gtest_filter=*BootControlAndroid* Change-Id: I50f410b486a874242663624801c3694151bdda18