Skip to contentSkip to conversation

package/efivar: bump to version 38

PATCH In review Erico Nunes 2 participants 5 messages Oct 4, 2022 – Oct 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 package/efivar: bump to version 38

Drop backported patches and rebase the ones that are still relevant.

From version 37 to 38, there is a new build system in place, which is still custom Makefiles.
This introduces a host-efivar package to account for the 'makeguids' tool. Previously it was not too cumbersome to work around building that tool for the host, but with the new build system it is increasingly coupled with the target build that the least hacky way to work around it is with a host package and a Makefile patch.

---
v2:
- separate host parts into a host-efivar build
- move cross-compilation workarounds into a patch

---
 .../efivar/0001-Allow-build-with-uClibc.patch |  12 +-
 ..._guid-handle-misaligned-guid-pointer.patch |  62 -------
 ...patch => 0002-gcc.specs-drop-Werror.patch} |  34 ++--
 ...es-Werror-address-of-packed-member-c.patch | 174 ------------------
 ...ar-isolate-makeguids-host-tool-build.patch |  48 +++++
 ...r-of-Werror-address-of-packed-member.patch |  57 ------
 .../0005-ucs2.h-remove-unused-variable.patch  |  35 ----
 ...-that-checks-for-UCS-2-string-termin.patch |  32 ----
 package/efivar/efivar.hash                    |   2 +-
 package/efivar/efivar.mk                      |  24 ++-
 10 files changed, 93 insertions(+), 387 deletions(-)
 delete mode 100644 package/efivar/0002-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
 rename package/efivar/{0007-gcc.specs-drop-Werror.patch => 0002-gcc.specs-drop-Werror.patch} (68%)
 delete mode 100644 package/efivar/0003-Fix-all-the-places-Werror-address-of-packed-member-c.patch
 create mode 100644 package/efivar/0003-efivar-isolate-makeguids-host-tool-build.patch
 delete mode 100644 package/efivar/0004-Fix-another-error-of-Werror-address-of-packed-member.patch
 delete mode 100644 package/efivar/0005-ucs2.h-remove-unused-variable.patch
 delete mode 100644 package/efivar/0006-ucs2.h-fix-logic-that-checks-for-UCS-2-string-termin.patch
package/efivar/0001-Allow-build-with-uClibc.patch +7 -5
index 0db9955760..0da80f26d2 100644
@@ -1,4 +1,4 @@
-From f1f24eb486c4376066884bae3c31f1c455a79836 Mon Sep 17 00:00:00 2001
+From bfd9cd9e603ef0d0e593d4432048bffc2acfeb7c Mon Sep 17 00:00:00 2001
 From: Andy Shevchenko <[email protected]>
 Date: Fri, 25 Nov 2016 19:42:27 +0200
 Subject: [PATCH] Allow build with uClibc
@@ -6,15 +6,17 @@ Subject: [PATCH] Allow build with uClibc
 Basically this replaces type definitions in <uchar.h>.
 
 Signed-off-by: Andy Shevchenko <[email protected]>
+[Erico: rebase to 38]
+Signed-off-by: Erico Nunes <[email protected]>
 ---
  src/export.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
 
 diff --git a/src/export.c b/src/export.c
-index 8321bd3..ef36add 100644
+index db5e637..21c5617 100644
 --- a/src/export.c
 +++ b/src/export.c
-@@ -23,10 +23,16 @@
+@@ -9,10 +9,16 @@
  #include <inttypes.h>
  #include <stdint.h>
  #include <stdlib.h>
@@ -29,9 +31,9 @@ index 8321bd3..ef36add 100644
 +#include <uchar.h>
 +#endif
 +
- #define EFIVAR_MAGIC 0xf3df1597
+ #define EFIVAR_MAGIC 0xf3df1597u
  
  #define ATTRS_UNSET 0xa5a5a5a5a5a5a5a5
 -- 
-2.20.1
+2.37.3
 
package/efivar/0002-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch deleted +0 -62

62 lines not on this page · raw message

