21 Dec, 2019
1 commit
-
In the case where one deletes an already-non-existing variable, or sets
a variable to the value it already has, there is no point in writing the
environment back, thus reducing wear on the underlying storage
device.In the case of redundant environments, if the two environments
differ (e.g. because one is corrupt), make sure that any call of
fw_setenv causes the two to become synchronized, even if the fw_setenv
call does not change anything in the good copy.Signed-off-by: Rasmus Villemoes
Acked-by: Joe Hershberger
03 Dec, 2019
1 commit
-
Drop inclusion of crc.h in common.h and use the correct header directly
instead.With this we can drop the conflicting definition in fw_env.h and rely on
the crc.h header, which is already included.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini
25 Sep, 2019
2 commits
-
The following error appears:
tools/env/fw_env.c:1149:25: error: lvalue required as unary ‘&’ operand
rc = write(fd, &ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE));Fixes: d3716dd ("env: Rename the redundancy flags")
Signed-off-by: Pierre-Jean Texier
Tested-by: Joris Offouga
Tested-by: Heiko Schocher
Suggested-by: Heiko Schocher
Acked-by: Joe Hershberger -
Since commit d3716dd ("env: Rename the redundancy flags"), the
definitions of ENV_REDUND_OBSOLETE & ENV_REDUND_ACTIVE was moved
to env.h.Fixes:
tools/env/fw_env.c:122:22: error: ‘ENV_REDUND_ACTIVE’ redeclared as different kind of symbol
static unsigned char ENV_REDUND_ACTIVE = 1;
^~~~~~~~~~~~~~~~~
In file included from tools/env/fw_env.c:13:
include/env.h:63:2: note: previous definition of ‘ENV_REDUND_ACTIVE’ was here
ENV_REDUND_ACTIVE = 1,
^~~~~~~~~~~~~~~~~
tools/env/fw_env.c:127:22: error: ‘ENV_REDUND_OBSOLETE’ redeclared as different kind of symbol
static unsigned char ENV_REDUND_OBSOLETE;
^~~~~~~~~~~~~~~~~~~
In file included from tools/env/fw_env.c:13:
include/env.h:62:2: note: previous definition of ‘ENV_REDUND_OBSOLETE’ was here
ENV_REDUND_OBSOLETE = 0,Signed-off-by: Pierre-Jean Texier
Tested-by: Joris Offouga
Tested-by: Heiko Schocher
Acked-by: Joe Hershberger
12 Aug, 2019
2 commits
-
Add an ENV prefix to these two flags so that it is clear what they relate
to. Also move them to env.h since they are part of the public API. Use an
enum rather than a #define to tie them together.Signed-off-by: Simon Glass
-
Move env_set() over to the new header file.
Acked-by: Joe Hershberger
Signed-off-by: Simon Glass
20 Jun, 2019
1 commit
-
If flash_write fails, whilst we propagate this up to our caller, we need
to avoid swapping in the new file (if we're on a filesystem) in this
case.Fixes: dbc34323796b ("tools: env: Implement atomic replace for filesystem")
Signed-off-by: Alex Kiernan
05 May, 2019
1 commit
-
Signed-off-by: Philip Molloy
27 Apr, 2019
1 commit
-
addr0 is being freed twice, leading to segmentation fault
Signed-off-by: Björn Stenberg
11 Sep, 2018
1 commit
-
On some systems the host system or even the cross sysroot can
contain a version.h. This leads to the wrong file being picked
up and a PLAIN_VERSION undefined error.This workaround symlinks the version.h into the tool folder to
allow reordering of search folders.Fixes
http://autobuild.buildroot.net/results/770/7702d5df36a6532aafdbe6e9e62709bbfa058b54/build-end.log
http://autobuild.buildroot.net/results/e34/e3401027d2fb3ce565ca9e2456a427afd3610a87/build-end.log
... additional can be found with these queries ...
http://autobuild.buildroot.net/?reason=uboot-tools-2018.03
http://autobuild.buildroot.net/?reason=uboot-tools-2018.05Upstream: pending
Signed-off-by: Matthew Weber
02 Jul, 2018
1 commit
-
As pointed out by Wolfgang Denk, the problem with this fix is that while
interactive users will see that we have found one part of the
environment failed and are using the other, progmatic use will not see
this and can lead to problems.Signed-off-by: Tom Rini
28 Jun, 2018
1 commit
-
When using a redundant environment a read error should simply mean to
not use that copy instead of giving up completely. The other copy may
be just fine.Signed-off-by: Joe Hershberger
Signed-off-by: Ioan-Adrian Ratiu
13 Jun, 2018
2 commits
-
's/environemnt/environment/' and
's/Environemnt/Environment/'Signed-off-by: Shyam Saini
-
When reading the config file, or a script file, use getline rather than
fgets so line lengths aren't limited by the size of a compiled in buffer
(128 characters for config, 1024 for scripts).Rename 'dump' to 'line' so it's clear we're working with a line of text.
Signed-off-by: Alex Kiernan
07 May, 2018
1 commit
-
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.Signed-off-by: Tom Rini
11 Apr, 2018
1 commit
-
Using sizeof gives the size of the pointer only, not the string. This
could easily lead to crashes when using -l argument.Signed-off-by: Kristian Amlie
20 Mar, 2018
4 commits
-
If the U-Boot environment is stored in a regular file and redundant
operation isn't set, then write to a temporary file and perform an
atomic rename.Signed-off-by: Alex Kiernan
-
Extract write path of flash_io() into a separate function. This patch
should be a functional no-op.Signed-off-by: Alex Kiernan
Reviewed-by: Stefano Babic -
Replace HaveRedundEnv with have_redund_env to fix style violation.
Signed-off-by: Alex Kiernan
-
Pass tools/env/fw_env.c through indent to correct style violations. This
commit consists of only one non-whitespace change:tools/env/fw_env.c:549: error: do not use assignment in if condition
Signed-off-by: Alex Kiernan
05 Mar, 2018
1 commit
-
Treat the first equal sign as a key/value separation too. This makes
the script files compatible with mkenvimage input file format. It
won't support variables with equal signs anymore, but this seems not
really like a loss.Signed-off-by: Stefan Agner
15 Feb, 2018
1 commit
-
The single argument `--noheader' is expecting isn't taken from getopt
parsing, but instead from the remaining argv arguments.Signed-off-by: Alex Kiernan
28 Jan, 2018
1 commit
-
Remove unused ret from fw_env_flush.
Signed-off-by: Jelle van der Waa
Reviewed-by: Simon Glass
30 Nov, 2017
1 commit
-
Up to now we were able to read/write environment data from/to UBI
volumes only indirectly by gluebi driver. This driver creates NAND MTD
on top of UBI volumes, which is quite a workaroung for this use case.Add support for direct read/write UBI volumes in order to not use
obsolete gluebi driver.Forward-ported from this patch:
http://patchwork.ozlabs.org/patch/619305/Original patch:
Signed-off-by: Marcin NiestrojForward port:
Signed-off-by: S. Lockwood-Childs
21 Nov, 2017
1 commit
-
This support has been deprecated since v2017.09 due to security issues.
We now remove this support.Signed-off-by: Tom Rini
06 Nov, 2017
1 commit
-
The fw_env utility family has a default environment compiled in
which ties it quite strongly to the U-Boot source/config it has
been built with. Allow to display the U-Boot version it has been
built with using the -v/--version argument.Signed-off-by: Stefan Agner
Reviewed-by: Lukasz Majewski
16 Oct, 2017
1 commit
-
Signed-off-by: Bin Meng
06 Sep, 2017
3 commits
-
The target is not currently mentioned anywhere. Add it to the help so
people can find it.Signed-off-by: Simon Glass
-
This was broken by the recent environment refactoring. Specifically:
$ make environ
scripts/Makefile.build:59: tools/environ/Makefile: No such file or directory
make[1]: *** No rule to make target 'tools/environ/Makefile'. Stop.
make: *** [Makefile:1469: environ] Error 2Fix this by updating the Makefile and adjusting the #include filesnames in
two C files.Fixes: ec74f5f (Makefile: Rename 'env' target to 'environ')
Reported-by: Måns Rullgård
Signed-off-by: Simon Glass -
With the move of environment code from common/ to env/ a number of
changes needed to be made to various make targets. We missed updating
some of the files required for out of tree builds of the tools. Correct
the 'environ' target to know that we need to work under tools/env/ still
(not tools/environ/) and then update the wrappers in env_attr.c and
env_flags.c to point to the new correct file.Reported-by: Peter Robinson
Tested-by: Peter Robinson
Signed-off-by: Tom Rini
04 Sep, 2017
1 commit
-
According to fsync specification [1] some special files (e.g., a pipe, FIFO,
or socket) don't support synchronization and return either EROFS or EINVAL.On the linux side the sys_fsync -> do_fsync() checks if the requested file
has f_op->fsync defined. If not it returns EINVAL [2].This commit prevents writing error messages for files (devices), which
do not support fsync().[1] - http://man7.org/linux/man-pages/man2/fsync.2.html
[2] - http://elixir.free-electrons.com/linux/v4.13-rc6/source/fs/sync.c#L183Signed-off-by: Lukasz Majewski
Acked-by: Michael Heimpold
16 Aug, 2017
1 commit
-
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass
23 Jul, 2017
1 commit
-
Closing a file descriptor does not guarantee that the data has been
successfully saved to disk, as the kernel might defer the write.Signed-off-by: Michael Heimpold
18 Apr, 2017
1 commit
-
If realloc fails we should release the old buffer.
Signed-off-by: Heinrich Schuchardt
Reviewed-by: Tom Rini
Reviewed-by: Simon Glass
13 Apr, 2017
4 commits
-
fw_env_open allocates buffers to store the environment, but these
buffers are never freed. This becomes quite nasty using the fw_ tools as
library, because each access to the environment (even just reading a
variable) generates a memory leak equal to the size of the environment.Fix this renaming fw_env_close() as fw_env_flush(), because the function
really flushes the environment from RAM to storage, and add a
fw_env_close function to free the allocated resources.Signed-off-by: Stefano Babic
-
Changes in the environment library are difficult to tracked by programs
using the library. Add simply an API version number that must be
increased each time when the API is changed.This can be detected and a program can work with different versions of
the library.Signed-off-by: Stefano Babic
-
Move U-Boot private data into a separate file. This
lets export fw_env.h to be used by external programs
that want to change the environment using the library
built in tools/env.Signed-off-by: Stefano Babic
-
aes.h is a too generic name if this file can
be exported and used by a program.
Rename it to avoid any conflicts with
other files (for example, from openSSL).Signed-off-by: Stefano Babic
15 Mar, 2017
1 commit
-
Richard reported U-Boot tools issues in OpenEmbedded/Yocto project.
OE needs to be able to change the default compiler. If we pass in
HOSTCC through the make command, it overwrites all HOSTCC instances,
including ones in tools/Makefile and tools/env/Makefile, which breaks
"make cross_tools" and "make env", respectively.Add "override" directives to avoid overriding HOSTCC instances that
really need to point to the cross-compiler.Signed-off-by: Masahiro Yamada
Reported-by: Richard Purdie
Reviewed-by: Simon Glass
29 Nov, 2016
1 commit
-
commit 183923d3e412500bdc597d1745e2fb6f7f679ec7 enforces that the
environment must start at an erase block boundary.For block devices the sample fw_env.config does not mandate a erase block size
for block devices. A missing setting defaults to the full env size.Depending on the environment location the alignment check now errors out for
perfectly legal settings.Fix this by defaulting to the standard blocksize of 0x200 for environments
stored in a block device.
That keeps the fw_env.config files for block devices working even with that
new check.Signed-off-by: Max Krummenacher