<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/tools/env, branch v2020.07</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>tools: fw_env: Fix warning when reading too little</title>
<updated>2020-06-02T17:06:14+00:00</updated>
<author>
<name>Harald Seiler</name>
<email>hws@denx.de</email>
</author>
<published>2020-05-28T15:54:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=50bb682c5cc52769e7cbd835a00dbcbc75a4f0e7'/>
<id>50bb682c5cc52769e7cbd835a00dbcbc75a4f0e7</id>
<content type='text'>
When using CONFIG_ENV_IS_IN_FAT and the config-file specifies a size
larger than what U-Boot wrote into the env-file, a confusing error
message is shown:

    $ fw_printenv
    Read error on /boot/uboot.env: Success

Fix this by showing a different error message when read returns too
little data.

Signed-off-by: Harald Seiler &lt;hws@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using CONFIG_ENV_IS_IN_FAT and the config-file specifies a size
larger than what U-Boot wrote into the env-file, a confusing error
message is shown:

    $ fw_printenv
    Read error on /boot/uboot.env: Success

Fix this by showing a different error message when read returns too
little data.

Signed-off-by: Harald Seiler &lt;hws@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env/fw_env.h: remove env.h</title>
<updated>2020-05-25T15:54:53+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@gmail.com</email>
</author>
<published>2020-05-21T21:22:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2aca8804d8d5f84d2d661e76e8d232c5c12445b5'/>
<id>2aca8804d8d5f84d2d661e76e8d232c5c12445b5</id>
<content type='text'>
As reported by Nicolas Carrier on the Buildroot mailing list [1],
there is a new build issue while building a program which interacts with
the u-boot environment. This program uses the headers of the ubootenv
library provided by uboot-tools.

This is a recent change from uboot [2] adding "#include &lt;env.h&gt;" to
fw_env.h. Adding env.h require a board configuration to build since
it also include compiler.h (and others uboot internal includes).

env.h include seems not needed since env_set() is not used in fw_env tool.

Nicolas removed env.h from fw_env tool and fixed it's build issue.

This problem is present since uboot v2019.10.

[1] http://lists.busybox.net/pipermail/buildroot/2020-April/280307.html
[2] https://gitlab.denx.de/u-boot/u-boot/-/commit/9fb625ce05539fe6876a59ce1dcadb76b33c6f6e

Reported-by: Nicolas Carrier &lt;nicolas.carrier@orolia.com&gt;
Signed-off-by: Romain Naour &lt;romain.naour@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As reported by Nicolas Carrier on the Buildroot mailing list [1],
there is a new build issue while building a program which interacts with
the u-boot environment. This program uses the headers of the ubootenv
library provided by uboot-tools.

This is a recent change from uboot [2] adding "#include &lt;env.h&gt;" to
fw_env.h. Adding env.h require a board configuration to build since
it also include compiler.h (and others uboot internal includes).

env.h include seems not needed since env_set() is not used in fw_env tool.

Nicolas removed env.h from fw_env tool and fixed it's build issue.

This problem is present since uboot v2019.10.

[1] http://lists.busybox.net/pipermail/buildroot/2020-April/280307.html
[2] https://gitlab.denx.de/u-boot/u-boot/-/commit/9fb625ce05539fe6876a59ce1dcadb76b33c6f6e

Reported-by: Nicolas Carrier &lt;nicolas.carrier@orolia.com&gt;
Signed-off-by: Romain Naour &lt;romain.naour@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: fw_env: use erasesize from MEMGETINFO ioctl</title>
<updated>2020-04-27T18:55:29+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>rasmus.villemoes@prevas.dk</email>
</author>
<published>2020-03-24T12:57:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e282c422e0b9a64dc53f7f1e55309639bc645f38'/>
<id>e282c422e0b9a64dc53f7f1e55309639bc645f38</id>
<content type='text'>
We have a board with several revisions. The older ones use a nor flash
with 64k erase size, while the newer have a flash with 4k sectors. The
environment size is 8k.

Currently, we have to put a column containing 0x10000 (64k) in
fw_env.config in order for it to work on the older boards. But that
ends up wasting quite a lot of time on the newer boards that could
just erase the 8k occupied by the environment - strace says the 64k
erase takes 0.405 seconds. With this patch, as expected, that's about
an 8-fold better, at 0.043 seconds.