package/efivar/0002-gcc.specs-drop-Werror.patch renamed from package/efivar/0007-gcc.specs-drop-Werror.patch +18 -16
similarity index 68%
rename from package/efivar/0007-gcc.specs-drop-Werror.patch
rename to package/efivar/0002-gcc.specs-drop-Werror.patch
index aa717fedaf..a25b844906 100644
@@ -1,4 +1,4 @@
-From 8d5cf3347cce9d644f670ffd1d48e71d74635481 Mon Sep 17 00:00:00 2001
+From a1d469753528a98aec971377a526619da5054b20 Mon Sep 17 00:00:00 2001
 From: Fabrice Fontaine <[email protected]>
 Date: Mon, 22 Mar 2021 07:52:34 +0100
 Subject: [PATCH] gcc.specs: drop -Werror
@@ -22,23 +22,25 @@ Signed-off-by: Fabrice Fontaine <[email protected]>
 [Upstream status: not upstreamable as Makefiles were reworked and a new
 ERRORS parameter was added:
 https://github.com/rhboot/efivar/commit/998f617cec92d526e1fadb745673ceef63fa1483]
+[Erico: rebase to 38]
+Signed-off-by: Erico Nunes <[email protected]>
 ---
- gcc.specs | 2 +-
+ src/include/defaults.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/gcc.specs b/gcc.specs
-index 45d43d1..1baf11a 100644
---- a/gcc.specs
-+++ b/gcc.specs
-@@ -2,7 +2,7 @@
- + -D_GNU_SOURCE
- 
- *efivar_cpp_options:
-- -Werror -Wall -std=gnu11 -Wextra
-+ -Wall -std=gnu11 -Wextra
- 
- *cpp_options:
- + %(efivar_cpp_options)
+diff --git a/src/include/defaults.mk b/src/include/defaults.mk
+index 632b155..2a9537a 100644
+--- a/src/include/defaults.mk
++++ b/src/include/defaults.mk
+@@ -29,7 +29,7 @@ WARNINGS_GCC ?=
+ WARNINGS_CCC_ANALYZER ?= $(WARNINGS_GCC)
+ WARNINGS ?= -Wall -Wextra $(call family,WARNINGS)
+ ERRORS_GCC ?=
+-ERRORS ?= -Werror $(call family,ERRORS)
++ERRORS ?= $(call family,ERRORS)
+ CPPFLAGS ?=
+ override _CPPFLAGS := $(CPPFLAGS)
+ override CPPFLAGS = $(_CPPFLAGS) -DLIBEFIVAR_VERSION=$(VERSION) \
 -- 
-2.30.1
+2.37.3
 
package/efivar/0003-Fix-all-the-places-Werror-address-of-packed-member-c.patch deleted +0 -174

174 lines not on this page · raw message

package/efivar/0003-efivar-isolate-makeguids-host-tool-build.patch new file +48 -0

48 lines not on this page · raw message

package/efivar/0004-Fix-another-error-of-Werror-address-of-packed-member.patch deleted +0 -57

57 lines not on this page · raw message

package/efivar/0005-ucs2.h-remove-unused-variable.patch deleted +0 -35
deleted file mode 100644
index a814043ce8..0000000000
@@ -1,35 +0,0 @@
-From fdb803402fb32fa6d020bac57a40c7efe4aabb7d Mon Sep 17 00:00:00 2001
-From: Javier Martinez Canillas <[email protected]>
-Date: Tue, 5 Mar 2019 17:23:24 +0100
-Subject: [PATCH] ucs2.h: remove unused variable
-
-The const uint16_t pointer is not used since now the two bytes of the
-UCS-2 chars are checked to know if is the termination of the string.
-
-Signed-off-by: Javier Martinez Canillas <[email protected]>
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- src/ucs2.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/ucs2.h b/src/ucs2.h
-index edd8367..e0390c3 100644
---- a/src/ucs2.h
-+++ b/src/ucs2.h
-@@ -26,12 +26,11 @@ static inline size_t UNUSED
- ucs2len(const void *vs, ssize_t limit)
- {
- 	ssize_t i;
--	const uint16_t *s = vs;
- 	const uint8_t *s8 = vs;
- 
- 	for (i = 0;
- 	     i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
--	     i++, s8 += 2, s++)
-+	     i++, s8 += 2)
- 		;
- 	return i;
- }
--- 
-2.20.1
-
package/efivar/0006-ucs2.h-fix-logic-that-checks-for-UCS-2-string-termin.patch deleted +0 -32
deleted file mode 100644
index 00b20332ef..0000000000
@@ -1,32 +0,0 @@
-From 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e Mon Sep 17 00:00:00 2001
-From: Javier Martinez Canillas <[email protected]>
-Date: Tue, 5 Mar 2019 17:23:32 +0100
-Subject: [PATCH] ucs2.h: fix logic that checks for UCS-2 string termination
-
-Currently the loop to count the lenght of the UCS-2 string ends if either
-of the two bytes are 0, but 0 is a valid value for UCS-2 character codes.
-
-So only break the loop when 0 is the value for both UCS-2 char bytes.
-
-Signed-off-by: Javier Martinez Canillas <[email protected]>
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- src/ucs2.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/ucs2.h b/src/ucs2.h
-index e0390c3..fd8b056 100644
---- a/src/ucs2.h
-+++ b/src/ucs2.h
-@@ -29,7 +29,7 @@ ucs2len(const void *vs, ssize_t limit)
- 	const uint8_t *s8 = vs;
- 
- 	for (i = 0;
--	     i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
-+	     i < (limit >= 0 ? limit : i+1) && !(s8[0] == 0 && s8[1] == 0);
- 	     i++, s8 += 2)
- 		;
- 	return i;
--- 
-2.20.1
-
package/efivar/efivar.hash +1 -1
index 132022bf67..827b46baa4 100644
@@ -1,3 +1,3 @@
 # locally computed hash
