[U-Boot] [PATCH v2 0/4] env: fix build error for envtools

Here is a set of patches that fixes envtools breakage introduced after v2019.10-rc2.
This serie also adds envtools to travis CI and gitlab-ci.
This was tested on WaRP7.
Before this serie: - https://travis-ci.com/texierp/u-boot/jobs/227669967 After this serie: - https://travis-ci.com/texierp/u-boot/jobs/227761236
Pierre-Jean Texier (4): fw_env: remove duplicated definitions fw_env: fix build error env: add missing <compiler.h> header file ci: add envtools support
.gitlab-ci.yml | 7 +++++++ .travis.yml | 4 ++++ include/env.h | 1 + tools/env/fw_env.c | 10 ++-------- 4 files changed, 14 insertions(+), 8 deletions(-)

Since commit d3716dd ("env: Rename the redundancy flags"), the definitions of ENV_REDUND_OBSOLETE & 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 pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de --- v1 -> v2: - None
tools/env/fw_env.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 95c9984..876bf2b 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -119,13 +119,6 @@ static struct environment environment = {
static int have_redund_env;
-static unsigned char ENV_REDUND_ACTIVE = 1; -/* - * ENV_REDUND_OBSOLETE must be 0 to efficiently set it on NOR flash without - * erasing - */ -static unsigned char ENV_REDUND_OBSOLETE; - #define DEFAULT_ENV_INSTANCE_STATIC #include <env_default.h>

On Mon, Aug 26, 2019 at 6:08 AM Pierre-Jean Texier pjtexier@koncepto.io wrote:
Since commit d3716dd ("env: Rename the redundancy flags"), the definitions of ENV_REDUND_OBSOLETE & 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 pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de
Acked-by: Joe Hershberger joe.hershberger@ni.com

On Mon, Aug 26, 2019 at 01:06:15PM +0200, Pierre-Jean Texier wrote:
Since commit d3716dd ("env: Rename the redundancy flags"), the definitions of ENV_REDUND_OBSOLETE & 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 pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de Acked-by: Joe Hershberger joe.hershberger@ni.com
Applied to u-boot/master, thanks!

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 pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de Suggested-by: Heiko Schocher hs@denx.de --- v1 -> v2: - fix fw_setenv with flag_obsolete (reported by Heiko Schocher)
tools/env/fw_env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 876bf2b..e2801f5 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");

On Mon, Aug 26, 2019 at 6:08 AM Pierre-Jean Texier pjtexier@koncepto.io wrote:
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 pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de Suggested-by: Heiko Schocher hs@denx.de
Acked-by: Joe Hershberger joe.hershberger@ni.com

On Mon, Aug 26, 2019 at 01:06:16PM +0200, Pierre-Jean Texier wrote:
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 pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de Suggested-by: Heiko Schocher hs@denx.de Acked-by: Joe Hershberger joe.hershberger@ni.com
Applied to u-boot/master, thanks!

Since commit af95f20 ("env: Create a new file for environment functions"), a new header file exists.
So, this commit add a missing header file.
Fixes:
include/env.h:158:1: error: unknown type name ‘ulong’; did you mean ‘long’? ulong env_get_ulong(const char *name, int base, ulong default_val); ^~~~~ long include/env.h:158:49: error: unknown type name ‘ulong’; did you mean ‘long’? ulong env_get_ulong(const char *name, int base, ulong default_val);
Signed-off-by: Pierre-Jean Texier pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de --- v1 -> v2: - None
include/env.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/env.h b/include/env.h index a74a261..b72239f 100644 --- a/include/env.h +++ b/include/env.h @@ -9,6 +9,7 @@ #ifndef __ENV_H #define __ENV_H
+#include <compiler.h> #include <stdbool.h> #include <linux/types.h>

On Mon, Aug 26, 2019 at 6:08 AM Pierre-Jean Texier pjtexier@koncepto.io wrote:
Since commit af95f20 ("env: Create a new file for environment functions"), a new header file exists.
So, this commit add a missing header file.
Fixes:
include/env.h:158:1: error: unknown type name ‘ulong’; did you mean ‘long’? ulong env_get_ulong(const char *name, int base, ulong default_val); ^~~~~ long include/env.h:158:49: error: unknown type name ‘ulong’; did you mean ‘long’? ulong env_get_ulong(const char *name, int base, ulong default_val);
Signed-off-by: Pierre-Jean Texier pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de
Acked-by: Joe Hershberger joe.hershberger@ni.com

On Mon, Aug 26, 2019 at 01:06:17PM +0200, Pierre-Jean Texier wrote:
Since commit af95f20 ("env: Create a new file for environment functions"), a new header file exists.
So, this commit add a missing header file.
Fixes:
include/env.h:158:1: error: unknown type name ‘ulong’; did you mean ‘long’? ulong env_get_ulong(const char *name, int base, ulong default_val); ^~~~~ long include/env.h:158:49: error: unknown type name ‘ulong’; did you mean ‘long’? ulong env_get_ulong(const char *name, int base, ulong default_val);
Signed-off-by: Pierre-Jean Texier pjtexier@koncepto.io Tested-by: Joris Offouga offougajoris@gmail.com Tested-by: Heiko Schocher hs@denx.de Acked-by: Joe Hershberger joe.hershberger@ni.com
Applied to u-boot/master, thanks!

This commit add envtools suppport to CI to verify if there is no build issues.
Signed-off-by: Pierre-Jean Texier pjtexier@koncepto.io Acked-by: Heiko Schocher hs@denx.de --- v1 -> v2: - None
.gitlab-ci.yml | 7 +++++++ .travis.yml | 4 ++++ 2 files changed, 11 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 84e79bf..a1c5b4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -145,6 +145,13 @@ Build tools-only: script: - make tools-only_config tools-only -j$(nproc)
+# Ensure env tools build +Build envtools: + tags: [ 'all' ] + stage: testsuites + script: + - make tools-only_config envtools -j$(nproc) + Run binman, buildman, dtoc and patman testsuites: tags: [ 'all' ] stage: testsuites diff --git a/.travis.yml b/.travis.yml index d330dda..6adc754 100644 --- a/.travis.yml +++ b/.travis.yml @@ -361,6 +361,10 @@ matrix: - name: "Build tools-only" script: - make tools-only_config tools-only -j$(nproc) + # Ensure env tools build + - name: "Build envtools" + script: + - make tools-only_config envtools -j$(nproc)
# test/py - name: "test/py sandbox"

On Mon, 26 Aug 2019 at 05:06, Pierre-Jean Texier pjtexier@koncepto.io wrote:
This commit add envtools suppport to CI to verify if there is no build issues.
Signed-off-by: Pierre-Jean Texier pjtexier@koncepto.io Acked-by: Heiko Schocher hs@denx.de
v1 -> v2:
- None
.gitlab-ci.yml | 7 +++++++ .travis.yml | 4 ++++ 2 files changed, 11 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

On Mon, Aug 26, 2019 at 01:06:18PM +0200, Pierre-Jean Texier wrote:
This commit add envtools suppport to CI to verify if there is no build issues.
Signed-off-by: Pierre-Jean Texier pjtexier@koncepto.io Acked-by: Heiko Schocher hs@denx.de Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

Hello Tom,
Le 26/08/2019 à 13:06, Pierre-Jean Texier a écrit :
Here is a set of patches that fixes envtools breakage introduced after v2019.10-rc2.
This serie also adds envtools to travis CI and gitlab-ci.
This was tested on WaRP7.
Before this serie:
After this serie:
Pierre-Jean Texier (4): fw_env: remove duplicated definitions fw_env: fix build error env: add missing <compiler.h> header file ci: add envtools support
.gitlab-ci.yml | 7 +++++++ .travis.yml | 4 ++++ include/env.h | 1 + tools/env/fw_env.c | 10 ++-------- 4 files changed, 14 insertions(+), 8 deletions(-)
Gentle ping for this series: - http://patchwork.ozlabs.org/patch/1153103/ - http://patchwork.ozlabs.org/patch/1153106/ - http://patchwork.ozlabs.org/patch/1153105/ - http://patchwork.ozlabs.org/patch/1153104/
With this, envtools compiles again.
Thanks, Pierre-Jean

Hi Tom,
Can you consider the series of Pierre-Jean that fixes the build of envtools
Gentle ping for this series: - http://patchwork.ozlabs.org/patch/1153103/ - http://patchwork.ozlabs.org/patch/1153106/ - http://patchwork.ozlabs.org/patch/1153105/ - http://patchwork.ozlabs.org/patch/1153104/
Best Regards,
Joris Offouga
Le 16/09/2019 à 21:09, Pierre-Jean Texier a écrit :
Hello Tom,
Le 26/08/2019 à 13:06, Pierre-Jean Texier a écrit :
Here is a set of patches that fixes envtools breakage introduced after v2019.10-rc2.
This serie also adds envtools to travis CI and gitlab-ci.
This was tested on WaRP7.
Before this serie: - https://travis-ci.com/texierp/u-boot/jobs/227669967 After this serie: - https://travis-ci.com/texierp/u-boot/jobs/227761236
Pierre-Jean Texier (4): fw_env: remove duplicated definitions fw_env: fix build error env: add missing <compiler.h> header file ci: add envtools support
.gitlab-ci.yml | 7 +++++++ .travis.yml | 4 ++++ include/env.h | 1 + tools/env/fw_env.c | 10 ++-------- 4 files changed, 14 insertions(+), 8 deletions(-)
Gentle ping for this series: - http://patchwork.ozlabs.org/patch/1153103/ - http://patchwork.ozlabs.org/patch/1153106/ - http://patchwork.ozlabs.org/patch/1153105/ - http://patchwork.ozlabs.org/patch/1153104/
With this, envtools compiles again.
Thanks, Pierre-Jean

On Mon, Sep 23, 2019 at 11:09:08AM +0200, Joris Offouga wrote:
Hi Tom,
Can you consider the series of Pierre-Jean that fixes the build of envtools
Gentle ping for this series: - http://patchwork.ozlabs.org/patch/1153103/ - http://patchwork.ozlabs.org/patch/1153106/ - http://patchwork.ozlabs.org/patch/1153105/ - http://patchwork.ozlabs.org/patch/1153104/
Joe? Thanks!
Best Regards,
Joris Offouga
Le 16/09/2019 à 21:09, Pierre-Jean Texier a écrit :
Hello Tom,
Le 26/08/2019 à 13:06, Pierre-Jean Texier a écrit :
Here is a set of patches that fixes envtools breakage introduced after v2019.10-rc2.
This serie also adds envtools to travis CI and gitlab-ci.
This was tested on WaRP7.
Before this serie: - https://travis-ci.com/texierp/u-boot/jobs/227669967 After this serie: - https://travis-ci.com/texierp/u-boot/jobs/227761236
Pierre-Jean Texier (4): fw_env: remove duplicated definitions fw_env: fix build error env: add missing <compiler.h> header file ci: add envtools support
.gitlab-ci.yml | 7 +++++++ .travis.yml | 4 ++++ include/env.h | 1 + tools/env/fw_env.c | 10 ++-------- 4 files changed, 14 insertions(+), 8 deletions(-)
Gentle ping for this series: - http://patchwork.ozlabs.org/patch/1153103/ - http://patchwork.ozlabs.org/patch/1153106/ - http://patchwork.ozlabs.org/patch/1153105/ - http://patchwork.ozlabs.org/patch/1153104/
With this, envtools compiles again.
Thanks, Pierre-Jean
participants (5)
-
Joe Hershberger
-
Joris Offouga
-
Pierre-Jean Texier
-
Simon Glass
-
Tom Rini