summaryrefslogtreecommitdiffstats
path: root/commands/loadenv.c
Commit message (Collapse)AuthorAgeFilesLines
* environment: Allow default env path to be NULLSascha Hauer2018-09-211-0/+4
| | | | | | | Several places assume that the default environment path cannot be NULL. Allow NULL here without crashing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadenv: Do not depend on normalise_path()Sascha Hauer2018-04-061-5/+1
| | | | | | normalise_path() will go away, so do without it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move unlink_recursive declaration to libfile.hSascha Hauer2016-04-151-0/+1
| | | | | | | unlink_recursive is a file utility function, so move the prototype to libfile.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadenv: fix typo in help textWjatscheslaw Stoljarski2015-02-021-2/+2
| | | | | Signed-off-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add support for non volatile variablesSascha Hauer2014-11-061-3/+8
| | | | | | | | | | | | | | | This adds (back) support for non volatile variables. Non volatile variables are variables which are stored in the environment over reboot. They are used in the same way as the global variables, but with a 'nv' command and device. The variables are stored under /env/nv/, one variable per file. Adding a nv variable automatically adds a global variable with the same name. Changing a nv variable also changes the same global variable, but not the other way round. This allows for example to configure the username as: nv user=sha; saveenv Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-261-9/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | | | | | | 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>
* loadenv: ignore -ENOENT when removing /envSascha Hauer2014-04-091-1/+1
| | | | | | | With the -s option loadenv first removes /env. Ignore it when this directory does not exist. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv: Allow multiple defaultenvironment overlaysSascha Hauer2014-02-281-7/+30
| | | | | | | | | | We can compile barebox for multiple boards at once, but currently they all share a single default environment. This patch adds a defaultenv_append() which boards can call to customize the default environment during runtime. Each board now generate default environment snippets using bbenv-y and add them during runtime with defaultenv_append() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* environment: Use accessor functions for default environment pathSascha Hauer2014-01-271-1/+1
| | | | | | | | | default_environment_path only exists when CONFIG_ENV_HANDLING is enabled. Boards would have to #ifdef this if they wanted to use default_environment_path. Use accessor functions instead which can be ifdeffed on a single place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move prototypes for envfs_* to envfs.hSascha Hauer2013-01-201-1/+1
| | | | | | | environment.h is for environment variables, not for the environment storage (envfs), so move the prototypes to envfs.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadenv: allow more fine grained environment loadingSascha Hauer2012-11-291-6/+47
| | | | | | | | | | | This implements two new options for the loadenv command: -s: removes (scrubs) old directory contents to be able to create a fresh environment from for example /dev/defaultenv -n: no overwrite. Do not overwrite existing files. This allows to keep parts of the old environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-1/+1
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* environment: make default env path configurableSascha Hauer2011-04-121-1/+1
| | | | | | | | Normally the default path to save the environment is /dev/env0. However, we can't map a file in a fat filesystem to /dev/env0. So if we want to store the environment in a file in fat we have to make it configurable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: unify documentation for 'loadenv'Robert Schwebel2010-11-021-20/+14
| | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove maxargsSascha Hauer2009-10-191-1/+0
| | | | | | | No need to check for maximum argument counts. The commands are safe to be called with more arguments, so lets safe some bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Subject: [PATCH] [general] Fixed constant strings in data section issueSascha Hauer2008-04-041-1/+1
| | | | | | | | For practical reasons I changed all string literals assumed to be constant to reside in .rodata subsection at end of .text section. Signed-off-by: Carsten Schlote <schlote@vahanus.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* separating environment commands, part 2Juergen Beisert2007-11-121-0/+71
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>