-sha256  74c52b4f479120fb6639e753e71163ba3f557a7a67c0be225593f9f05b253f36  efivar-37.tar.gz
+sha256  e3bbde37238bd47af1fcf270dc0ef1f4be030d86364c917b93669222ec52bbea  efivar-38.tar.gz
 sha256  91df770634adc2755e78cae33a0d01e702ce2f69046408ae93d0d934ff29691b  COPYING
package/efivar/efivar.mk +19 -5
index 8708057b18..8b1d338bec 100644
@@ -4,31 +4,44 @@
 #
 ################################################################################
 
-EFIVAR_VERSION = 37
+EFIVAR_VERSION = 38
 EFIVAR_SITE = $(call github,rhboot,efivar,$(EFIVAR_VERSION))
 EFIVAR_LICENSE = LGPL-2.1
 EFIVAR_LICENSE_FILES = COPYING
 EFIVAR_INSTALL_STAGING = YES
+EFIVAR_DEPENDENCIES = host-efivar
 
 # -fPIC is needed at least on MIPS, otherwise fails to build shared
 # -library.
+# SUBDIRS is redefined so it skips building docs.
+# LD_DASH_T is redefined as the linker detection does not seem to
+# work properly for cross-compilation.
 EFIVAR_MAKE_OPTS = \
 	libdir=/usr/lib \
-	LDFLAGS="$(TARGET_LDFLAGS) -fPIC"
+	LDFLAGS="$(TARGET_LDFLAGS) -fPIC" \
+	TOPDIR=$(@D) \
+	SUBDIRS=src \
+	LD_DASH_T=-T
 
-define EFIVAR_BUILD_CMDS
+define HOST_EFIVAR_BUILD_CMDS
 	# makeguids is an internal host tool and must be built separately with
 	# $(HOST_CC), otherwise it gets cross-built.
 	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
 		CFLAGS="$(HOST_CFLAGS) -std=gnu99" \
-		$(MAKE) -C $(@D)/src gcc_cflags=  makeguids
+		TOPDIR=$(@D) CFLAGS_GCC= \
+		$(MAKE) -C $(@D)/src makeguids
+endef
 
+define EFIVAR_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
-		AR=$(TARGET_AR) NM=$(TARGET_NM) RANLIB=$(TARGET_RANLIB) \
 		$(EFIVAR_MAKE_OPTS) \
 		all
 endef
 
