summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* commands: exit on invalid optionEnrico Jorns2016-09-1617-6/+30
| | | | | | | | | | 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>
* Merge branch 'for-next/misc'Sascha Hauer2016-09-132-1/+3
|\
| * commands: saveenv: exit on invalid optionEnrico Jorns2016-09-051-0/+2
| | | | | | | | | | | | | | | | Saveenv should not perform any actions if an invalid parameter was given. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands/Kconfig: fix typo in CMD_OF_FIXUP_STATUS helpChristian Hemp2016-08-221-1/+1
| | | | | | | | | | | | | | The command is of_fixup_status and not of_fixup_node. Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/menu'Sascha Hauer2016-09-131-4/+19
|\ \
| * | rework menu so that it can support multiline titlesAleksey Kuleshov2016-09-051-4/+19
| |/ | | | | | | | | Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: ubiupdatevol: confirm success with return value 0Ulrich Ölmann2016-09-061-2/+3
| | | | | | | | | | | | | | | | | | Treat the write() case analogously to the read() case and do not return the number of most recently written bytes as the status of sucessful command execution. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: ubiupdatevol: store return value of read() in a signed intUlrich Ölmann2016-09-061-2/+1
| | | | | | | | | | | | | | With an unsigned int test for errors from read() can never become true. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: usbgadget: Fix -d option help textSascha Hauer2016-08-291-1/+1
|/ | | | | | | The -d option disables any currently active gadget, it does not necessarily have to be a serial gadget. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/nv'Sascha Hauer2016-08-031-17/+26
|\
| * nv: Allow to set/remove multiple variables with one commandSascha Hauer2016-07-221-13/+15
| | | | | | | | | | | | | | | | It's convenient to set/remove multiple nv variables in one go. With this patch we iterate over the remaining nonopts instead of expecting exactly one nonopt. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nv: Add option to explicitly save nv variablesSascha Hauer2016-07-221-4/+11
| | | | | | | | | | | | | | | | | | We now have code to save the nv variables without saving the rest of the environment. This gives us the possibility to explicitly save the nv variables. This patch adds an option to the 'nv' command for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/boot'Sascha Hauer2016-08-033-390/+28
|\ \
| * | boot: Print a message when a boot target string does not lead to a boot targetSascha Hauer2016-07-261-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | When doing a 'boot friesel net' one expects a message when 'friesel' does not give any bootable results and thus 'net' is booted. This patch adds this message. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | boot command: Explicitly complain when boot target list is emptySascha Hauer2016-07-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | When no targets to boot are found it can happen that the boot command just returns silently. Explicitly print a message in this case to give a clue what might went wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | boot: Move code to common/Sascha Hauer2016-07-262-327/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally code in commands/ shall only do the option parsing whereas the functionality shall be in common/ to make the code usable from C aswell. Do this in the boot code aswell, move it to common/boot.c and add the function prototypes to include/boot.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | boot: Use struct bootentries to pass around dataSascha Hauer2016-07-261-109/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have a struct bootentries type to collect different boot entries, so use this to pass around data between functions rather than using an array of strings. With this we also no longer have to convert a string to a boot entry multiple times. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootentries: Move menu display string allocation to bootentries_alloc()Sascha Hauer2016-07-261-4/+3
| | | | | | | | | | | | | | | | | | | | | bootentries_alloc() is the place where the struct bootentries container is allocated, so allocate the menu entry there aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: separate bootentries from blspec entriesSascha Hauer2016-07-261-23/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | This completes the separation of the blspec code from the boot code. With this the boot code only handles generic boot entries of type struct bootentry which are embedded into the type (blspec/bootscript) specific structs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootentries: Add title/descriptionSascha Hauer2016-07-261-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have to special case blspec entries vs. boot scripts in the common boot code since we want to print different informations about them. This adds a 'title' and 'description' which can be filled in with different information by bootscripts and blspec entries and so we get rid of the special handling. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: factor out a struct bootentrySascha Hauer2016-07-261-14/+17
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blpec: rename struct lspec -> bootentriesSascha Hauer2016-07-261-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in common/boot.c collects the different boot entries in lists of type struct blspec, eventhough many of them may not be bootloader spec entries but for example boot scripts. This is the first step of separating the data structures from boot entries and bootloader spec: As struct blspec is merely a container for collecting boot entries We simply rename struct blspec to struct bootentries. No functional change. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The majority of the stuff currently in include/boot.h is about bootm code implemented common/bootm.c. To be more consistent move it to a new file include/bootm.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | boot: Call blspec_scan_directory() only on strings containing an absolute pathSascha Hauer2016-07-221-3/+6
| | | | | | | | | | | | | | | | | | Avoids an unnecessary "Nothing bootable found on..." warning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: Remove once/default handlingSascha Hauer2016-07-221-28/+5
| |/ | | | | | | | | | | | | | | This is widely unused and in the way of subsequent cleanups. If you are indeed using it please complain on the list, we'll find a solution to add it back in a different way. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / commands: fbtest: select IMAGE_RENDERERLucas Stach2016-07-251-0/+1
|/ | | | | | | 2D_PRIMITIVES needs IMAGE_RENDERER. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/video'Sascha Hauer2016-07-113-0/+211
|\
| * GUI: Add fbtest commandAndrey Smirnov2016-06-303-0/+211
| | | | | | | | | | | | | | | | Add 'fbtest' - a command to produce test patterns on a screen Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/ubi'Sascha Hauer2016-07-111-7/+112
|\ \
| * | commands: ubi: Add ubiupdatevol commandTeresa Remmet2016-06-281-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | Add ubiupdatevol command. This is to update static and dynamic volumes. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: ubimkvol: Add option for static volumesTeresa Remmet2016-06-281-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | Creating static volumes in barebox already works, only the option was missing. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2016-07-111-1/+1
|\ \ \ | |_|/ |/| |
| * | commands: menu: check return pointer properlyLucas Stach2016-07-071-1/+1
| |/ | | | | | | | | | | | | | | The called functions return error codes encoded in the pointer, so the NULL check will never be true. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / boot command: Make verbose/dryrun options work againSascha Hauer2016-06-291-2/+5
|/ | | | | | | | | | Fixes: bc94fb3 bootm: Initialize bootm_data defaults in single place bootm_data_init_defaults() must be called before filling in the values from the commandline options, otherwise the values will be overwritten in bootm_data_init_defaults(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/bootm'Sascha Hauer2016-06-142-100/+8
|\
| * bootm: Move magicvar descriptions to common/bootm.cSascha Hauer2016-05-111-10/+0
| | | | | | | | | | | | | | | | Now that the bootm code can be used without the command, we have to move the magicvar descriptions from the command code to the common bootm code aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bootm: Move bootm options to common/KconfigSascha Hauer2016-05-102-90/+8
| | | | | | | | | | | | | | | | | | | | | | | | bootm has a C API, so the bootm options have to depend on the option providing the bootm code (CONFIG_BOOTM), not on the option providing the command (CONFIG_CMD_BOOTM). Fixing the dependencies makes it possible to fully use bootm from C without enabling the bootm command support. This also removes the CMD_ prefix from the options which means we have to update the defconfigs aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: Add 'hwmon' commandAndrey Smirnov2016-05-183-0/+44
|/ | | | | | | | Add 'hwmon' command which allows to display the readings of all hardware monitoring sensors registered with Barebox. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ubiformat'Sascha Hauer2016-05-092-651/+37
|\
| * ubiformat: use default values for ubi_ver and image_seqSascha Hauer2016-04-261-2/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: ubiformat: move code to common/Sascha Hauer2016-04-262-641/+3
| | | | | | | | | | | | | | This is the final step to separate the ubiformat code from the command. With this the ubiformat code gains a C API. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: ubiformat: create separate function for ubiformatSascha Hauer2016-04-251-29/+54
| | | | | | | | | | | | | | Factor out the code out of the main function to a ubiformat function to separate the command code from the ubiformat functionality. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: ubiformat: Pass around context dataSascha Hauer2016-04-251-120/+121
| | | | | | | | | | | | | | Instead of using a static global context data struct, pass the data around. This is a first step to create a C API for ubiformat. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-05-091-6/+5
|\ \
| * | Kconfig: Create Kconfig symbol for NVVARSascha Hauer2016-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nvvar support not only needs globalvar, but also persistent environment storage. Add a separate default-y option which depends on ENV_HANDLING for this case. Make the option visible to let the user decide whether he wants to have this option and add a help text to make this decision easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Kconfig: Make ENV_HANDLING visibleSascha Hauer2016-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | ENV_HANDLING is usable even without explicit loadenv/saveenv command support. Instead of selecting this option from loadenv/saveenv, make this option visible. loadenv/saveenv can then depend on ENV_HANDLING rather than selecting it. This reduces Kconfig dependencies hassles. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Kconfig: Make GLOBALVAR visibleSascha Hauer2016-04-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently global environment variables are only enabled when the "global" command is enabled. In fact, they could be used even with the "global" command disabled, so make the GLOBALVAR option visible. While at it, add a help text for this option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/include-cleanup'Sascha Hauer2016-05-0924-86/+86
|\ \ \
| * | | commands: mmc_extcsd: Fix incorrect usage of sprintfAndrey Smirnov2016-04-281-33/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a number of places print_field_ge_v7() and print_field() function would call sprintf() without providing is with appropriate output buffer (str is initialized to NULL). Replace the sprintf() with basprintf() to fix that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | stdio: Replace FILE functions with filedescriptor functionsSascha Hauer2016-04-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have defined stdin, stdout and stderr as integer file descriptors, but normally they should be FILE *. Also fprintf, fputc and fputs take file descriptors instead of FILE *. As FILE * are inconvenient in the barebox environment replace the f* functions with the corresponding d* functions. dprintf is POSIX conform whereas dputc and dputs are barebox specific, but do not conflict with any stdc function. fgetc is unused and can be removed without replacing it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>