summaryrefslogtreecommitdiff
path: root/fastboot/fastboot_driver.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2019-10-21 16:45:59 -0700
committerDavid Anderson <dvander@google.com>2019-10-31 01:11:16 +0000
commitab8f466107572cd18bad3ed79c77b35daca5f0e4 (patch)
treea368582462a24ac11fbd1aa5a2b4550f107ce739 /fastboot/fastboot_driver.cpp
parent32e7325c4400dd9f5fbf359c5673c2aab53a0e85 (diff)
fastboot: Implement helper commands for Virtual A/B.
This introduces two new commands to the fastboot protocol: - getvar snapshot-update-status - Return "none", "snapshotted", or "merging" depending on the current status set by the boot control HAL. - snapshot-update [cancel] - Cancel any pending snapshot-based updates via the boot control HAL. After this, the HAL should return MergeStatus::CANCELLED and "update-merge-status" should be "none". If no argument is specified, the snapshot-update-status is returned via an INFO response. Bootloaders are expected to implement this in a manner consistent with the boot control HAL. Fastboot-based tooling should expect wipes of userdata to fail when update-merge-status returns "merging". Thus, the force flag now cancel any pending snapshots. Bug: 139154945 Test: fastboot getvar snapshot-update-status fastboot snapshot-update cancel fastboot snapshot-update Change-Id: Idc423fe7656b212e929e64eb0e6b85b453e0e8dc
Diffstat (limited to 'fastboot/fastboot_driver.cpp')
-rw-r--r--fastboot/fastboot_driver.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fastboot/fastboot_driver.cpp b/fastboot/fastboot_driver.cpp
index b897182a2..6a5ad206a 100644
--- a/fastboot/fastboot_driver.cpp
+++ b/fastboot/fastboot_driver.cpp
@@ -122,6 +122,12 @@ RetCode FastBootDriver::SetActive(const std::string& slot, std::string* response
response, info);
}
+RetCode FastBootDriver::SnapshotUpdateCommand(const std::string& command, std::string* response,
+ std::vector<std::string>* info) {
+ std::string raw = FB_CMD_SNAPSHOT_UPDATE ":" + command;
+ return RawCommand(raw, response, info);
+}
+
RetCode FastBootDriver::FlashPartition(const std::string& partition,
const std::vector<char>& data) {
RetCode ret;