summaryrefslogtreecommitdiff
path: root/tools/env
AgeCommit message (Collapse)Author
2013-10-14Coding Style cleanup: remove trailing white spaceWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-09-06fw_env: fix writing environment for mtd devicesOliver Metz
Signed-off-by: Oliver Metz <oliver@freetz.org> Tested-by: Luka Perkov <luka@openwrt.org>
2013-09-06fw_env: add redundant env support for MTD_ABSENTOliver Metz
Signed-off-by: Oliver Metz <oliver@freetz.org> Tested-by: Luka Perkov <luka@openwrt.org>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-04-11env: Add redundant env support to UBI envJoe Hershberger
Allow the user to specify two UBI volumes to use for the environment Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2013-04-11env: Add support for UBI environmentJoe Hershberger
UBI is a better place for the environment on NAND devices because it handles wear-leveling and bad blocks. Gluebi is needed in Linux to access the env as an MTD partition. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2013-03-11env: Allow accessing non-mtd devicesLubomir Rintel
In certain cases, memory device is present as flat file or block device (via mmc or mtdblock layer). Do not attempt MTD operations against it. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2013-03-11Fix a couple typoes in tools/env/READMERobert P. J. Day
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2013-02-19fw_env.config: Correct "fw_saveenv" to "fw_setenv".Robert P. J. Day
Fix a comment in the fw_env.config file, no functional change. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2012-12-20Revert "fw_env: fix building w/out a config.h"Tom Rini
I had missed Joe's NAK on this patch, so... This reverts commit 92ace272d06cec1d7f1533bb9edf914fb5845fba. Signed-off-by: Tom Rini <trini@ti.com>
2012-12-19fw_env: fix building w/out a config.hMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-19fw_env: fix incorrect usage of open(O_CREAT)Mike Frysinger
When using open(), the O_CREAT flag must be given a mode, otherwise it uses random garbage from the stack. Also, it can fail to build: In file included from /usr/include/fcntl.h:290:0, from fw_env_main.c:42: In function 'open', inlined from 'main' at fw_env_main.c:97:9: /usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-19fw_env: fix type of lenMike Frysinger
This variable is assigned by a size_t, and is printed that way, but is incorrectly declared as an int. Which means we get warnings: fw_env.c: In function 'fw_setenv': fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'int' [-Wformat] Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Handle write-once ethaddr and serial# genericallyJoe Hershberger
Use the variable access flags to implement the protection for ethaddr and serial# instead of hard-coding them. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13env: Add support for access control to .flagsJoe Hershberger
Add support for read-only, write-once, and change-default. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13tools/env: Add environment variable flags supportJoe Hershberger
Currently just validates variable types as decimal, hexidecimal, boolean, ip address, and mac address. Call env_acl_validate_setenv_params() from setenv() in fw_env.c. If the entry is not found in the env .flags, then look in the static one. This allows the env to override the static definitions, but prevents the need to have every definition in the environment distracting you. Need to build in _ctype for isdigit for Linux. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-19env: cosmetic: Consilidate the default env definitionJoe Hershberger
There used to be a huge structure duplicated 3 times in the source. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-16tools/env: Improve debug printsJoe Hershberger
Provide more information when using redundant environments Consistently print debug info to stderr Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-16tools/env: Fix variable delete operationJoe Hershberger
Fix crash introduced by a073d63a36524453a817ab029fad5b188f46127e when attempting to delete a variable. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15tools/env: Fix build failure from missing header includeJoe Hershberger
This was introduced in: 8679d0ffdcc0beafea8e6942c0c67cf859afa18e - COMMON: Use __stringify() instead of MK_STR() The header is now needed since common.h is not included in this tool. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15tools: Add a README note about fw_printenv lock fileJoe Hershberger
Add a mention of the lock file to the README for the fw_printenv tool. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Luka Perkov <uboot@lukaperkov.net>
2012-10-15env: Check for NULL pointer in envmatch()Joe Hershberger
If the pointer passed into envmatch() is NULL, return -1 instead of crashing. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15tools/env: Serialize calls to fw_*envJoe Hershberger
Use a lock file at /var/lock/fw_printenv.lock. Avoids seriously confusing the MTD driver. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15tools/env: Don't call env_init() in fw_getenv()Joe Hershberger
We will only call fw_getenv when the env has already been initialized. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15tools/env: Remove unneeded complexityJoe Hershberger
The length included the name length, and then it was subtracted back out on each use. Now we don't include it in the first place. Also realloc as we process arguments and eliminate memset. Use memcpy instead of manually copying each byte. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15tools/env: Use a board-specific default envJoe Hershberger
Originally added in aa701b94336b358798d676eef12a7b90bdac23f5 Before this patch, there was a hard-coded env that was used as default if the env in flash is detected as invalid. Now this tool (compiled for a given board) will share the default env with the u-boot for the board. Fix include of config.h Need to define "TEXT_BASE" when building the fw_env tool so that the default env will be correct for environments which use it. Define __ASSEMBLY__ when calling #include <config.h> so that we only get #defines (all we're interested in). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15COMMON: Use __stringify() instead of MK_STR()Marek Vasut
Kill multiple occurances and redeclaration of MK_STR in favor of __stringify(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
2012-09-18fw_env: Add env vars describing U-Boot target boardBenoît Thébaudeau
Commit 5e724ca did the same thing for env_common and env_embedded, but forgot fw_env. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
2012-06-21Strip fw_printenv like the other toolsLoïc Minier
Signed-off-by: Loïc Minier <lool@debian.org>
2012-02-11fw_env.h: fix commentFrans Meulenbroeks
made description according to implementation (where the config file is the default). Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2012-01-05tools/env: allow overwrite of ethaddr on defaultGrant Erickson
This patch allows the U-Boot user space companion utility, fw_setenv, to overwrite the 'ethaddr' key/value pair if the current value is set to a per-board-configured default. This change allows 'fw_setenv' to match the behavior of 'setenv' / 'env set' on the U-Boot command line. Signed-off-by: Grant Erickson <marathon96@gmail.com> Fixed excessive white space. Signed-off-by: Wolfgang Denk <wd@denx.de>
2012-01-05fw_env.h: added a few missing definesFrans Meulenbroeks
The README file lists 4 defined that were not actually present in the .h file but that were needed to get things working with settings compiled in. They are Added these to the .h file (the values above are the ones from the README file) Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2011-11-22tools/env: use lib/crc32.c directlyAndreas Bießmann
Instead of linking the file into $(obj) tree use directly the source file. This also prevents littered source tree if building not out-of-tree. Signed-off-by: Andreas Bießmann <biessmann@corscience.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22common: cosmetic: CONFIG_BOOTFILE checkpatch complianceJoe Hershberger
Remove MK_STR from places that consume CONFIG_BOOTFILE to force all definitions to be string literals. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22common: cosmetic: CONFIG_ROOTPATH checkpatch complianceJoe Hershberger
Remove MK_STR from places that consume CONFIG_ROOTPATH to force all definitions to be string literals. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22fix compile warning for env toolsLuka Perkov
Patch fixes this issue: fw_env.c: In function ‘fw_setenv’: fw_env.c:492:5: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat] fw_env.c: In function ‘flash_write_buf’: fw_env.c:806:6: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat] Signed-off-by: Luka Perkov <lists@lukaperkov.net> Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-06-22ARM: drop unsupported 'trab' boardWolfgang Denk
The 'trab' board configuration is broken, and there is nobody who is interested and willing to fix it. Drop it. This includes support for VFD displays which have always been used by this board only. Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-04-30tools/env: document current cross-compilation issues and workaroundLuca Ceresoli
Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it>
2011-04-21tools/env: fix redundant env flag comparisonJon Povey
This fixes two bugs with comparison of redundant environment flags on read. flag0 and flag1 in fw_env_open() were declared signed instead of unsigned char breaking BOOLEAN mode "== 0xFF" tests and in INCREMENTAL mode the wrong environment would be chosen where the flag values are 127 and 128 (either way round). With both flags over 128, both signs flipped and the logic worked by happy accident. Also there was a logic bug in the INCREMENTAL test (after signedness was fixed) in the case flag0=0, flag1=255, env 1 would be incorrectly chosen. Fix both of these. Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
2011-04-12Add support for dataflash to U-boot environment settings tool.Remy Bohmer
* The sector size for SPI-dataflash (like AT45 flashes) are not always a power-of-2. So, the sector calculations are rewritten such that it works for either power-of-2 as any size sectors. * Make the flash sector size optional in case it is the same value as the environment size. Signed-off-by: Remy Bohmer <linux@bohmer.net>
2010-11-27Coding Style (white space) cleanupWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-11-14tools/env: cleanup host build flagsDaniel Hobi
This patch makes tools/env/Makefile more similar to tools/imls: - define HOSTSRCS and HOSTCPPFLAGS, so that .depend generation works. - include U-Boot headers using -idirafter to prevent picking up u-boot/include/errno.h. - use HOSTCFLAGS_NOPED (fw_env.c does not conform to -pedantic). In order to cross-compile tools/env, override the HOSTCC variable as in this example: make tools env HOSTCC=bfin-uclinux-gcc Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch> Tested-by: Detlev Zundel <dzu@denx.de> Tested-by: Steve Sakoman <steve.sakoman@linaro.org>
2010-09-19tools/env: use host build flagsMike Frysinger
Convert the tools/env/Makefile to use the same host tool syntax as the other tool subdirs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-18tools/env: fail on invalid optionsDaniel Hobi
Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
2010-09-18tools/env: allow option "-n" for fw_printenvDaniel Hobi
In commit bd7b26f8 (Tools: set multiple variable with fw_setenv utility), the option parsing was changed to getopt_long(3), but option "-n" of fw_printenv was not included. This leads to an error message "invalid option -- 'n'" on stderr, although the output on stdout is correct. Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
2010-08-09tools/env/fw_printenv: Make redundant env work on locked flashes alsoDetlev Zundel
The invalidation of the old environment instance did not work for flashes supporting hardware locking. Now we unlock/lock around this update also. Signed-off-by: Detlev Zundel <dzu@denx.de>
2010-06-29Tools: set multiple variable with fw_setenv utilityStefano Babic
Add a sort of batch mode to fw_setenv, allowing to set multiple variables in one shot, without updating the flash after each set as now. It is added the possibility to pass a config file with a list of pairs <variable, value> to be set, separated by a TAB character. Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-04-13Rename lib_generic/ to lib/Peter Tyser
Now that the other architecture-specific lib directories have been moved out of the top-level directory there's not much reason to have the '_generic' suffix on the common lib directory. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2008-12-15Fix a typo in fw_env.configMartin Michlmayr
Reported-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>