Skip to contentSkip to conversation

env: fix build error for envtools

PATCH Superseded Pierre-Jean Texier 5 participants 16 messages Aug 26, 2019 – Sep 25, 2019

lore
Share & tools
lore
#0 lore raw

v2 cover 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(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/4 fw_env: remove duplicated definitions

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,

---
v1 -> v2:
- None

 tools/env/fw_env.c | 7 -------
 1 file changed, 7 deletions(-)
tools/env/fw_env.c +0 -7
index 95c9984..876bf2b 100644
@@ -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>
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/4 fw_env: remove duplicated definitions

Quoted 17 lines · Pierre-Jean Texier

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;
                      ^~~~~~~~~~~~~~~~~~~
Quoted 7 lines

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,

#3 lore raw

PATCH v2 1/4 fw_env: remove duplicated definitions

In reply to Pierre-Jean Texier
Quoted 16 lines · Pierre-Jean Texier

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;
                      ^~~~~~~~~~~~~~~~~~~
Quoted 8 lines

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,

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190925/b9ce6065/attachment.sig>
#4 lore raw

PATCH v2 2/4 fw_env: fix build error

In reply to 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")

---
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(-)
tools/env/fw_env.c +2 -1
index 876bf2b..e2801f5 100644
@@ -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");
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 2/4 fw_env: fix build error

Quoted 6 lines · 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));

Quoted 6 lines
Fixes d3716dd ("env: Rename the redundancy flags")
#6 lore raw

PATCH v2 2/4 fw_env: fix build error

In reply to Pierre-Jean Texier
Quoted 5 lines · 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));

Quoted 7 lines
Fixes d3716dd ("env: Rename the redundancy flags")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190925/1148e445/attachment.sig>
#7 lore raw

PATCH v2 3/4 env: add missing <compiler.h> header file

In reply to Pierre-Jean Texier

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);

---
v1 -> v2:
- None

 include/env.h | 1 +
 1 file changed, 1 insertion(+)
include/env.h +1 -0
index a74a261..b72239f 100644
@@ -9,6 +9,7 @@
 #ifndef __ENV_H
 #define __ENV_H
 
+#include <compiler.h>
 #include <stdbool.h>
 #include <linux/types.h>
 
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 3/4 env: add missing <compiler.h> header file

Quoted 15 lines · Pierre-Jean Texier

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);

Quoted 3 lines
#9 lore raw

PATCH v2 3/4 env: add missing <compiler.h> header file

In reply to Pierre-Jean Texier
Quoted 14 lines · Pierre-Jean Texier

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);

Quoted 4 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190925/38d4aa7c/attachment.sig>
#10 lore raw

PATCH v2 4/4 ci: add envtools support

In reply to Pierre-Jean Texier

This commit add envtools suppport to CI to verify if there is no build issues.

---
v1 -> v2:
- None

 .gitlab-ci.yml | 7 +++++++
 .travis.yml    | 4 ++++
 2 files changed, 11 insertions(+)
.gitlab-ci.yml +7 -0
index 84e79bf..a1c5b4f 100644
@@ -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
.travis.yml +4 -0
index d330dda..6adc754 100644
@@ -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"
Signature · 1 line
2.7.4
#12 lore raw

PATCH v2 4/4 ci: add envtools support

In reply to Pierre-Jean Texier
Quoted 6 lines · Pierre-Jean Texier

This commit add envtools suppport to CI to verify if there is no build issues.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190925/3ffbd035/attachment.sig>
#13 lore raw

v2 cover env: fix build error for envtools

In reply to Pierre-Jean Texier

Hello Tom,

Le 26/08/2019 à 13:06, Pierre-Jean Texier a écrit :

Quoted 18 lines

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

Quoted 6 lines
  .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

Signature · 3 lines
Pierre-Jean Texier
Embedded Linux Engineer
https://koncepto.io
#14 lore raw

v2 cover env: fix build error for envtools

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 :

Quoted 39 lines

Hello Tom,

Le 26/08/2019 à 13:06, Pierre-Jean Texier a écrit :

Quoted 18 lines

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

Quoted 6 lines

  .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

#15 lore raw

v2 cover env: fix build error for envtools

Quoted 9 lines · Joris Offouga

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!

Quoted 45 lines

Best Regards,

Joris Offouga

Le 16/09/2019 à 21:09, Pierre-Jean Texier a écrit :

Quoted 39 lines

Hello Tom,

Le 26/08/2019 à 13:06, Pierre-Jean Texier a écrit :

Quoted 18 lines

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

Quoted 6 lines

  .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

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190923/48a1d3ce/attachment.sig>