summaryrefslogtreecommitdiffstats
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2019-01-15 14:38:20 -0800
committerDavid Anderson <dvander@google.com>2019-01-17 18:33:14 +0000
commit1d504e3342b2960066739ea66fac6625b07560fb (patch)
tree0efac4787a95a99f95c0125765da6a3bc3c33cf8 /fastboot/fastboot.cpp
parent0e330f12bc7f693933b96ad729d296a92ffd80b7 (diff)
downloadsystem_core-1d504e3342b2960066739ea66fac6625b07560fb.tar.gz
system_core-1d504e3342b2960066739ea66fac6625b07560fb.tar.bz2
system_core-1d504e3342b2960066739ea66fac6625b07560fb.zip
fastbootd: Add command to remove GSI installs
Note: this only removes the bootable marker, since we're unable to remove the userdata files within recovery. Bug: 121210348 Test: fastboot gsi wipe fastboot gsi disable Change-Id: I64fe848c787d426ae9d18a1557a9d6b340bfc2cf
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 0b8d9b22e..d753f0f82 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -387,6 +387,7 @@ static int show_help() {
" Format a flash partition.\n"
" set_active SLOT Set the active slot.\n"
" oem [COMMAND...] Execute OEM-specific command.\n"
+ " gsi wipe|disable Wipe or disable a GSI installation (fastbootd only).\n"
"\n"
"boot image:\n"
" boot KERNEL [RAMDISK [SECOND]]\n"
@@ -1926,6 +1927,16 @@ int FastBootTool::Main(int argc, char* argv[]) {
std::string partition = next_arg(&args);
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") {
+ fb->RawCommand("gsi:wipe", "wiping GSI");
+ } else if (args.size() == 1 && args[0] == "disable") {
+ fb->RawCommand("gsi:disable", "disabling GSI");
+ } else {
+ syntax_error("expected 'wipe' or 'disable'");
+ }
} else {
syntax_error("unknown command %s", command.c_str());
}