Hello Heiko,

Le 26/08/2019 à 10:59, Heiko Schocher a écrit :
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?

It works fine.

Thanks for testing !
I will send a v2 with your suggestion.

BR
Pierre-Jean

--
Pierre-Jean Texier
Embedded Linux Engineer
https://koncepto.io
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to