summaryrefslogtreecommitdiff
path: root/common/boot_control_interface.h
AgeCommit message (Collapse)Author
2021-02-11MetricsReporter gets DynamicPartitionControl.Yifan Hong
Test: TH Bug: 178732971 Change-Id: If434927b7abdecb8093db1462dae196cd744331a
2020-11-23Do not map dynamic partitions on VABC devicesKelvin Zhang
With VABC, we no longer need to map all partitions before reading/writing, so don't try to map them. 1. modify GetPartitionDevice to return empty path for target partitions on VABC 2. Add a separate GetMountableTargetDevice for obtaining a mountable device path, specifically for postinstall Test: treehugger Change-Id: Ib1f608914fc49c677ce7389140ca79b028171191
2020-06-08Add an overload function in boot controlTianjie
It's used to support partial update. The overload function takes additional info whether the partition is included in payload. And it also outputs if the partition is a dynamic partition. Bug: 157778739 Test: unit tests pass Change-Id: I0741d44c223fb7c187fe208564371acd6d868c65
2020-03-05BootControl: is slot marked successfulYifan Hong
Test: update_engine_unittests Bug: 147696014 Change-Id: I316efda7a0936e2dee0f766efb5c18ff30790274
2019-11-13Remove BootControlInterface::CleanupYifan Hong
It is just a wrapper around GetDynamicPartitionControl()->Cleanup(). Delete it and let callers call it instead. Test: update_engine_unittests Change-Id: I068228a43dac122828c28bbc49a0f6f77e5b6ff2
2019-11-13Remove BootControlInterface::PreparePartitionsForUpdateYifan Hong
Replace with GetDynamicPartitionControl()->PreparePartitionsForUpdate( GetCurrentSlot(), ...). Test: update_engine_unittests Change-Id: Ib03ee97a25727a9292cbb0c9aab5dbe75a2b6913
2019-11-13BootControl exposes DynamicPartitionControl.Yifan Hong
Add BootControlInterface::GetDynamicPartitionControl, which exposes the internal DynamicPartitionControlInterface object. BootControlStub / FakeBootControl / BootControlChromeOS uses DynamicPartitionControlStub (all functions succeeds). BootControlAndroid uses DynamicPartitionControlAndroid. GetPartitionDevice is exposed so that BootControlAndroid can use it. Follow-up CLs delete duplicated PreparePartitionsForUpdate and Cleanup from BootControlInterface so that BootControlAndroid remains a thin wrapper of the HAL (+GetPartitionDevice, which exists before dynamic partitions.) Test: update_engine_unittests Change-Id: Ifc2aa2ee8a63ef581c8ebc562ec158794ac51dfd
2019-09-23[REFACTOR] Pass DeltaArchiveManifest to DynamicPartitionControlYifan Hong
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
2019-01-04Call InitPartitionMetadata when resuming an update.Tao Bao
BootControlAndroid::InitPartitionMetadata() should always be called when starting / resuming an update that uses dynamic partitions. This allows updating the metadata for the target slot, as well as setting up the internal state for accessing the dynamic partitions in the target slot. Bug: 122097567 Test: Run update_engine_unittests on taimen and blueline. Test: Apply a payload that uses dynamic partitions. Reboot before it finishes, then resume the update. Change-Id: I1353f7460a61c0183654b6349689beaa9bf12129
2018-10-26Support updateable groups.Yifan Hong
Adds updateable group support to OTA. * DeltaPerformer combines partition sizes with dynamic_partition_metadata to BootControlInterface::PartitionMetadata. * BootControlAndroid::InitPartitionMetadata: * Copy all groups / partitions from source metadata slot * Remove all groups / partitions mentioned in the manifest (of the target slot) * Re-add all groups / partitions mentioned in the manifest. * BootControlAndroid::InitPartitionMetadata can check the incoming PartitionMetadata to see if a partition is dynamic or not. The guessing logic is completely removed. * Because a partition is removed then re-added, there is no need for preserving the entry with size 0 to indicate that a partition is removed. When update_engine sees a partition in a group "foo" on the device, but manifest contains group "foo" without the partition, it removes the partition. * Hence, Removing a partition does NOT require keeping the entry (i.e. RemovePartition is used instead of ShrinkPartition(0) ). This makes retrofitting dynamic partitions on older devices easier. The following is now allowed: - Adding / removing / resizing partitions - Adding / resizing groups It is not allowed to remove a group, but a group can always be resized to zero to deprecate it. Test: update_engine_unittests Bug: 117182932 Change-Id: I39d77f1d1d1fc52fc245f3de699635e6a429015e
2018-10-26PartitionSizes -> PartitionMetadataYifan Hong
In a following CL, InitPartiitonMetadata not only takes sizes but also group of each partition. Rename the struct to a more generic name. Test: builds Change-Id: Ie8a7e58b0cccc45e533de368e24f5a73d556de65
2018-09-28update_engine resize dynamic partitions during OTA.Yifan Hong
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
2015-11-12Split payload application code into a subdirectory.Alex Deymo
This patch splits from the main libupdate_engine code the part that is strictly used to download and apply a payload into a new static library, moving the code to subdirectories. The new library is divided in two subdirectories: common/ and payload_consumer/, and should not depend on other update_engine files outside those two subdirectories. The main difference between those two is that the common/ tools are more generic and not tied to the payload consumer process, but otherwise they are both compiled together. There are still dependencies from the new libpayload_consumer library into the main directory files and DBus generated files. Those will be addressed in follow up CLs. Bug: 25197634 Test: FEATURES=test emerge-link update_engine; `mm` on Brillo. Change-Id: Id8d0204ea573627e6e26ca9ea17b9592ca95bc23