diff options
author | David Anderson <dvander@google.com> | 2019-10-31 18:02:41 -0700 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2019-11-10 23:07:13 -0800 |
commit | 220ddb1f0fb9d0e47f7c812c93da174ea3a8c037 (patch) | |
tree | 9c863903a93eac39f0d1f800e9f5a86cd16e9d0d /fastboot/fastboot.cpp | |
parent | b58df7dac3b7d2f9aef8e2f3798ab2bd3b9969ed (diff) |
fastbootd: Disallow certain operations during snapshot updates.
When a snapshot is applied or is merging, requests to erase or flash
userdata, metadata, or misc must be protected. In addition, the
set_active command must be restricted when a merge is in progress.
In addition, introduce a "snapshot-update merge" command for assisting
with erase requests when a merge is in progress. As in recovery, this
will force a merge to complete.
Bug: 139154945
Test: apply update
fastboot erase userdata
fastboot erase metadata
fastboot erase misc
fastboot set_active
Change-Id: I152446464335c62c39ffb4cc6366be9de19eac30
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r-- | fastboot/fastboot.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 7ce7c7c0e..cbd42b17e 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -399,6 +399,9 @@ static int show_help() { " snapshot-update cancel On devices that support snapshot-based updates, cancel\n" " an in-progress update. This may make the device\n" " unbootable until it is reflashed.\n" + " snapshot-update merge On devices that support snapshot-based updates, finish\n" + " an in-progress update if it is in the \"merging\"\n" + " phase.\n" "\n" "boot image:\n" " boot KERNEL [RAMDISK [SECOND]]\n" @@ -2089,8 +2092,8 @@ int FastBootTool::Main(int argc, char* argv[]) { if (!args.empty()) { arg = next_arg(&args); } - if (!arg.empty() && arg != "cancel") { - syntax_error("expected: snapshot-update [cancel]"); + if (!arg.empty() && (arg != "cancel" && arg != "merge")) { + syntax_error("expected: snapshot-update [cancel|merge]"); } fb->SnapshotUpdateCommand(arg); } else { |