summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorJocelyn Bohr <bohr@google.com>2017-01-27 14:17:56 -0800
committerJocelyn Bohr <bohr@google.com>2017-04-27 16:47:51 -0700
commit91fefadc2e99ffd7e6fb12637dcf94df547cdb89 (patch)
tree0a9809599e1f7d1ae7384ca13ffb09a13f0499ba /fastboot/fastboot.cpp
parent98cc28316866e554f6fcb2c2e4f96ca09d98130f (diff)
fastboot: Add 'get_staged' command
(cherry-picked from internal nyc-iot-dev to AOSP) New user-level command usage: * fastboot get_staged <outfile> Reads staged data from the last command handled by the device. If the last command did not result in staged data, this command will fail. This enables data staged by OEM commands to be transferred from device to host. get_staged wraps new device command "upload". Fastboot clients are not required to support "upload", so get_staged won't work on all devices. Bug: 36002804 Test: Implemented "upload" in fastboot on imx6ul. Verified that uploading ~100K data from the device works. Change-Id: I5b1a1ce023f362062505ee62746ea8ab6f36bfbf (cherry-picked from commit 83a875de994bf48f0faa2a8a23ceb0b8f52b6b04)
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index e5ba93a59..0d59901b6 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -375,6 +375,9 @@ static void usage() {
" stage <infile> Sends contents of <infile> to stage for\n"
" the next command. Supported only on\n"
" Android Things devices.\n"
+ " get_staged <outfile> Receives data to <outfile> staged by the\n"
+ " last command. Supported only on Android\n"
+ " Things devices.\n"
" help Show this help message.\n"
"\n"
"options:\n"
@@ -1819,6 +1822,11 @@ int main(int argc, char **argv)
die("cannot load '%s'", infile.c_str());
}
fb_queue_download_fd(infile.c_str(), buf.fd, buf.sz);
+ } else if(!strcmp(*argv, "get_staged")) {
+ require(2);
+ char *outfile = argv[1];
+ skip(2);
+ fb_queue_upload(outfile);
} else if(!strcmp(*argv, "oem")) {
argc = do_oem_command(argc, argv);
} else if(!strcmp(*argv, "flashing")) {