All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Jean Texier <pjtexier@koncepto.io>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] fw_env: fix build error
Date: Mon, 26 Aug 2019 12:54:26 +0200	[thread overview]
Message-ID: <52ec4096-35b0-6ebc-b769-e2541580eb61@koncepto.io> (raw)
In-Reply-To: <50cf07f6-5e4c-3982-f8f8-f2f2d3adf748@denx.de>

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

  reply	other threads:[~2019-08-26 10:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 21:03 [U-Boot] [PATCH 0/4] env: fix build error for envtools Pierre-Jean Texier
2019-08-23 21:03 ` [U-Boot] [PATCH 1/4] fw_env: remove duplicated definitions Pierre-Jean Texier
2019-08-24  8:50   ` Joris OFFOUGA
2019-08-26  6:56   ` Heiko Schocher
2019-09-03 22:35   ` Joe Hershberger
2019-08-23 21:03 ` [U-Boot] [PATCH 2/4] fw_env: fix build error Pierre-Jean Texier
2019-08-24  8:49   ` Joris OFFOUGA
2019-08-26  6:57   ` Heiko Schocher
2019-08-26  8:59     ` Heiko Schocher
2019-08-26 10:54       ` Pierre-Jean Texier [this message]
2019-08-23 21:03 ` [U-Boot] [PATCH 3/4] env: add missing <compiler.h> header file Pierre-Jean Texier
2019-08-24  8:50   ` Joris OFFOUGA
2019-08-26  6:57   ` Heiko Schocher
2019-08-23 21:03 ` [U-Boot] [PATCH 4/4] ci: add envtools support Pierre-Jean Texier
2019-08-26  6:58   ` Heiko Schocher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52ec4096-35b0-6ebc-b769-e2541580eb61@koncepto.io \
    --to=pjtexier@koncepto.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.