Having different fw_env.config files for the different revisions is
highly impractical, and the correct information is already available
right at our fingertips. So use the erasesize returned by the
MEMGETINFO ioctl when the fourth and fifth columns (sector size and
#sectors, respectively) are absent or contain 0, a case where the
logic previously used to use the environment size as erase size (and
consequently computed ENVSECTORS(dev) as 1).

As I'm only testing this on a NOR flash, I'm only changing the logic
for that case, though I think it should be possible for the other
types as well.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a board with several revisions. The older ones use a nor flash
with 64k erase size, while the newer have a flash with 4k sectors. The
environment size is 8k.

Currently, we have to put a column containing 0x10000 (64k) in
fw_env.config in order for it to work on the older boards. But that
ends up wasting quite a lot of time on the newer boards that could
just erase the 8k occupied by the environment - strace says the 64k
erase takes 0.405 seconds. With this patch, as expected, that's about
an 8-fold better, at 0.043 seconds.

Having different fw_env.config files for the different revisions is
highly impractical, and the correct information is already available
right at our fingertips. So use the erasesize returned by the
MEMGETINFO ioctl when the fourth and fifth columns (sector size and
#sectors, respectively) are absent or contain 0, a case where the
logic previously used to use the environment size as erase size (and
consequently computed ENVSECTORS(dev) as 1).

As I'm only testing this on a NOR flash, I'm only changing the logic
for that case, though I think it should be possible for the other
types as well.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fw_setenv: avoid writing environment when nothing has changed</title>
<updated>2019-12-20T16:02:24+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>rasmus.villemoes@prevas.dk</email>
</author>
<published>2018-09-27T20:45:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c62e6142b95045621fc229d34f40bd8d0e41160a'/>
<id>c62e6142b95045621fc229d34f40bd8d0e41160a</id>
<content type='text'>
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 &lt;rasmus.villemoes@prevas.dk&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;rasmus.villemoes@prevas.dk&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crc32: Use the crc.h header for crc functions</title>
<updated>2019-12-02T23:23:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2019-11-14T19:57:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3db7110857524cf1b7d0a374c1ebcde8a2680de0'/>
<id>3db7110857524cf1b7d0a374c1ebcde8a2680de0</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fw_env: fix build error</title>
<updated>2019-09-24T21:46:13+00:00</updated>
<author>
<name>Pierre-Jean Texier</name>
<email>pjtexier@koncepto.io</email>
</author>
<published>2019-08-26T11:06:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7ce01c78dcd34b49c779467c33953c931bf7bf06'/>
<id>7ce01c78dcd34b49c779467c33953c931bf7bf06</id>
<content type='text'>
The following error appears:

tools/env/fw_env.c:1149:25: error: lvalue required as unary ‘&amp;’ operand
  rc = write(fd, &amp;ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE));

Fixes: d3716dd ("env: Rename the redundancy flags")

Signed-off-by: Pierre-Jean Texier &lt;pjtexier@koncepto.io&gt;
Tested-by: Joris Offouga &lt;offougajoris@gmail.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Suggested-by: Heiko Schocher &lt;hs@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following error appears:

tools/env/fw_env.c:1149:25: error: lvalue required as unary ‘&amp;’ operand
  rc = write(fd, &amp;ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE));

Fixes: d3716dd ("env: Rename the redundancy flags")

Signed-off-by: Pierre-Jean Texier &lt;pjtexier@koncepto.io&gt;
Tested-by: Joris Offouga &lt;offougajoris@gmail.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Suggested-by: Heiko Schocher &lt;hs@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fw_env: remove duplicated definitions</title>
<updated>2019-09-24T21:46:13+00:00</updated>
<author>
<name>Pierre-Jean Texier</name>
<email>pjtexier@koncepto.io</email>
</author>
<published>2019-08-26T11:06:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e184a3b4fd5809a03fa8a821137103bcbbda4cd0'/>
<id>e184a3b4fd5809a03fa8a821137103bcbbda4cd0</id>
<content type='text'>
Since commit d3716dd ("env: Rename the redundancy flags"), the
definitions of ENV_REDUND_OBSOLETE &amp; 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 &lt;pjtexier@koncepto.io&gt;
Tested-by: Joris Offouga &lt;offougajoris@gmail.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit d3716dd ("env: Rename the redundancy flags"), the
definitions of ENV_REDUND_OBSOLETE &amp; 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 &lt;pjtexier@koncepto.io&gt;
Tested-by: Joris Offouga &lt;offougajoris@gmail.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: Rename the redundancy flags</title>
<updated>2019-08-11T20:43:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2019-08-01T15:47:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d3716dd64bb8bb4c4ba2d19bac164d24ada72a68'/>
<id>d3716dd64bb8bb4c4ba2d19bac164d24ada72a68</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: Move env_set() to env.h</title>
<updated>2019-08-11T20:43:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2019-08-01T15:46:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9fb625ce05539fe6876a59ce1dcadb76b33c6f6e'/>
<id>9fb625ce05539fe6876a59ce1dcadb76b33c6f6e</id>
<content type='text'>
Move env_set() over to the new header file.

Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move env_set() over to the new header file.

Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fw_env: Add missing write failure check</title>
<updated>2019-06-20T14:57:08+00:00</updated>
<author>
<name>Alex Kiernan</name>
<email>alex.kiernan@gmail.com</email>
</author>
<published>2019-06-12T14:27:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a762311a6cf02396977f59babdf945c226f4404f'/>
<id>a762311a6cf02396977f59babdf945c226f4404f</id>
<content type='text'>
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 &lt;alex.kiernan@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;alex.kiernan@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
