summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2019-01-29 13:09:49 -0800
committerDavid Anderson <dvander@google.com>2019-01-29 13:20:36 -0800
commit3d782d57cc94bcc9147b78b95891d8e75e138ba3 (patch)
tree7f1a552486d8e9d73e183b17ad2de1b33f204c02 /fastboot/fastboot.cpp
parent161c439ffb14f46875014982b37c50975fe70050 (diff)
fastboot: Fix "fastboot gsi".
This command erroneously reports that no GSI is installed, because /metadata is not mounted in recovery. To address this, temporarily mount /metadata when the gsi command is invoked. Bug: 122556707 Test: fastboot gsi disable fastboot gsi wipe Change-Id: Ib21971b49b46fd580b902ff75f01cfb96192afc0
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 17cab3a54..4cdd8bcd9 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1948,11 +1948,10 @@ int FastBootTool::Main(int argc, char* argv[]) {
std::string size = next_arg(&args);
fb->ResizePartition(partition, size);
} else if (command == "gsi") {
- if (args.empty()) {
- syntax_error("missing 'wipe' or 'disable' argument");
- } else if (args.size() == 1 && args[0] == "wipe") {
+ std::string arg = next_arg(&args);
+ if (arg == "wipe") {
fb->RawCommand("gsi:wipe", "wiping GSI");
- } else if (args.size() == 1 && args[0] == "disable") {
+ } else if (arg == "disable") {
fb->RawCommand("gsi:disable", "disabling GSI");
} else {
syntax_error("expected 'wipe' or 'disable'");