From fa92b0bf757084f69780e533bc498106d51f6f5e Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 27 Sep 2017 12:58:31 +0200 Subject: 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 --- commands/usbgadget.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'commands') 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 ", "Create DFU function") BAREBOX_CMD_HELP_OPT ("-d", "Disable the currently running gadget") BAREBOX_CMD_HELP_END -- cgit v1.2.3