sys-boot/efibootmgr: Sync with gentoo

It's from gentoo commit 07fe570129474ddf1c240ce6f80cd57aa7f7471e.
This commit is contained in:
Krzesimir Nowak 2022-02-25 15:59:24 +01:00
parent 15105f14e7
commit 63472df287
8 changed files with 179 additions and 5 deletions

View File

@ -1,2 +1,4 @@
DIST efibootmgr-14.tar.bz2 34972 BLAKE2B 78490756c5fd449f4319b79e0818e9d80340bd487f57d0de34f79f48cc24eb7b9c7309b535d00efad4babd40904d4cfb085cca278170625a1e875961e423f5dd SHA512 97935f8752440ce236162e174ea3404e907ebddc5877d597a97813da76ad580689fc2e97044885fc860a12a473af7183242b6120e78e53243d35e569fb002baf
DIST efibootmgr-15.tar.bz2 35476 BLAKE2B 19b7c9ce51f3b930b2d59fa4a594c7a8bf5f1c7aa3224049e88cdafe82991799b1b719ec68c80131027f70c16bd19e38157f5d0bc7761843959410c667aa4070 SHA512 d9d9eef14d373d5da88141e8105f754fea4c039755ed0a0cb9b3c9c2bb285733ad930fd912df42075fe2cf750585699307b067f594d8e65269b3b8a5a00b1cd1
DIST efibootmgr-16.tar.bz2 36603 BLAKE2B 3d09a9d3c4ecd48010315fccae60ab408c0d08e9c734e86a944130ea03e038835fa08745819f5353efbbe36f5017be64faded4b625ef0a0b55d4ca0d612ef232 SHA512 936318c7163c07b716f89be3d830957d9db68ba1b059223f7ea3d9eafe0dbf1c91b9aee096f5aed70955c6052c3b8547295c0a47f17cdf43788259d87d1990b9
DIST efibootmgr-17.tar.gz 41643 BLAKE2B a1995a5df74766f762d2eb971fd6095edea8d0a498c9dd1100515866b40c38ae2f299aae51f12767850ec23fbe4709c2c7428dd48755fbec499669b69f6432c9 SHA512 10c7ad9a79f23dcd4708dc4f42701196af7aa11f5e9a6468ea51f7013d4caeba6c92527ba1304f6e3b2ef3b51b3b69ea1a30f81bb099a8aea49eeb30eb631e1d

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -11,7 +11,7 @@ SRC_URI="https://github.com/rhinstaller/efibootmgr/releases/download/${PV}/${P}.
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm64 ia64 x86"
KEYWORDS="amd64 ~arm ~arm64 ~ia64 x86"
IUSE=""
RDEPEND="sys-apps/pciutils

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -11,7 +11,7 @@ SRC_URI="https://github.com/rhinstaller/efibootmgr/releases/download/${PV}/${P}.
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm64 ~ia64 x86"
KEYWORDS="amd64 ~arm ~arm64 ~ia64 x86"
IUSE=""
RDEPEND="sys-apps/pciutils

View File

@ -0,0 +1,36 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit toolchain-funcs
DESCRIPTION="User-space application to modify the EFI boot manager"
HOMEPAGE="https://github.com/rhinstaller/efibootmgr"
SRC_URI="https://github.com/rhinstaller/efibootmgr/releases/download/${PV}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ~ia64 x86"
IUSE=""
RDEPEND="sys-apps/pciutils
>=sys-libs/efivar-25:="
DEPEND="
${RDEPEND}
virtual/pkgconfig
"
src_prepare() {
default
sed -i -e 's/-Werror //' Make.defaults || die
}
src_configure() {
tc-export CC
export EFIDIR="Gentoo"
}
src_compile() {
emake PKG_CONFIG="$(tc-getPKG_CONFIG)"
}

View File

@ -0,0 +1,40 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
DESCRIPTION="User-space application to modify the EFI boot manager"
HOMEPAGE="https://github.com/rhinstaller/efibootmgr"
SRC_URI="https://github.com/rhboot/efibootmgr/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ~ia64 ~riscv x86"
RDEPEND="
sys-apps/pciutils
>=sys-libs/efivar-37:=
"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}/${P}-fix-efivar-37-conflict.patch"
"${FILESDIR}/${P}-clang.patch"
)
src_prepare() {
default
sed -i 's/-Werror //' Make.defaults || die
}
src_configure() {
tc-export CC
export EFIDIR="Gentoo"
}
src_compile() {
emake PKG_CONFIG="$(tc-getPKG_CONFIG)"
}

View File

@ -0,0 +1,82 @@
From 97668ae0bce776a36ea2001dea63d376be8274ac Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 6 Mar 2019 13:08:33 -0500
Subject: [PATCH] Make sure PKGS= is propogated into the submake for "make
deps"
When we're doing make deps with "$(CC) -MF", gcc and clang have different
behavior, both broken in different ways, which we're hitting because of a
missing -I argument for libefivar's includes. On clang, when a header can't
be found, it emits a rule with the header as a prerequisite without a path,
such as efivar.h here:
efibootmgr.o: efibootmgr.c fix_coverity.h efivar.h efiboot.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/list.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/unparse_path.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efibootmgr.h \
error.h
Then the build that utilizes that rule will fail to find the
prerequisite and tell you something like:
make[1]: *** No rule to make target 'efivar.h', needed by 'efibootmgr.o'. Stop.
make[1]: Leaving directory '/home/pjones/devel/github.com/efibootmgr/master/src'
With gcc, when a header can't be found, it emits a rule without that header
as a prerequisite, as such (again with efivar.h):
efibootmgr.o: efibootmgr.c fix_coverity.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/list.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/unparse_path.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efibootmgr.h \
error.h
And then your build will fail if you haven't adjusted CFLAGS to tell it
where to find the header.
Both of these would be better just erroring, but at least gcc's doesn't
insert a *wrong* dependency.
This patch adds "PKGS=efivar efibootmgr popt" for all deps under src/.
Technically that's overkill, as efibootmgr itself doesn't need popt, but it
doesn't hurt anything to have the extra part there. The resulting
.efibootmgr.d file has the prerequisites expressed correctly:
efibootmgr.o: efibootmgr.c fix_coverity.h /usr/include/efivar/efivar.h \
/usr/include/efivar/efiboot.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/list.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/unparse_path.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \
/home/pjones/devel/github.com/efibootmgr/master/src/include/efibootmgr.h \
error.h
This fixes the issue described in github PR #96
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/Makefile b/src/Makefile
index 258bac1..32fa188 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -31,8 +31,13 @@ efibootdump : PKGS=efivar efiboot popt
efibootnext : $(call objects-of,$(EFIBOOTNEXT_SOURCES))
efibootnext : PKGS=efivar efiboot popt
+deps : PKGS=efivar efiboot popt
deps : $(ALL_SOURCES)
- $(MAKE) -f $(TOPDIR)/Make.deps deps SOURCES="$(ALL_SOURCES)" SUBDIR_CFLAGS="$(SUBDIR_CFLAGS)"
+ $(MAKE) -f $(TOPDIR)/Make.deps \
+ SOURCES="$(ALL_SOURCES)" \
+ SUBDIR_CFLAGS="$(SUBDIR_CFLAGS)" \
+ PKGS="$(PKGS)" \
+ deps
clean :
@rm -rfv *.o *.a *.so $(TARGETS)

View File

@ -0,0 +1,14 @@
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':

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>floppym@gentoo.org</email>