+define HOST_EFIVAR_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/src/makeguids $(HOST_DIR)/usr/bin/makeguids
+endef
+
 define EFIVAR_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
 		$(EFIVAR_MAKE_OPTS) \
@@ -44,3 +57,4 @@ define EFIVAR_INSTALL_TARGET_CMDS
 endef
 
 $(eval $(generic-package))
+$(eval $(host-generic-package))
Signature · 6 lines
2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v2 2/2 package/efibootmgr: bump to version 18

Drop patches which are already applied upstream.

---
v2:
- no changes, just resubmission due to the changes requested in efivar

---
 .../0001-Allow-build-with-uClibc.patch        | 40 -------------------
 .../efibootmgr/0002-remove-extra-decl.patch   | 28 -------------
 package/efibootmgr/efibootmgr.hash            |  2 +-
 package/efibootmgr/efibootmgr.mk              |  2 +-
 4 files changed, 2 insertions(+), 70 deletions(-)
 delete mode 100644 package/efibootmgr/0001-Allow-build-with-uClibc.patch
 delete mode 100644 package/efibootmgr/0002-remove-extra-decl.patch
package/efibootmgr/0001-Allow-build-with-uClibc.patch deleted +0 -40
deleted file mode 100644
index fd29233dc3..0000000000
@@ -1,40 +0,0 @@
-From bbfcc60497c326576bb23cb01d90115ef3cf6947 Mon Sep 17 00:00:00 2001
-From: Andy Shevchenko <[email protected]>
-Date: Fri, 25 Nov 2016 20:26:52 +0200
-Subject: [PATCH] Remove unneeded <uchar.h> include
-
-This fixes the build with uClibc.
-
-Signed-off-by: Andy Shevchenko <[email protected]>
----
- src/efibootdump.c | 1 -
- src/eficonman.c   | 1 -
- 2 files changed, 2 deletions(-)
-
-diff --git a/src/efibootdump.c b/src/efibootdump.c
-index 6ff8360..7c5a1c5 100644
---- a/src/efibootdump.c
-+++ b/src/efibootdump.c
-@@ -19,7 +19,6 @@
- #include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
--#include <uchar.h>
- #include <unistd.h>
- 
- #include "error.h"
-diff --git a/src/eficonman.c b/src/eficonman.c
-index 2c2be38..9bfae79 100644
---- a/src/eficonman.c
-+++ b/src/eficonman.c
-@@ -17,7 +17,6 @@
- #include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
--#include <uchar.h>
- #include <unistd.h>
- 
- #define  _(String) gettext (String)
--- 
-2.10.2
-
package/efibootmgr/0002-remove-extra-decl.patch deleted +0 -28
deleted file mode 100644
index f838d50a20..0000000000
@@ -1,28 +0,0 @@
-From 99b578501643377e0b1994b2a068b790d189d5ad Mon Sep 17 00:00:00 2001
-From: Peter Jones <[email protected]>
-Date: Wed, 13 Jun 2018 09:41:01 -0400
-Subject: [PATCH] remove extra decl
-
-Downloaded from upstream commit
-https://github.com/rhboot/efibootmgr/commit/99b578501643377e0b1994b2a068b790d189d5ad
-
-Signed-off-by: Peter Jones <[email protected]>
-Signed-off-by: Bernd Kuhls <[email protected]>
----
- src/efibootmgr.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/src/efibootmgr.c b/src/efibootmgr.c
-index de38f01..4e1a680 100644
---- a/src/efibootmgr.c
-+++ b/src/efibootmgr.c
-@@ -1536,9 +1536,6 @@ parse_opts(int argc, char **argv)
- 					       "invalid numeric value %s\n",
- 					       optarg);
- 			}
--                        /* XXX efivar-36 accidentally doesn't have a public
--                         * header for this */
--			extern int efi_set_verbose(int verbosity, FILE *errlog);
- 			efi_set_verbose(opts.verbose - 2, stderr);
- 			break;
- 		case 'V':
package/efibootmgr/efibootmgr.hash +1 -1
index fdbc9a2732..71a9826331 100644
@@ -1,3 +1,3 @@
 # locally computed hash
