summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-09-27 12:58:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-09-27 14:02:21 +0200
commitfa92b0bf757084f69780e533bc498106d51f6f5e (patch)
treed1693d2bd07a41f7ee9394711eca7067aab28c73
parent470ac4a7ba37dc1c09f2d59ba0f7bf7519d45d92 (diff)
downloadbarebox-fa92b0bf757084f69780e533bc498106d51f6f5e.tar.gz
barebox-fa92b0bf757084f69780e533bc498106d51f6f5e.tar.xz
fastboot command: Add -b option to export bbu handlers
When -b is given the usbgadget command will automatically export the registered bbu handlers via fastboot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/usbgadget.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/commands/usbgadget.c b/commands/usbgadget.c
index 59359098ad..507871edd2 100644
--- a/commands/usbgadget.c
+++ b/commands/usbgadget.c
@@ -33,11 +33,11 @@
static int do_usbgadget(int argc, char *argv[])
{
int opt, ret;
- int acm = 1, create_serial = 0, fastboot_set = 0;
+ int acm = 1, create_serial = 0, fastboot_set = 0, fastboot_export_bbu = 0;
const char *fastboot_opts = NULL, *dfu_opts = NULL;
struct f_multi_opts *opts;
- while ((opt = getopt(argc, argv, "asdA::D:")) > 0) {
+ while ((opt = getopt(argc, argv, "asdA::D:b")) > 0) {
switch (opt) {
case 'a':
acm = 1;
@@ -54,6 +54,9 @@ static int do_usbgadget(int argc, char *argv[])
fastboot_opts = optarg;
fastboot_set = 1;
break;
+ case 'b':
+ fastboot_export_bbu = 1;
+ break;
case 'd':
usb_multi_unregister();
return 0;
@@ -85,6 +88,7 @@ static int do_usbgadget(int argc, char *argv[])
opts->fastboot_opts.files = file_list_parse(fastboot_opts);
if (IS_ERR(opts->fastboot_opts.files))
goto err_parse;
+ opts->fastboot_opts.export_bbu = fastboot_export_bbu;
}
if (dfu_opts) {
@@ -119,6 +123,7 @@ BAREBOX_CMD_HELP_OPT ("-a", "Create CDC ACM function")
BAREBOX_CMD_HELP_OPT ("-s", "Create Generic Serial function")
BAREBOX_CMD_HELP_OPT ("-A [desc]", "Create Android Fastboot function. If 'desc' is not provided,")
BAREBOX_CMD_HELP_OPT ("", "trying to use 'global.usbgadget.fastboot_function' variable.")
+BAREBOX_CMD_HELP_OPT ("-b", "include registered barebox update handlers (fastboot specific)")
BAREBOX_CMD_HELP_OPT ("-D <desc>", "Create DFU function")
BAREBOX_CMD_HELP_OPT ("-d", "Disable the currently running gadget")
BAREBOX_CMD_HELP_END