Skip to contentSkip to conversation

efivar: Upgrade to tip of trunk

PATCH Superseded Khem Raj 2 participants 2 messages Jun 12, 2023 – Jun 28, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 efivar: Upgrade to tip of trunk

Drop all the patches accepted upstream
Additional important changes it fixes build with lld linker

Following changes are brought over from trunk

* 90e88b2 Allow -a to create a non-existent variable
* 9306e0b Allow passing of hex values to -A
* 328f584 Allow overriding PKG_CONFIG
* cfd686d Revamp efi_well_known_* variable handling
* 914c686 Use off_t instead of off64_t
* dd901c1 Fix IPv4 and IPv6 Device Path printing
* c4138d0 efidp_ipv6_addr: fix gateway size
* bfe9a6b format_ipv6_addr_helper(): fix bad port-printing conditional
* 7c39722 format_ipv6_addr_helper: fix dp_type usage
* 9a5e710 File device paths: don't print "File(" or ")"
* bc65d63 Fix glibc 2.36 build (mount.h conflicts)
* 1f24726 LLD: fix detection and remove not needed workarounds
* 01de743 Set LC_ALL=C to force English output from ld
* 26ad685 Adjust dependency for libefivar and libefiboot objects
* ca48d39 src/Makefile: build util.c separately for makeguids
* b23aba1 Remove deprecated --add-needed linker flag
* 6be2cb1 Fix invalid free in main()
* df09b47 efisecdb: do not free optarg
* cece3ff efisecdb: fix build with musl libc
* aab4e9b Fix the -march issue for riscv64
* 15622b7 Avoid format error on i686
* 28789d1 Add extern "C" to headers for easier use by C++
* 197a087 Add -T workaround for GNU ld 2.36

---
 ...x-glibc-2.36-build-mount.h-conflicts.patch |  60 ------
 .../0001-Fix-invalid-free-in-main.patch       |  30 ---
 .../0001-Use-off_t-instead-of-off64_t.patch   |  39 ----
 ...uild-util.c-separately-for-makeguids.patch |  38 ----
 .../efisecdb-fix-build-with-musl-libc.patch   | 184 ------------------
 meta/recipes-bsp/efivar/efivar_38.bb          |   8 +-
 6 files changed, 2 insertions(+), 357 deletions(-)
 delete mode 100644 meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch
 delete mode 100644 meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch
 delete mode 100644 meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch
 delete mode 100644 meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch
 delete mode 100644 meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch
meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch deleted +0 -60
deleted file mode 100644
index 28dadabe6b3..00000000000
@@ -1,60 +0,0 @@
-From 7b0e7ba674321ec1ddd6b9cbb419e5fb44f88bb3 Mon Sep 17 00:00:00 2001
-From: Robbie Harwood <[email protected]>
-Date: Thu, 28 Jul 2022 16:11:24 -0400
-Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
-
-glibc has decided that sys/mount.h and linux/mount.h are no longer
-usable at the same time.  This broke the build, since linux/fs.h itself
-includes linux/mount.h.  For now, fix the build by only including
-sys/mount.h where we need it.
-
-See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
-Resolves: #227
-
-Upstream-Status: Backport [https://github.com/rhboot/efivar/commit/bc65d63ebf8fe6ac8a099ff15ca200986dba1565]
-Signed-off-by: Robbie Harwood <[email protected]>
----
- src/gpt.c   | 1 +
- src/linux.c | 1 +
- src/util.h  | 1 -
- 3 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/gpt.c b/src/gpt.c
-index 1eda049..21413c3 100644
---- a/src/gpt.c
-+++ b/src/gpt.c
-@@ -17,6 +17,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/mount.h>
- #include <sys/param.h>
- #include <sys/stat.h>
- #include <sys/utsname.h>
-diff --git a/src/linux.c b/src/linux.c
-index 47e45ae..1780816 100644
---- a/src/linux.c
-+++ b/src/linux.c
-@@ -20,6 +20,7 @@
- #include <stdbool.h>
- #include <stdio.h>
- #include <sys/ioctl.h>
-+#include <sys/mount.h>
- #include <sys/socket.h>
- #include <sys/sysmacros.h>
- #include <sys/types.h>
-diff --git a/src/util.h b/src/util.h
-index 3300666..1e67e44 100644
---- a/src/util.h
-+++ b/src/util.h
-@@ -23,7 +23,6 @@
- #include <stdio.h>
- #include <string.h>
- #include <sys/ioctl.h>
--#include <sys/mount.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <tgmath.h>
--- 
-2.37.1
-
meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch deleted +0 -30
deleted file mode 100644
index 7e63df578e2..00000000000
@@ -1,30 +0,0 @@
-From 085f027e9e9f1478f68ddda705f83b244ee3bd88 Mon Sep 17 00:00:00 2001
-From: Robbie Harwood <[email protected]>
-Date: Mon, 18 Apr 2022 13:08:18 -0400
-Subject: [PATCH] Fix invalid free in main()
-
-data is allocated by mmap() in prepare_data().
-
-Resolves: #173
-Signed-off-by: Robbie Harwood <[email protected]>
-Upstream-Status: Backport
-Link: https://github.com/rhboot/efivar/commit/6be2cb1c0139ac177e754b0767abf1ca1533847f
-Signed-off-by: Grygorii Tertychnyi <[email protected]>
-
----
- src/efivar.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/efivar.c b/src/efivar.c
-index 5cd1eb2bc73c..09f85edd0a38 100644
---- a/src/efivar.c
-+++ b/src/efivar.c
-@@ -633,7 +633,7 @@ int main(int argc, char *argv[])
- 				if (sz < 0)
- 					err(1, "Could not import data from \"%s\"", infile);
- 
--				free(data);
-+				munmap(data, data_size);
- 				data = NULL;
- 				data_size = 0;
- 
meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch deleted +0 -39
deleted file mode 100644
index f47a4573869..00000000000
@@ -1,39 +0,0 @@
-From 1eb0fa531301a5045af1b020fc093c4fcfd38680 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 14 Dec 2022 16:55:51 -0800
-Subject: [PATCH] Use off_t instead of off64_t
-
-Pass _FILE_OFFSET_BITS=64 to ensure 64bit off_t
-
-Upstream-Status: Submitted [https://github.com/rhboot/efivar/pull/237]
-Signed-off-by: Khem Raj <[email protected]>
----
- src/error.c             | 2 +-
- src/include/defaults.mk | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/error.c b/src/error.c
-index fcbba0d..9530e22 100644
---- a/src/error.c
-+++ b/src/error.c
-@@ -191,7 +191,7 @@ dbglog_write(void *cookie, const char *buf, size_t size)
- }
- 
- static int
--dbglog_seek(void *cookie UNUSED, off64_t *offset, int whence)
-+dbglog_seek(void *cookie UNUSED, off_t *offset, int whence)
- {
- 	FILE *log = efi_errlog ? efi_errlog : stderr;
- 	int rc;
-diff --git a/src/include/defaults.mk b/src/include/defaults.mk
-index 632b155..95be8be 100644
---- a/src/include/defaults.mk
-+++ b/src/include/defaults.mk
-@@ -34,6 +34,7 @@ CPPFLAGS ?=
- override _CPPFLAGS := $(CPPFLAGS)
- override CPPFLAGS = $(_CPPFLAGS) -DLIBEFIVAR_VERSION=$(VERSION) \
- 	    -D_GNU_SOURCE \
-+	    -D_FILE_OFFSET_BITS=64 \
- 	    -I$(TOPDIR)/src/include/
- CFLAGS ?= $(OPTIMIZE) $(DEBUGINFO) $(WARNINGS) $(ERRORS)
- CFLAGS_GCC ?= -specs=$(TOPDIR)/src/include/gcc.specs \
meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch deleted +0 -38
deleted file mode 100644
index 02781eb67db..00000000000
@@ -1,38 +0,0 @@
-From 80f11fcb46f6b52e13501cb323ca1a849c3f6e88 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Tue, 18 Jan 2022 11:53:41 +0100
-Subject: [PATCH] src/Makefile: build util.c separately for makeguids
-
-util.c needs to be built twice when cross-compiling:
-for the build machine to be able to link with
-makeguids which then runs during the same build,
-and then for the actual target.
-
-Upstream-Status: Submitted [https://github.com/rhboot/efivar/pull/203]
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- src/Makefile | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/src/Makefile b/src/Makefile
-index 0e423c4..b10051b 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -28,10 +28,13 @@ EFIVAR_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFIVAR_SOURCES)))
- EFISECDB_SOURCES = efisecdb.c guid-symbols.c secdb-dump.c util.c
- EFISECDB_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFISECDB_SOURCES)))
- GENERATED_SOURCES = include/efivar/efivar-guids.h guid-symbols.c
--MAKEGUIDS_SOURCES = makeguids.c util.c
-+MAKEGUIDS_SOURCES = makeguids.c util-makeguids.c
- MAKEGUIDS_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(MAKEGUIDS_SOURCES)))
- MAKEGUIDS_OUTPUT = $(GENERATED_SOURCES) guids.lds
- 
-+util-makeguids.c :
-+	cp util.c util-makeguids.c
-+
- ALL_SOURCES=$(LIBEFISEC_SOURCES) $(LIBEFIBOOT_SOURCES) $(LIBEFIVAR_SOURCES) \
- 	    $(MAKEGUIDS_SOURCES) $(GENERATED_SOURCES) $(EFIVAR_SOURCES) \
- 	    $(sort $(wildcard include/efivar/*.h))
--- 
-2.20.1
-
meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch deleted +0 -184

184 lines not on this page · raw message

meta/recipes-bsp/efivar/efivar_38.bb +2 -6
index 55233296995..87a1e665ca6 100644
@@ -9,13 +9,9 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
 
 SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \
            file://0001-docs-do-not-build-efisecdb-manpage.patch \
-           file://0001-src-Makefile-build-util.c-separately-for-makeguids.patch \
-           file://efisecdb-fix-build-with-musl-libc.patch \
-           file://0001-Fix-invalid-free-in-main.patch \
-           file://0001-Fix-glibc-2.36-build-mount.h-conflicts.patch \
-           file://0001-Use-off_t-instead-of-off64_t.patch \
            "
-SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93"
+SRCREV = "90e88b221e8bc60dc50f3246051369b8f580c0d0"
+PV .= "+39+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.41.0
#1 lore raw
Quoted 1 line · Khem Raj

+PV .= "+39+git${SRCPV}"

This broke upstream version check :(
"+39" isn't necessary here, "+git${SRCPV}" would have ensured monotonic increase from 38.

Alex