simpler to read
Signed-off-by: Andreas Fenkart
---
common/env_sf.c | 18 +-
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
index 6a1583ebec..9944602367 100644
--- a/common/env_sf.c
+++ b/common/env_sf.c
@@ -80,7 +80,7 @@ int
rebased patches on master
fixed compiled error in 1st patch (missing variable declaration)
compile tested all patches with travis
Andreas Fenkart (4):
env_sf: factor out prepare_flash_device
enf_sf: reuse setup_flash_device instead of open coding it
env_sf: re-order error handling in single
this makes it easier comparable to the double-buffered version
Signed-off-by: Andreas Fenkart
Reviewed-by: Simon Glass
---
common/env_sf.c | 20 +++-
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
index a52fb734c8..6a1583ebec
s not yet usable when relocating.
Signed-off-by: Andreas Fenkart
---
common/env_sf.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
index 8af590a3d9..a52fb734c8 100644
--- a/common/env_sf.c
+++ b/common/env_sf.c
@@ -176,12 +
copy&paste code found in single/double buffered code path
Signed-off-by: Andreas Fenkart
Reviewed-by: Simon Glass
---
common/env_sf.c | 48 +++-
1 file changed, 19 insertions(+), 29 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
i
Hi Max,
LGTM, see one nit below, can fixed later
On 11/19/2016 01:58 PM, Max Krummenacher wrote:
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
f
simpler, needs less thinking when reading the code
Signed-off-by: Andreas Fenkart
---
common/env_sf.c | 18 +-
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
index 8a3de63..0434bb8 100644
--- a/common/env_sf.c
+++ b/common
s not yet usable when relocating.
Signed-off-by: Andreas Fenkart
---
common/env_sf.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
index 5126762..ba9ac8a 100644
--- a/common/env_sf.c
+++ b/common/env_sf.c
@@ -175,12 +175,9 @@
this makes it easier comparable to the double-buffered version
Signed-off-by: Andreas Fenkart
---
common/env_sf.c | 20 +++-
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
index ba9ac8a..8a3de63 100644
--- a/common/env_sf.c
+++ b
copy&paste code found in single/double buffered code path
Signed-off-by: Andreas Fenkart
---
common/env_sf.c | 47 ++-
1 file changed, 18 insertions(+), 29 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c
index c53200f..5126762 10
Andreas Fenkart (4):
env_sf: factor out prepare_flash_device
enf_sf: reuse setup_flash_device instead of open coding it
env_sf: re-order error handling in single-buffer env_relocate_spec
env_sf: use DIV_ROUND_UP to calculate number of sectors to erase
common/env_sf.c | 91
2016-11-18 11:38 GMT+01:00 Max Krummenacher :
> 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 t
This allows to take advantage of the environment being block aligned.
This is not a new constraint. Writes always start at the begin of the
environment, since the header with CRC/length as there.
Every environment modification requires updating the header
Signed-off-by: Andreas Fenkart
flash_write_buf already looks up size/offset/#sector from struct
envdev_s. It can look up mtd_type as well. Same applies to
flash_read_buf. Makes the interface simpler
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 28 +---
1 file changed, 13 insertions(+), 15
the offset is not modified by linux ioctl call
see mtd_ioctl{drivers/mtd/mtdchar.c}
Makes the interface less ambiguous, since the caller can
now exclude a modification of blockstart
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 10 +-
1 file changed, 5 insertions(+), 5
instead of adhoc computation of the environment end,
use a function with a proper name
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 32 +++-
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index
Take advantage of the environment being block aligned
block alignment is enforced since 183923d3e4
Andreas Fenkart (6):
tools/env: factor out environment_end function
tools/env: pass bad block offset by value
tools/env: lookup dev_type directly from
flash_read_buf/flash_write_buf
: Andreas Fenkart
---
tools/env/fw_env.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index d2b167d..7cc7488 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1423,10 +1423,9 @@ static int parse_config(struct env_opts *opts
addon 183923d3e
MMC/SATA have no erase blocks, only blocks. Hence the warning
about erase block alignment might be confusing in such environment.
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/env/fw_env.c b/tools
The redundant environment patch was already submitted once,
but not applied due to a merge conflict.
The second patch is an addon to 183923d3e as suggested by Stefan Agner
Andreas Fenkart (2):
tools/env: return with error if redundant environments have unequal
size
tools/env: soften
it wasn't supported and due to reasons above I guess it was never
introduced.
I prefer to remove that (unused) feature in favor of simplicity
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 12
1 file changed, 12 insertions(+)
diff --git a/tools/env/fw_env.c b/tool
it wasn't supported and due to reasons above I guess it was never
introduced.
I prefer to remove that (unused) feature in favor of simplicity
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 12
1 file changed, 12 insertions(+)
diff --git a/tools/env/fw_env.c b/tool
Hi,
2016-07-14 2:14 GMT+02:00 Stefan Agner :
> From: Stefan Agner
>
> A negative value for the offset is treated as a backwards offset for
> from the end of the device/partition for block devices. This aligns
> the behavior of the config file with the syntax of CONFIG_ENV_OFFSET
> where the funct
es the code for further extension.
>
> Signed-off-by: Stefan Agner
Reviewed-by: Andreas Fenkart
> ---
>
> tools/env/fw_env.c | 110
> +
> 1 file changed, 60 insertions(+), 50 deletions(-)
>
> diff --git a/tools/env/f
Hi Simon,
I sent out a v2 of this series, you should have received by now. Some
comments in the context:
2016-07-09 16:39 GMT+02:00 Simon Glass :
> On 27 June 2016 at 16:06, Andreas Fenkart
> wrote:
[snip]
>> +/**
>> + * fw_printenv - print one or several environment variabl
Try to avoid adhoc iteration of the environment. Reuse fw_getenv
to find the variables that should be printed. Only use open-coded
iteration when printing all variables.
For backwards compatibility, keep emitting a newline when
printing with value_only.
Signed-off-by: Andreas Fenkart
---
tools
forward declaration not needed when re-ordered
Reviewed-by: Simon Glass
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 38 ++
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index fe479e9
various patches, see individual patch descriptions
Andreas Fenkart (4):
tools/env: return with error if redundant environments have unequal
size
tools/env: kernel-doc for fw_printenv, fw_getenv and fw_parse_script
tools/env: move envmatch further up in file to avoid forward
: Andreas Fenkart
---
tools/env/fw_env.c | 23 ---
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 692abda..b1c8217 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1382,18 +1382,19 @@ static int parse_config
those to modify several variables without creating a
temporary batch script file
tested with "./scripts/kernel-doc -html -v tools/env/fw_env.h"
Reviewed-by: Simon Glass
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 2 +-
tools/env/fw_e
those to modify several variables without creating a
temporary batch script file
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.h | 75 +-
1 file changed, 74 insertions(+), 1 deletion(-)
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
From: Andreas Fenkart
For double buffering to work, the target buffer must always be big
enough to hold all data. This can only be ensured if buffers are of
equal size, otherwise one must be smaller and we risk data loss
when copying from the bigger to the smaller buffer.
Signed-off-by: Andreas
Try to avoid adhoc iteration of the environment. Reuse fw_getenv
to find the variables that should be printed. Only use open-coded
iteration when printing all variables.
For backwards compatibility, keep emitting a newline when
printing with noheader.
Signed-off-by: Andreas Fenkart
---
tools
From: Andreas Fenkart
forward declaration not needed when re-ordered
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 38 ++
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index b1c8217
various patches, see individual patch descriptions
Andreas Fenkart (4):
tools/env: return with error if redundant environments have unequal
size
tools/env: javadoc for fw_printenv, fw_getenv and fw_parse_script
tools/env: move envmatch further up in file to avoid forward
Hi,
I faced the same problem a while back, thanks for taking a look at this.
Does it have to be compiled in? Why not make it a command line option,
evtl. making the default a compile time option.
/Andi
2016-06-02 10:27 GMT+02:00 Dirk Eibach :
> Hi Anatolij,
>
> 2016-06-02 10:14 GMT+02:00 Anatoli
2016 at 12:43:51PM +0200, Andreas Fenkart wrote:
>>
>> > For double buffering to work, the target buffer must always be big
>> > enough to hold all data. This can only be ensured if buffers are of
>> > equal size, otherwise one must be smaller and we risk data loss
&
If users of the library are happy with the default, e.g. config file
name. They can pass NULL as the opts pointer. This simplifies the
transition of existing library users.
FIXES a compile error. since common_args has been removed by
a previous patch
Signed-off-by: Andreas Fenkart
---
tools/env
For double buffering to work, the target buffer must always be big
enough to hold all data. This can only be ensured if buffers are of
equal size, otherwise one must be smaller and we risk data loss
when copying from the bigger to the smaller.
Signed-off-by: Andreas Fenkart
---
tools/env
for double buffering to work, redundant buffers must have equal size
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 32 ++--
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 1420855..15df5ad 100644
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 6 +++---
tools/env/fw_env.h | 4 ++--
tools/env/fw_env_main.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index e5b2e8f..1420855 100644
--- a/tools/env/fw_env.c
u-boot tools can be built as a library (libubootenv.a). Passing arguments
to the library using global structures is a bad interface.
v2:
- fix env_aes_cbc_crypt prototype
- check opts pointer for not NULL
Andreas Fenkart (5):
tools/env: pass key as argument to env_aes_cbc_crypt
tools/env
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 1420ac5..e5b2e8f 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -106,7 +106,7 @@ static struct
checkpatch complains about in succeding patch. Prefer to fix all
declarations in a dedicated patch.
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.h | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index 57149e7
checkpatch complains about in succeding patch. Prefer to fix all
declarations in a dedicated patch.
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.h | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index 57149e7
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 6 +++---
tools/env/fw_env.h | 4 ++--
tools/env/fw_env_main.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index c362a41..bd218cb 100644
--- a/tools/env/fw_env.c
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 50 +++--
tools/env/fw_env.h | 25 +++--
tools/env/fw_env_main.c | 28 +--
3 files changed, 48 insertions(+), 55 deletions(-)
diff --git a
for double buffering to work, redundant buffers must have equal size
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 32 ++--
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index bd218cb..3525563 100644
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 17 +++--
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 1420ac5..c362a41 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -106,7 +106,8 @@ static struct
u-boot tools can be built as a library (ibubootenv.a). Passing arguments
to the library using global structures is not a good interface.
Andreas Fenkart (5):
tools/env: make env_aes_cbc_crypt re-entrant
tools/env: remove 'extern' from function prototype in fw_env.h
tools/env: f
HI Stefano,
I was not aware of the use case. I have sent out a simple patch that
moves the definition of the structs from fw_main_env.c to fw_env.c,
which should avoid the linking problem. Do you have test application
you could send me. I without doing the option parsing as done in
fw_env_main, yo
fw_senten/fw_printenv can be compiled as a tools library,
excluding the fw_env_main object.
Reported-by: Stefano Babic
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 4
tools/env/fw_env_main.c | 4
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/env
fgets returns when the first '\n' is found
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 60574f2..5c7505c 100644
--- a/tools/env/fw_env.c
+++ b/tools/en
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 23 ++-
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 0a438a3..60574f2 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -133,14 +133,19 @@ static
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index bded9f6..0a438a3 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -141,12 +141,9 @@ static char
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index ee17a69..bded9f6 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -15,6 +15,7 @@
#include
#include
Andreas Fenkart (6):
tools: env: replace WHITESPACE macro by isblank
tools: env: fw_string_blank: return from loop when item found
tools: env: split fw_string_blank into skip_chars / skip_blanks
tools: env: fw_parse_script: simplify removal of newline/carriage
return
tools: env
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env_main.c | 117 +++-
1 file changed, 75 insertions(+), 42 deletions(-)
diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
index 39c8771..4bd4216 100644
--- a/tools/env/fw_env_main.c
+++ b
goal is to use getopt for all argument parsing instead of adhoc
parsing in fw_getenv/fw_setenv functions
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.h | 9
tools/env/fw_env_main.c | 113
2 files changed, 84 insertions(+), 38
disabled original parsing, but not yet removed since the
argument indexing needs to be fixed
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 64 ++---
tools/env/fw_env.h | 15
tools/env/fw_env_main.c | 31
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 54 ++---
tools/env/fw_env_main.c | 4
2 files changed, 15 insertions(+), 43 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 2cfff02..b1cf9ae 100644
--- a/tools
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env_main.c | 62 +
1 file changed, 37 insertions(+), 25 deletions(-)
diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
index daf4688..39c8771 100644
--- a/tools/env/fw_env_main.c
+++ b
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 22507f6..5b76b74 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -207,7 +207,7 @@ char *fw_getdefenv
place using getopt
and store the parsed flags in a global struct.
v3:
- rebased on top of master/8555dd8
- made emails in From:/Signed-off header match
Andreas Fenkart (7):
tools: env validate: pass values as 0-based array
tools: env: make parse_aes_key stateless
tools: env: introduce setenv
passing argv/argc can produce off-by-one errors
Signed-off-by: Andreas Fenkart
---
common/env_flags.c | 14 +++---
include/env_flags.h | 2 +-
tools/env/fw_env.c | 11 +++
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/common/env_flags.c b/common/env_flags.c
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env_main.c | 117 +++-
1 file changed, 75 insertions(+), 42 deletions(-)
diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
index e7ba95e..79273ce 100644
--- a/tools/env/fw_env_main.c
+++ b
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env_main.c | 63 +
1 file changed, 38 insertions(+), 25 deletions(-)
diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
index daf4688..e7ba95e 100644
--- a/tools/env/fw_env_main.c
+++ b
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 54 ++---
tools/env/fw_env_main.c | 4
2 files changed, 15 insertions(+), 43 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 2cfff02..b1cf9ae 100644
--- a/tools
disabled original parsing, but not yet removed since the
argument indexing needs to be fixed
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 64 ++---
tools/env/fw_env.h | 13 ++
tools/env/fw_env_main.c | 31
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 22507f6..5b76b74 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -207,7 +207,7 @@ char *fw_getdefenv
goal is to use getopt for all argument parsing instead of adhoc
parsing in fw_getenv/fw_setenv functions
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.h | 9
tools/env/fw_env_main.c | 113
2 files changed, 84 insertions(+), 38
passing argv/argc can produce off-by-one errors
Signed-off-by: Andreas Fenkart
---
common/env_flags.c | 14 +++---
include/env_flags.h | 2 +-
tools/env/fw_env.c | 11 +++
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/common/env_flags.c b/common/env_flags.c
store the parsed flags in a global struct.
v2:
- rebased on top of current master
Andreas Fenkart (7):
tools: env validate: pass values as 0-based array
tools: env: make parse_aes_key stateless
tools: env: introduce setenv/printenv argument structs
tools: env: parse aes key / suppress flag
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 40 +++-
tools/env/fw_env_main.c | 4
2 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 32bb3aa..a89bde5 100644
--- a/tools/env
goal is to use getopt for all argument parsing instead of adhoc
parsing in fw_getenv/fw_setenv functions
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.h | 9
tools/env/fw_env_main.c | 111 +++-
2 files changed, 81 insertions(+), 39
disabled original parsing, but not yet removed since the
argument indexing needs to be fixed
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 45 +
tools/env/fw_env.h | 12
tools/env/fw_env_main.c | 15 ---
3
Signed-off-by: Andreas Fenkart
---
tools/env/fw_env.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index bcf3756..f1dea8b 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -204,7 +204,7 @@ char *fw_getdefenv
nd is using adhoc parsing
where the order of arguments is important.
This patch will parse arguments only in one place using getopt
and store the parsed flags in a global struct.
Andreas Fenkart (5):
tools: env validate: pass values as 0-based array
tools: env: make parse_aes_key stateless
passing argv/argc can produce off-by-one errors
Signed-off-by: Andreas Fenkart
---
common/env_flags.c | 14 +++---
include/env_flags.h | 2 +-
tools/env/fw_env.c | 11 +++
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/common/env_flags.c b/common/env_flags.c
79 matches
Mail list logo