Hello Pierre-Jean,

Am 26.08.2019 um 08:57 schrieb Heiko Schocher:
Hello Jean-Pierre,

Am 23.08.2019 um 23:03 schrieb Pierre-Jean Texier:
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 <pjtex...@koncepto.io>
---
  tools/env/fw_env.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

See the same problem, thanks for the Fix!

Tested-by: Heiko Schocher <h...@denx.de>

Testing deeper on an imx6 based board with Environment in SPI NOR, and
I see:

root@K30RF-5e108e:~# fw_setenv ubifitsz
Could not set obsolete flag: Operation not supported

Also with your patch ... :-(

With follwoing change fw_setenv works again for me:

hs@xmglap:u-boot  [k30rf] $ git diff
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index b8b936f9ea..e2801f595f 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1135,6 +1135,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t 
offset)
 {
        int rc;
        struct erase_info_user erase;
+       char tmp = ENV_REDUND_OBSOLETE;

        erase.start = DEVOFFSET(dev);
        erase.length = DEVESIZE(dev);
@@ -1146,7 +1147,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t 
offset)
                return rc;
        }
        ioctl(fd, MEMUNLOCK, &erase);
-       rc = write(fd, ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE));
+       rc = write(fd, &tmp, sizeof(tmp));
        ioctl(fd, MEMLOCK, &erase);
        if (rc < 0)
                perror("Could not set obsolete flag");
hs@xmglap:u-boot  [k30rf] $

May you can try?

bye,
Heiko
--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to