9
0
Fork 0
Commit Graph

29 Commits

Author SHA1 Message Date
Sascha Hauer 5ee4ad2229 environment variables: introduce new helpers
This introduces some new environment variable helpers and updates
the existing ones. Newly introduced are:

getenv_bool: read a bool variable
getenv_ul: read an unsigned long variable
getenev_uint: read an unsigned int variable
getenv_nonempty: like normal getenv, but does return NULL instead of an
                 empty string

All new helpers take a pointer to the value. This value is only modified
when the variable exists. This allows the following programming scheme:

	unsigned int myvalue = sanedefault;

	getenv_uint("myvalue", &myvalue);

So without checking the return value myvalue contains the best possible
value.

getenv_ull is updated to this scheme.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 10:28:52 +02:00
Sascha Hauer b381e781bf treewide include/: Add missing includes
This adds several missing includes to files under include/ which
we relied on being included implicitly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:32:59 +02:00
Sascha Hauer 4e6c5d5ff0 scripts: remove now unnecessary include
include/environment.h is no longer necessary to build scripts/bareboxenv,
so remove its inclusion.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:33:02 +01:00
Sascha Hauer 0c97dd0061 move prototypes for envfs_* to envfs.h
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>
2013-01-20 16:31:51 +01:00
Sascha Hauer 00df6b4637 make file_*_action static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:30:22 +01:00
Sascha Hauer 5531abd16d move struct action_data to the only file using it
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:30:22 +01:00
Sascha Hauer 1533521bff loadenv: allow more fine grained environment loading
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>
2012-11-29 20:23:04 +01:00
Sascha Hauer 856f60dbd1 Merge branch 'for-next/misc'
Conflicts:
	commands/Makefile

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-16 14:01:34 +01:00
Sascha Hauer 87feda4eb1 environment variables: use linux list
This switches environment variables to use linux list. This is easier
to read. An additional plus is that the environment variables no longer
need an initcall, so malloc is the only requirement for them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 10:24:12 +01:00
Sascha Hauer 06eebb1619 provide static inline function for export
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 10:57:13 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
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>
2012-09-17 10:57:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 487c34d859 environment: export_/getenv_ull as inline ifndef CONFIG_ENVIRONMENT_VARIABLES
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-11 09:36:30 +01:00
Sascha Hauer a94db01cdc introduce some env helpers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:55:50 +01:00
Sascha Hauer 9640c2b4a5 environment: make default env path configurable
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>
2011-04-12 09:54:56 +02:00
Sascha Hauer 71a4899e18 env: Make environment variable support optional
Environment variables are only useful in interactive environments.
Make it optional on our way to support a noninteractive barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 15:57:51 +02:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
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>
2009-12-15 10:18:30 +01:00
Juergen Beisert 8413d78ab3 separating environment commands, part 2
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
2007-11-12 16:28:23 +01:00
Juergen Beisert 2966bba216 separating environment commands, part 1
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
2007-11-12 16:28:23 +01:00
Sascha Hauer 71e2c11ebb introduce local and global variables, add export command 2007-09-23 23:29:37 +02:00
Sascha Hauer 6dd5fcd940 remove old functions from include/environment.h 2007-09-13 15:28:15 +02:00
Sascha Hauer fe2d505d4d svn_rev_481
make more char * const, fix compiler warnings
2007-07-05 18:01:58 +02:00
Sascha Hauer 10ab865b23 svn_rev_401 2007-07-05 18:01:50 +02:00
Sascha Hauer 478026955f svn_rev_321
move some functions away from common.h
2007-07-05 18:01:43 +02:00
Sascha Hauer b7c567e003 svn_rev_146
remove #ifdef CFG_ENV_* chaos
2007-07-05 18:01:27 +02:00
Stefan Roese d1a7254529 [PATCH] Select NAND embedded environment from board configuration
The current NAND Bootloader setup forces the environment
variables to be in line with the bootloader. This change
enables the configuration to be made in the board include
file instead so that it can be individually enabled.

Signed-off-by: Nick Spence <nick.spence@freescale.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2006-11-27 17:34:10 +01:00
Stefan Roese d12ae80889 Add NAND environment support for PPC440EPx Sequoia NAND boot config
Patch by Stefan Roese, 12 Sep 2006
2006-09-12 20:19:10 +02:00
Markus Klotzbuecher e443c944cf Support for redundant environment in NAND Flash. 2006-03-20 18:02:44 +01:00
wdenk 500545cc6b Fix problem with default #defines
Cleanup compiler warning
2003-03-06 14:23:06 +00:00
wdenk c609719b8d Initial revision 2002-11-03 00:24:07 +00:00