[U-Boot] [PATCH 2/4] fw_env: fix build error

Pierre-Jean Texier pjtexier at koncepto.io
Mon Aug 26 10:54:26 UTC 2019


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 at 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 at 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 at 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


More information about the U-Boot mailing list