summaryrefslogtreecommitdiffstats
path: root/commands/loadxy.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: open_and_lseek(): move error messages to callersSascha Hauer2023-08-181-1/+1
| | | | | | | | | For some cases like in common/filetype.c the caller already prints an error message, so to avoid duplicated error messages leave it up to the caller to print an error. This also adds error messages to all callers where necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/*: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-04-271-17/+3
| | | | | | | | | | | | | While at it also drop references to the non-existing CREDITS file and do some small rearrangements for some uniform formatting. (SPDX-License-Identifier first, then copyright texts and then an empty line.) The advantage is that these specifiers are machine-parseable which helps license conformance. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: loadxy: Make use of open_and_lseek()Andrey Smirnov2019-03-111-11/+2
| | | | | | | | Save a bit of extra code by replacing explict calls to open() and lseek() with a single call to open_and_lseek(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadxy: add missing ) to help textUwe Kleine-König2017-08-151-2/+2
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* commands: exit on invalid optionEnrico Jorns2016-09-161-2/+1
| | | | | | | | | | Barebox commands should not perform any action and return 0 if an invalid parameter was given. This might cause undetected unintended behvaior when calling commands with wrong options, either manually or from a script. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadxy: use console_set_baudrateSascha Hauer2015-06-091-20/+26
| | | | | | No need to do this manually Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadx: ignore -c optionSascha Hauer2015-06-091-6/+1
| | | | | | | And always create the file if necessary. No need to have an extra flag for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadxy: use console_get_baudrateSascha Hauer2015-06-091-3/+1
| | | | | | No need to fiddle with device parameters anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadxy: Use console_get_by_nameSascha Hauer2015-06-091-24/+2
| | | | | | | | | Use console_get_by_name rather than iterating over the console list in the loadxy code. The code in loadxy.c used to test whether a console is active before using it. This check is dropped along the way since there's no reason to not being able to use a disabled console for loadxy. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: loady: fix bug with netconsoleRobert Jarzmik2015-01-051-3/+3
| | | | | | | | | | | | | Netconsole doesn't have a baudrate. Loady supposes a console has one, and tries to compute the console's baudrate variable value, regardless of its existence. This triggers a NULL pointer dereference on netconsole. If attempting loady on a netconsole is a bit useless, barebox should not panic. Fix this by checking the variable exists before reading its value. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Do not use macros in command helpSascha Hauer2014-07-081-1/+1
| | | | | | | The help texts are parsed by sphinx which cannot handle macros, so replace them with their values. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-25/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+2
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix the options and protocols used by the loadx command.Owen Kirby2014-05-091-5/+5
| | | | | | | | | | | | | | | From 3cd970250ff17ac406e46e18ebb26aa35949d1db Mon Sep 17 00:00:00 2001 From: Owen Kirby <osk@exegin.com> Date: Thu, 8 May 2014 13:27:11 -0700 Subject: [PATCH] Fix the options and protocols used by the loadx command. It seems like the loadx command was improperly copy/pasted from the loady implementation, and was trying to load files using the ymodem protocol. This patch should fix the command so that it uses xmodem, implements the -t option and outputs the correct baudrate being used. Signed-off-by: Owen Kirby <osk@exegin.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: loady: fix Y-Modem/G option name in help messageAntony Pavlov2014-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | Actually loady command uses '-g' option for Y-Modem/G mode selection; see loady() function: while ((opt = getopt(argc, argv, "b:t:g")) > 0) { switch (opt) { ... case 'g': is_ymodemg = 1; break; By mistake help message show '-y' option for Y-Modem/G mode selection. This patch fixes the problem. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: factorise function to get the first enabled consoleJean-Christophe PLAGNIOL-VILLARD2013-10-061-22/+2
| | | | | | | rename it to console_get_first_active Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove old Y-Modem implementationRobert Jarzmik2012-11-121-17/+52
| | | | | | | | | | | | As a new implementation of Y-Modem protocol is available, switch from old implementation to the new one : - remove old xyzModem* files - remove old command loady2 - rename command loady2 to loady Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Tested-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: change Y-Modem implementationRobert Jarzmik2012-11-121-0/+238
The current Y-Modem implementation has some limitations: - Y-Modem/G protocol is not supported - Multiple files (aka. batch) transfers are not supported - Transfer speed over fast lines (USB console) is slow - Code is not trivial to maintain (personnal opinion) This implementation tries to address all these points by introducing loady2 command. The effects are : - transfer speed for Y-Modem over USB jumps from 2kBytes/s to 180kBytes/s - transfer speed for Y-Modem/G jumps to 200kBytes/s - multiple file transfers are possible This command was tested on a USB console and UART 9600bps serial line : - NAKs (and retransmissions) were tested for faulty serial lines - multiple file transfers were tested - Y-Modem, Y-Modem/G and X-Modem transfers were tested Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Tested-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>