efivar: update 37 -> 38

Drop determinism.patch, resolved by
641a162654

Drop no-werror.patch, can now be replaced by ERRORS= in make invocation.

Add a patch to efibootmgr to address build failures with new version.

(From OE-Core rev: 60665cdd6b1bbed29b919328ab34827c055ed729)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2022-01-19 11:40:42 +01:00
committed by Richard Purdie
parent 80a6e76eb4
commit 14e27297f4
7 changed files with 125 additions and 47 deletions

View File

@@ -0,0 +1,47 @@
From 07f080184d067c1ebc3fec1b53dd4a06d1a2566a Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 17 Jan 2022 23:24:34 +0100
Subject: [PATCH] src: make compatible with efivar 38
Upstream-Status: Backport
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
src/efibootdump.c | 2 +-
src/efibootmgr.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/efibootdump.c b/src/efibootdump.c
index eceffd6..09bd76e 100644
--- a/src/efibootdump.c
+++ b/src/efibootdump.c
@@ -69,7 +69,7 @@ print_boot_entry(efi_load_option *loadopt, size_t data_size)
text_path = alloca(text_path_len);
if (!text_path)
error(100, "Couldn't allocate memory");
- rc = efidp_format_device_path(text_path, text_path_len,
+ rc = efidp_format_device_path((unsigned char *)text_path, text_path_len,
dp, pathlen);
if (rc < 0) {
printf("<bad device path>");
diff --git a/src/efibootmgr.c b/src/efibootmgr.c
index 4e1a680..b77b1fb 100644
--- a/src/efibootmgr.c
+++ b/src/efibootmgr.c
@@ -949,7 +949,7 @@ show_vars(const char *prefix)
pathlen = efi_loadopt_pathlen(load_option,
boot->data_size);
dp = efi_loadopt_path(load_option, boot->data_size);
- rc = efidp_format_device_path(text_path, text_path_len,
+ rc = efidp_format_device_path((unsigned char *)text_path, text_path_len,
dp, pathlen);
if (rc < 0)
error(18, "Could not parse device path");
@@ -960,7 +960,7 @@ show_vars(const char *prefix)
if (!text_path)
error(19, "Could not parse device path");
- rc = efidp_format_device_path(text_path, text_path_len,
+ rc = efidp_format_device_path((unsigned char *)text_path, text_path_len,
dp, pathlen);
if (rc < 0)
error(20, "Could not parse device path");

View File

@@ -13,7 +13,8 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=master \
file://0001-remove-extra-decl.patch \
file://97668ae0bce776a36ea2001dea63d376be8274ac.patch \
"
file://0001-src-make-compatible-with-efivar-38.patch \
"
SRCREV = "e067160ecef8208e1944002e5d50b275733211fb"
S = "${WORKDIR}/git"
@@ -33,3 +34,6 @@ do_install () {
}
CLEANBROKEN = "1"
# https://github.com/rhboot/efivar/issues/202
COMPATIBLE_HOST:libc-musl = 'null'

View File

@@ -0,0 +1,26 @@
From f39a1481a9e465387901d52b07ae56dedcc3838b Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Sun, 16 Jan 2022 18:25:33 +0100
Subject: [PATCH] docs: do not build efisecdb manpage
It requires mandoc, which oe-core does not have.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
docs/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/Makefile b/docs/Makefile
index c9bf585..91a6078 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/src/include/version.mk
include $(TOPDIR)/src/include/rules.mk
include $(TOPDIR)/src/include/defaults.mk
-MAN1TARGETS = efisecdb.1 \
+MAN1TARGETS = \
efivar.1
MAN3TARGETS = efi_append_variable.3 \

View File

@@ -0,0 +1,38 @@
From 80f11fcb46f6b52e13501cb323ca1a849c3f6e88 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
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 <alex@linutronix.de>
---
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

View File

@@ -1,18 +0,0 @@
Fix reproducibility issue caused by unsorted wildcard expansion.
Upstream-Status: Pending
RP 2021/3/1
Index: git/src/Makefile
===================================================================
--- git.orig/src/Makefile
+++ git/src/Makefile
@@ -15,7 +15,7 @@ TARGETS=$(LIBTARGETS) $(BINTARGETS) $(PC
STATICTARGETS=$(STATICLIBTARGETS) $(STATICBINTARGETS)
LIBEFIBOOT_SOURCES = crc32.c creator.c disk.c gpt.c loadopt.c path-helpers.c \
- linux.c $(wildcard linux-*.c)
+ linux.c $(sort $(wildcard linux-*.c))
LIBEFIBOOT_OBJECTS = $(patsubst %.c,%.o,$(LIBEFIBOOT_SOURCES))
LIBEFIVAR_SOURCES = dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c \
efivarfs.c error.c export.c guid.c guids.S guid-symbols.c \

View File

@@ -1,18 +0,0 @@
Don't use -Werror because newer compilers introduce newer warnings.
Upstream-Status: Inappropriate [https://github.com/rhboot/efivar/issues/131]
Signed-off-by: Ross Burton <ross.burton@intel.com>
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)

View File

@@ -7,10 +7,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393"
COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=master;protocol=https \
file://determinism.patch \
file://no-werror.patch"
SRCREV = "c1d6b10e1ed4ba2be07f385eae5bceb694478a10"
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 \
"
SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93"
S = "${WORKDIR}/git"
@@ -22,12 +23,8 @@ export CCLD_FOR_BUILD = "${BUILD_CCLD}"
# enforce BFD.
LDFLAGS += "-fuse-ld=bfd"
do_compile:prepend() {
# Remove when https://github.com/rhboot/efivar/issues/130 is fixed
oe_runmake \
CFLAGS="${BUILD_CFLAGS}" \
LDFLAGS="${BUILD_LDFLAGS}" \
-C src makeguids
do_compile() {
oe_runmake ERRORS= HOST_CFLAGS="${BUILD_CFLAGS}" HOST_LDFLAGS="${BUILD_LDFLAGS}"
}
do_install() {
@@ -39,3 +36,5 @@ BBCLASSEXTEND = "native"
RRECOMMENDS:${PN}:class-target = "kernel-module-efivarfs"
CLEANBROKEN = "1"
# https://github.com/rhboot/efivar/issues/202
COMPATIBLE_HOST:libc-musl = 'null'