flags are not working because the .flags variable is not parsed when
wnvironment is loaded.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Reported-by: Lukasz Domowy <lukasz.odw39@gmail.com>
Reported-by: Uwe Schuster <uwe.schuster68@gmail.com>
Starting with glibc 2.28, include file sys/stat.h will have a
definition for struct statx, in which case include file linux/stat.h should be
avoided, in order to prevent a duplicate definition.
This commit fixes (if _GNU_SOURCE is defined):
/usr/include/linux/stat.h:56:8: error: redefinition of ‘struct statx_timestamp’
struct statx_timestamp {
^~~~~~~~~~~~~~~
Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
Since commit [1] in U-Boot, this is the file with the initial environment
delivered with the bootloader.
So, let's set this name as default.
tested with buildroot as follows:
1) # fw_printenv
Cannot read environment, using default
baudrate=115200
...
2) # fw_setenv foo bar
Cannot read environment, using default
3) # fw_printenv foo
foo=bar
[1] bdaa73a5b3 (diff-b67911656ef5d18c4ae36cb6741b7965)
Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
Tested-by: Joris Offouga <offougajoris@gmail.com>
This commit fixes :
src/fw_printenv.c:142:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < argc; i++) {
Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
When fw_setenv calls function 'set_obsolete_flag' to set environment
flags from active to obsolete, the flags are addressed without an
offset from struct uboot_env_redund. Thus the redundant environment
flags are not updated, but the first byte of CRC32 is clean. The
redundant environment becomes invalid.
The issue is fixed by adding flags offset for setting obsolete flag.
Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Stefano Babic <sbabic@denx.de>
The fw_utils load environment variables from a persistent storage
(e.g. SPI flash) at first. If there is no valid environment in the
persistent storage, fw_utils accept a file which contains an initial
environment of U-Boot.
If no valid environment can be found from the persistent storage and
given file, fw_utils continue to work on an empty environment.
Specially, fw_setenv stores the environment to persistent storage.
This leads problem on booting.
This commit fixes the problem by making fw_utils return error in
case of no valid environment in persistent storage and given file.
Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Initial version, tested with the following backends:
- files
- NOR flash
- eMMC device
Environment in UBI volumes is not supported, environment in NAND is not
yet tested.
Signed-off-by: Stefano Babic <sbabic@denx.de>