-sha256  22a95ebe0d5c9fb2915b3a100450f8f37484d1dbb8b296f55b343cc84f10397d  efibootmgr-17.tar.gz
+sha256  442867d12f8525034a404fc8af3036dba8e1fc970998af2486c3b940dfad0874  efibootmgr-18.tar.gz
 sha256  dcc100d4161cc0b7177545ab6e47216f84857cda3843847c792a25289852dcaa  COPYING
package/efibootmgr/efibootmgr.mk +1 -1
index 7e09b5f659..672a93c282 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-EFIBOOTMGR_VERSION = 17
+EFIBOOTMGR_VERSION = 18
 EFIBOOTMGR_SITE = $(call github,rhboot,efibootmgr,$(EFIBOOTMGR_VERSION))
 EFIBOOTMGR_LICENSE = GPL-2.0+
 EFIBOOTMGR_LICENSE_FILES = COPYING
Signature · 6 lines
2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Erico Nunes
Quoted 11 lines · On Tue, 4 Oct 2022 16:39:42 +0200 Erico Nunes <[email protected]> wrote:

Drop backported patches and rebase the ones that are still relevant.

From version 37 to 38, there is a new build system in place, which is still custom Makefiles.
This introduces a host-efivar package to account for the 'makeguids' tool. Previously it was not too cumbersome to work around building that tool for the host, but with the new build system it is increasingly coupled with the target build that the least hacky way to work around it is with a host package and a Makefile patch.

I've applied both, but I'm not super fan of the Buildroot-specific patch in efivar to not build makeguids. Would it be possible to work with the upstream efivar community to find a suitable solution to this issue?

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
Quoted 14 lines · Thomas Petazzoni
Quoted 10 lines · On Tue, 4 Oct 2022 16:39:42 +0200 Erico Nunes <[email protected]> wrote:

Drop backported patches and rebase the ones that are still relevant.

From version 37 to 38, there is a new build system in place, which is still custom Makefiles.
This introduces a host-efivar package to account for the 'makeguids' tool. Previously it was not too cumbersome to work around building that tool for the host, but with the new build system it is increasingly coupled with the target build that the least hacky way to work around it is with a host package and a Makefile patch.

Quoted 6 lines
Quoted 1 line

I've applied both, but I'm not super fan of the Buildroot-specific patch in efivar to not build makeguids. Would it be possible to work with the upstream efivar community to find a suitable solution to this issue?

Thanks.
I did check for related work in upstream and there are two relevant reports:
https://github.com/rhboot/efivar/issues/130 reports the makeguids issue in cross compilation. There is no solution proposal for it in its current state though.
One potential solution is to change the build to something less custom, like meson, then in https://github.com/rhboot/efivar/pull/216
there is a draft pull request to actually move it to meson. Assuming that gets in for the next efivar release, the Buildroot specific patch could be dropped by then.
I think what I can do at this point is test that locally to see if it addresses the major problem that we have with Buildroot for a future version bump and provide some feedback there.

Erico
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hello Erico,

Quoted 4 lines · On Fri, 7 Oct 2022 08:46:10 +0200 Erico Nunes <[email protected]> wrote:

I did check for related work in upstream and there are two relevant reports:
https://github.com/rhboot/efivar/issues/130 reports the makeguids issue in cross compilation. There is no solution proposal for it in its current state though.

Quoted 8 lines

One potential solution is to change the build to something less custom, like meson, then in https://github.com/rhboot/efivar/pull/216
there is a draft pull request to actually move it to meson. Assuming that gets in for the next efivar release, the Buildroot specific patch could be dropped by then.
I think what I can do at this point is test that locally to see if it addresses the major problem that we have with Buildroot for a future version bump and provide some feedback there.

Thanks for this work! Indeed, if a meson-based build system is in progress, it doesn't make sense to work on a better patch/solution for the existing hand-written build system. Let's wait for the meson-based build system to arrive.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot