summaryrefslogtreecommitdiff
path: root/common/dynamic_partition_control_stub.h
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2020-02-19 15:22:47 -0800
committerYifan Hong <elsk@google.com>2020-03-05 08:48:56 -0800
commit1dcd1a64ed275e73c1663cc13a06a2032c0f33da (patch)
tree098b44d7ef6728fb7fc3ae46d5b7f8e71f3f4a8b /common/dynamic_partition_control_stub.h
parent120c31651c8aacfd3bf06a9593e88b3dd15920a1 (diff)
UpdateAttempterAndroid::Init initiates merge
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
Diffstat (limited to 'common/dynamic_partition_control_stub.h')
-rw-r--r--common/dynamic_partition_control_stub.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/dynamic_partition_control_stub.h b/common/dynamic_partition_control_stub.h
index 02575a13..92e99221 100644
--- a/common/dynamic_partition_control_stub.h
+++ b/common/dynamic_partition_control_stub.h
@@ -19,6 +19,7 @@
#include <stdint.h>
+#include <memory>
#include <string>
#include "update_engine/common/dynamic_partition_control_interface.h"
@@ -40,6 +41,10 @@ class DynamicPartitionControlStub : public DynamicPartitionControlInterface {
bool FinishUpdate() override;
ErrorCode CleanupSuccessfulUpdate() override;
+ std::unique_ptr<AbstractAction> GetCleanupPreviousUpdateAction(
+ BootControlInterface* boot_control,
+ PrefsInterface* prefs,
+ CleanupPreviousUpdateActionDelegateInterface* delegate) override;
};
} // namespace chromeos_update_engine