* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/, sys-boot/refind/files/
@ 2015-11-21 16:40 Amy Winston
0 siblings, 0 replies; 6+ messages in thread
From: Amy Winston @ 2015-11-21 16:40 UTC (permalink / raw
To: gentoo-commits
commit: c234da4aefefbd328315e5b3ed8b65450e378cf3
Author: Amy Winston <amynka <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 21 16:39:43 2015 +0000
Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
CommitDate: Sat Nov 21 16:39:43 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c234da4a
sys-boot/refind: version bump bug #566056 add sveyret to maintainers. By sveyret.
Package-Manager: portage-2.2.20.1
sys-boot/refind/Manifest | 1 +
.../files/0.10.0-refind-install-symlink.patch | 19 ++++
sys-boot/refind/metadata.xml | 23 ++++-
sys-boot/refind/refind-0.10.0.ebuild | 108 +++++++++++++++++++++
4 files changed, 148 insertions(+), 3 deletions(-)
diff --git a/sys-boot/refind/Manifest b/sys-boot/refind/Manifest
index 01fdfe6..c65dff5 100644
--- a/sys-boot/refind/Manifest
+++ b/sys-boot/refind/Manifest
@@ -1,2 +1,3 @@
+DIST refind-src-0.10.0.tar.gz 3336917 SHA256 845dc3a18d4c82c1e29d4dbef14a53f4de1401c5bb3ea10f3f39442efa870e2e SHA512 111caea0c1dbd9dde50e7b3cf47c7ad0d5e7f3bec3bb784397171950865cffd8cf589c6a1b821fabd6ed4be191a322757bf94255bfd449ee4a647ad597c3d7ab WHIRLPOOL 8e9070c89b83ff7e49b34c45f5f7d3ecd90824f8ba95eae4105636125500eafc29a7ae34a602cb268bd7bd4e90fe2a7e2a8bad4a9b68baa283a59d0a34ae1d1f
DIST refind-src-0.9.0.zip 2939724 SHA256 842a01d7964bc8c8000a66e6d08f6fadb4c257d251b1277cebff0bf731e024aa SHA512 c49e3110e6b9f8d44dadae1ab828d3bf59bbce2da9170efed73db961135144ae9963b57d4cc39af2b15ecdf1f289359bda56c3d3e8f72d05be165ae5a3e2654d WHIRLPOOL 225a6b84ea7044e8fe0bab5e268c8c46a4523ab6f408d1bb2a94adfe54afe80c9c83ec0dc104945b332ae6c375c9d041972dee39baa43665588eb0dfc1fe4362
DIST refind-src-0.9.2.zip 2941986 SHA256 9022da3d46493395c273e2d2fc555d1c786fb1b9c11b2912751a88fe3328212a SHA512 6636cf02bb69ffe699d5f9717d09b80db0e4330aa52c14949e8612caed11f032370db17700c15d285173729271d2434fd0fbc39f5b445a3c05255ee14d125d47 WHIRLPOOL 2d81427bf6cc9cf021a4ffc7238bcf914e380fea091cbefaa601e391cf28f43f7c3ef1181744e4aab3d71d2535d88ba633b13cdae696f0baddd26d3c2511a88d
diff --git a/sys-boot/refind/files/0.10.0-refind-install-symlink.patch b/sys-boot/refind/files/0.10.0-refind-install-symlink.patch
new file mode 100644
index 0000000..868bc86
--- /dev/null
+++ b/sys-boot/refind/files/0.10.0-refind-install-symlink.patch
@@ -0,0 +1,19 @@
+diff --git a/refind-install b/refind-install
+index 0f4accd..07f2b35 100755
+--- a/refind-install
++++ b/refind-install
+@@ -1168,7 +1168,13 @@ InstallOnLinux() {
+ # install under OS X or Linux, depending on the detected platform.
+ #
+ GetParams "$@"
+-ThisDir="$( cd -P "${BASH_SOURCE%/*}" && pwd )"
++ThisScript="${BASH_SOURCE[0]}"
++while [ -h "$ThisScript" ]; do
++ ThisDir="$( cd -P "$( dirname "$ThisScript" )" && pwd )"
++ ThisScript="$(readlink "$ThisScript")"
++ [[ $ThisScript != /* ]] && ThisScript="$ThisDir/$ThisScript"
++done
++ThisDir="$( cd -P "$( dirname "$ThisScript" )" && pwd )"
+ RefindDir="$ThisDir/refind"
+ if [[ $UID != 0 ]] ; then
+ echo "Not running as root; attempting to elevate privileges via sudo...."
diff --git a/sys-boot/refind/metadata.xml b/sys-boot/refind/metadata.xml
index dc440c1..2f602d1 100644
--- a/sys-boot/refind/metadata.xml
+++ b/sys-boot/refind/metadata.xml
@@ -7,15 +7,32 @@
<name>Sam Jorna</name>
<description>Proxy - Maintainer. Assign bugs to him</description>
</maintainer>
- <longdescription>EFI Boot Manager</longdescription>
- <use>
+ <maintainer>
+ <email>sveyret@gmail.com</email>
+ <name>Stephane Veyret</name>
+ <description>Proxy - Maintainer.CC on bugs</description>
+ </maintainer>
+ <longdescription lang="en">EFI Boot Manager</longdescription>
+ <longdescription lang="fr">Gestionnaire d'amorçage EFI</longdescription>
+ <use lang="en">
<flag name="ext2">Builds the EFI binary ext2 filesystem driver</flag>
<flag name="ext4">Builds the EFI binary ext4 filesystem driver</flag>
<flag name="reiserfs">Builds the EFI binary reiserfs filesystem driver</flag>
<flag name="iso9660">Builds the EFI binary iso9660 filesystem driver</flag>
<flag name="hfs">Builds the EFI binary hfs filesystem driver</flag>
- <flag name="btrfs"> Builds the EFI binary btrfs filesystem driver</flag>
+ <flag name="btrfs">Builds the EFI binary btrfs filesystem driver</flag>
<flag name="ntfs">Builds the EFI binary ntfs filesystem driver</flag>
+ <flag name="doc">Install document files</flag>
+ </use>
+ <use lang="fr">
+ <flag name="ext2">Construire le gestionnaire EFI pour le système de fichier ext2</flag>
+ <flag name="ext4">Construire le gestionnaire EFI pour le système de fichier ext4</flag>
+ <flag name="reiserfs">Construire le gestionnaire EFI pour le système de fichier reiserfs</flag>
+ <flag name="iso9660">Construire le gestionnaire EFI pour le système de fichier iso9660</flag>
+ <flag name="hfs">Construire le gestionnaire EFI pour le système de fichier hfs</flag>
+ <flag name="btrfs">Construire le gestionnaire EFI pour le système de fichier btrfs</flag>
+ <flag name="ntfs">Construire le gestionnaire EFI pour le système de fichier ntfs</flag>
+ <flag name="doc">Installer les fichiers de documentation</flag>
</use>
<upstream>
<remote-id type="sourceforge">refind</remote-id>
diff --git a/sys-boot/refind/refind-0.10.0.ebuild b/sys-boot/refind/refind-0.10.0.ebuild
new file mode 100644
index 0000000..21a6b01
--- /dev/null
+++ b/sys-boot/refind/refind-0.10.0.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="The rEFInd UEFI Boot Manager by Rod Smith"
+HOMEPAGE="http://www.rodsbooks.com/refind/"
+
+SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} doc"
+
+DEPEND=">=sys-boot/gnu-efi-3.0.2"
+
+DOCS="NEWS.txt README.txt docs/refind docs/Styles"
+
+pkg_setup() {
+ if use x86 ; then
+ export EFIARCH=ia32
+ export BUILDARCH=ia32
+ elif use amd64; then
+ export EFIARCH=x64
+ export BUILDARCH=x86_64
+ else
+ # Try to support anyway
+ export BUILDARCH=$( uname -m | sed s,i[3456789]86,ia32, )
+ if [[ ${BUILDARCH} == "x86_64" ]] ; then
+ export EFIARCH=x64
+ else
+ export EFIARCH=${ARCH}
+ fi
+ fi
+}
+
+src_prepare() {
+ # Make refind-install "symlink-proof"
+ epatch "${FILESDIR}/${PV}-refind-install-symlink.patch"
+}
+
+src_compile() {
+ # Make main EFI
+ all_target=gnuefi
+ emake ARCH=${BUILDARCH} ${all_target}
+
+ # Make filesystem drivers
+ export gnuefi_target="_gnuefi"
+ for fs in ${FS_USE}; do
+ fs=${fs#+}
+ if use "${fs}"; then
+ einfo "Building ${fs} filesystem driver"
+ rm -f "${S}/filesystems/fsw_efi.o"
+ emake -C "${S}/filesystems" ARCH=${BUILDARCH} ${fs}${gnuefi_target}
+ fi
+ done
+}
+
+src_install() {
+ exeinto "/usr/share/${P}"
+ doexe refind-install
+ dosym "/usr/share/${P}/refind-install" "/usr/sbin/refind-install"
+
+ dodoc "${S}"/{COPYING.txt,LICENSE.txt,CREDITS.txt}
+ if use doc; then
+ doman "${S}/docs/man/"*
+ dodoc -r ${DOCS}
+ fi
+
+ insinto "/usr/share/${P}/refind"
+ doins "${S}/refind/refind_${EFIARCH}.efi"
+ doins -r "${S}/drivers_${EFIARCH}"
+ doins "${S}/refind.conf-sample"
+ doins -r images icons fonts banners
+
+ insinto "/usr/share/${P}/refind/tools_${EFIARCH}"
+ doins "${S}/gptsync/gptsync_${EFIARCH}.efi"
+
+ insinto "/etc/refind.d"
+ doins -r "${S}/keys"
+
+ dosbin "${S}/mkrlconf"
+ dosbin "${S}/mvrefind"
+}
+
+pkg_postinst() {
+ elog "rEFInd has been built and installed into /usr/share/${P}"
+ elog "You will need to use the command 'refind-install' to install"
+ elog "the binaries into your EFI System Partition"
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ elog ""
+ elog "refind-install requires additional packages to be fully functional:"
+ elog " app-crypt/sbsigntool for binary signing for use with SecureBoot"
+ elog " sys-boot/efibootmgr for writing to NVRAM"
+ elog " sys-block/parted for automatic ESP location and mount"
+ elog ""
+ elog "A sample configuration can be found at"
+ elog "/usr/share/${P}/refind/refind.conf-sample"
+ else
+ ewarn "Note that this will not update any EFI binaries on your EFI"
+ ewarn "System Partition - this needs to be done manually."
+ fi
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/, sys-boot/refind/files/
@ 2017-05-15 5:13 Sam Jorna
0 siblings, 0 replies; 6+ messages in thread
From: Sam Jorna @ 2017-05-15 5:13 UTC (permalink / raw
To: gentoo-commits
commit: 7c4e72babf0b6675281208334313aba4c40dd914
Author: Sam Jorna <wraeth <AT> gentoo <DOT> org>
AuthorDate: Mon May 15 05:11:28 2017 +0000
Commit: Sam Jorna <wraeth <AT> gentoo <DOT> org>
CommitDate: Mon May 15 05:12:41 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c4e72ba
sys-boot/refind: fix build against gnu-efi-3.0.5
Adds upstream patch for building against gnu-efi-3.0.5 which added functions
causing namespace collisions.
Gentoo-Bug: 616668
Package-Manager: Portage-2.3.5, Repoman-2.3.2
.../refind-0.10.7-fix_build_gnuefi-3.0.5.patch | 1387 ++++++++++++++++++++
...efind-0.10.7.ebuild => refind-0.10.7-r1.ebuild} | 3 +
2 files changed, 1390 insertions(+)
diff --git a/sys-boot/refind/files/refind-0.10.7-fix_build_gnuefi-3.0.5.patch b/sys-boot/refind/files/refind-0.10.7-fix_build_gnuefi-3.0.5.patch
new file mode 100644
index 00000000000..5320241acb0
--- /dev/null
+++ b/sys-boot/refind/files/refind-0.10.7-fix_build_gnuefi-3.0.5.patch
@@ -0,0 +1,1387 @@
+diff --git a/EfiLib/DevicePath.c b/EfiLib/DevicePath.c
+index bfaf1c6..023ea3f 100644
+--- a/EfiLib/DevicePath.c
++++ b/EfiLib/DevicePath.c
+@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ CHAR16 *
+ EFIAPI
+-CatPrint (
++MyCatPrint (
+ IN OUT POOL_PRINT *Str,
+ IN CHAR16 *Fmt,
+ ...
+@@ -94,7 +94,7 @@ DevPathPci (
+ PCI_DEVICE_PATH *Pci;
+
+ Pci = DevPath;
+- CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);
++ MyCatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);
+ }
+
+ /**
+@@ -116,7 +116,7 @@ DevPathPccard (
+ PCCARD_DEVICE_PATH *Pccard;
+
+ Pccard = DevPath;
+- CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber);
++ MyCatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber);
+ }
+
+ /**
+@@ -138,7 +138,7 @@ DevPathMemMap (
+ MEMMAP_DEVICE_PATH *MemMap;
+
+ MemMap = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"MemMap(%d:%lx-%lx)",
+ (UINTN) MemMap->MemoryType,
+@@ -166,7 +166,7 @@ DevPathController (
+ CONTROLLER_DEVICE_PATH *Controller;
+
+ Controller = DevPath;
+- CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber);
++ MyCatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber);
+ }
+
+
+@@ -202,30 +202,30 @@ DevPathVendor (
+ Type = L"Msg";
+ /*
+ if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) {
+- CatPrint (Str, L"VenPcAnsi()");
++ MyCatPrint (Str, L"VenPcAnsi()");
+ return ;
+ } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) {
+- CatPrint (Str, L"VenVt100()");
++ MyCatPrint (Str, L"VenVt100()");
+ return ;
+ } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) {
+- CatPrint (Str, L"VenVt100Plus()");
++ MyCatPrint (Str, L"VenVt100Plus()");
+ return ;
+ } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {
+- CatPrint (Str, L"VenUft8()");
++ MyCatPrint (Str, L"VenUft8()");
+ return ;
+ } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) {
+ FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);
+ switch (FlowControlMap & 0x00000003) {
+ case 0:
+- CatPrint (Str, L"UartFlowCtrl(%s)", L"None");
++ MyCatPrint (Str, L"UartFlowCtrl(%s)", L"None");
+ break;
+
+ case 1:
+- CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware");
++ MyCatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware");
+ break;
+
+ case 2:
+- CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff");
++ MyCatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff");
+ break;
+
+ default:
+@@ -237,7 +237,7 @@ DevPathVendor (
+ } else
+ */
+ if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"SAS(%lx,%lx,%x,",
+ ((SAS_DEVICE_PATH *) Vendor)->SasAddress,
+@@ -246,9 +246,9 @@ DevPathVendor (
+ );
+ Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology);
+ if ((Info & 0x0f) == 0) {
+- CatPrint (Str, L"NoTopology,0,0,0,");
++ MyCatPrint (Str, L"NoTopology,0,0,0,");
+ } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) {
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"%s,%s,%s,",
+ ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",
+@@ -256,19 +256,19 @@ DevPathVendor (
+ ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"
+ );
+ if ((Info & 0x0f) == 1) {
+- CatPrint (Str, L"0,");
++ MyCatPrint (Str, L"0,");
+ } else {
+- CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff));
++ MyCatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff));
+ }
+ } else {
+- CatPrint (Str, L"0,0,0,0,");
++ MyCatPrint (Str, L"0,0,0,0,");
+ }
+
+- CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);
++ MyCatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);
+ return ;
+
+ } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) {
+- CatPrint (Str, L"DebugPort()");
++ MyCatPrint (Str, L"DebugPort()");
+ return ;
+ }
+ break;
+@@ -282,15 +282,15 @@ DevPathVendor (
+ break;
+ }
+
+- CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid);
++ MyCatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid);
+ DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH);
+ if (DataLength > 0) {
+- CatPrint (Str, L",");
++ MyCatPrint (Str, L",");
+ for (Index = 0; Index < DataLength; Index++) {
+- CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);
++ MyCatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);
+ }
+ }
+- CatPrint (Str, L")");
++ MyCatPrint (Str, L")");
+ }
+
+ /**
+@@ -313,9 +313,9 @@ DevPathAcpi (
+
+ Acpi = DevPath;
+ if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
+- CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);
++ MyCatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);
+ } else {
+- CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);
++ MyCatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);
+ }
+ }
+
+@@ -388,50 +388,50 @@ DevPathExtendedAcpi (
+ }
+
+ if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) {
+- CatPrint (Str, L"AcpiExp(");
++ MyCatPrint (Str, L"AcpiExp(");
+ if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
+- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
++ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
+ } else {
+- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
++ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
+ }
+ if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
+- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
++ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
+ } else {
+- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
++ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
+ }
+ if (UIDSTRIdx != 0) {
+- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
++ MyCatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
+ } else {
+- CatPrint (Str, L"\"\")");
++ MyCatPrint (Str, L"\"\")");
+ }
+ } else {
+- CatPrint (Str, L"AcpiEx(");
++ MyCatPrint (Str, L"AcpiEx(");
+ if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
+- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
++ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
+ } else {
+- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
++ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
+ }
+ if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
+- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
++ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
+ } else {
+- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
++ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
+ }
+- CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID);
++ MyCatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID);
+
+ if (HIDSTRIdx != 0) {
+- CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx);
++ MyCatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx);
+ } else {
+- CatPrint (Str, L"\"\",");
++ MyCatPrint (Str, L"\"\",");
+ }
+ if (CIDSTRIdx != 0) {
+- CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx);
++ MyCatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx);
+ } else {
+- CatPrint (Str, L"\"\",");
++ MyCatPrint (Str, L"\"\",");
+ }
+ if (UIDSTRIdx != 0) {
+- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
++ MyCatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
+ } else {
+- CatPrint (Str, L"\"\")");
++ MyCatPrint (Str, L"\"\")");
+ }
+ }
+
+@@ -462,11 +462,11 @@ DevPathAdrAcpi (
+ Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr);
+ AdditionalAdrCount = (UINT16) ((Length - 8) / 4);
+
+- CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR);
++ MyCatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR);
+ for (Index = 0; Index < AdditionalAdrCount; Index++) {
+- CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));
++ MyCatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));
+ }
+- CatPrint (Str, L")");
++ MyCatPrint (Str, L")");
+ }
+
+ /**
+@@ -488,7 +488,7 @@ DevPathAtapi (
+ ATAPI_DEVICE_PATH *Atapi;
+
+ Atapi = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"Ata(%s,%s)",
+ (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary",
+@@ -515,7 +515,7 @@ DevPathScsi (
+ SCSI_DEVICE_PATH *Scsi;
+
+ Scsi = DevPath;
+- CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);
++ MyCatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);
+ }
+
+ /**
+@@ -537,7 +537,7 @@ DevPathFibre (
+ FIBRECHANNEL_DEVICE_PATH *Fibre;
+
+ Fibre = DevPath;
+- CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun);
++ MyCatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun);
+ }
+
+ /**
+@@ -559,7 +559,7 @@ DevPath1394 (
+ F1394_DEVICE_PATH *F1394Path;
+
+ F1394Path = DevPath;
+- CatPrint (Str, L"1394(%lx)", &F1394Path->Guid);
++ MyCatPrint (Str, L"1394(%lx)", &F1394Path->Guid);
+ }
+
+ /**
+@@ -581,7 +581,7 @@ DevPathUsb (
+ USB_DEVICE_PATH *Usb;
+
+ Usb = DevPath;
+- CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber);
++ MyCatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber);
+ }
+
+ /**
+@@ -603,7 +603,7 @@ DevPathUsbWWID (
+ USB_WWID_DEVICE_PATH *UsbWWId;
+
+ UsbWWId = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"UsbWwid(%x,%x,%x,\"WWID\")",
+ (UINTN) UsbWWId->VendorId,
+@@ -631,7 +631,7 @@ DevPathLogicalUnit (
+ DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit;
+
+ LogicalUnit = DevPath;
+- CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun);
++ MyCatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun);
+ }
+
+ /**
+@@ -653,7 +653,7 @@ DevPathUsbClass (
+ USB_CLASS_DEVICE_PATH *UsbClass;
+
+ UsbClass = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"Usb Class(%x,%x,%x,%x,%x)",
+ (UINTN) UsbClass->VendorId,
+@@ -684,14 +684,14 @@ DevPathSata (
+
+ Sata = DevPath;
+ if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"Sata(%x,%x)",
+ (UINTN) Sata->HBAPortNumber,
+ (UINTN) Sata->Lun
+ );
+ } else {
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"Sata(%x,%x,%x)",
+ (UINTN) Sata->HBAPortNumber,
+@@ -720,7 +720,7 @@ DevPathI2O (
+ I2O_DEVICE_PATH *I2OPath;
+
+ I2OPath = DevPath;
+- CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid);
++ MyCatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid);
+ }
+
+ /**
+@@ -750,13 +750,13 @@ DevPathMacAddr (
+ HwAddressSize = 6;
+ }
+
+- CatPrint (Str, L"Mac(");
++ MyCatPrint (Str, L"Mac(");
+
+ for (Index = 0; Index < HwAddressSize; Index++) {
+- CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]);
++ MyCatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]);
+ }
+
+- CatPrint (Str, L")");
++ MyCatPrint (Str, L")");
+ }
+
+ /**
+@@ -778,7 +778,7 @@ DevPathIPv4 (
+ IPv4_DEVICE_PATH *IPDevPath;
+
+ IPDevPath = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"IPv4(%d.%d.%d.%d:%d)",
+ (UINTN) IPDevPath->RemoteIpAddress.Addr[0],
+@@ -808,7 +808,7 @@ DevPathIPv6 (
+ IPv6_DEVICE_PATH *IPv6DevPath;
+
+ IPv6DevPath = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",
+ (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0],
+@@ -849,7 +849,7 @@ DevPathInfiniBand (
+ INFINIBAND_DEVICE_PATH *InfiniBand;
+
+ InfiniBand = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"Infiniband(%x,%g,%lx,%lx,%lx)",
+ (UINTN) InfiniBand->ResourceFlags,
+@@ -911,36 +911,36 @@ DevPathUart (
+ }
+
+ if (Uart->BaudRate == 0) {
+- CatPrint (Str, L"Uart(DEFAULT,%c,", Parity);
++ MyCatPrint (Str, L"Uart(DEFAULT,%c,", Parity);
+ } else {
+- CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity);
++ MyCatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity);
+ }
+
+ if (Uart->DataBits == 0) {
+- CatPrint (Str, L"D,");
++ MyCatPrint (Str, L"D,");
+ } else {
+- CatPrint (Str, L"%d,", (UINTN) Uart->DataBits);
++ MyCatPrint (Str, L"%d,", (UINTN) Uart->DataBits);
+ }
+
+ switch (Uart->StopBits) {
+ case 0:
+- CatPrint (Str, L"D)");
++ MyCatPrint (Str, L"D)");
+ break;
+
+ case 1:
+- CatPrint (Str, L"1)");
++ MyCatPrint (Str, L"1)");
+ break;
+
+ case 2:
+- CatPrint (Str, L"1.5)");
++ MyCatPrint (Str, L"1.5)");
+ break;
+
+ case 3:
+- CatPrint (Str, L"2)");
++ MyCatPrint (Str, L"2)");
+ break;
+
+ default:
+- CatPrint (Str, L"x)");
++ MyCatPrint (Str, L"x)");
+ break;
+ }
+ }
+@@ -965,7 +965,7 @@ DevPathiSCSI (
+ UINT16 Options;
+
+ IScsi = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"iSCSI(%a,%x,%lx,",
+ IScsi->TargetName,
+@@ -974,18 +974,18 @@ DevPathiSCSI (
+ );
+
+ Options = IScsi->LoginOption;
+- CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");
+- CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");
++ MyCatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");
++ MyCatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");
+ if (((Options >> 11) & 0x0001) != 0) {
+- CatPrint (Str, L"%s,", L"None");
++ MyCatPrint (Str, L"%s,", L"None");
+ } else if (((Options >> 12) & 0x0001) != 0) {
+- CatPrint (Str, L"%s,", L"CHAP_UNI");
++ MyCatPrint (Str, L"%s,", L"CHAP_UNI");
+ } else {
+- CatPrint (Str, L"%s,", L"CHAP_BI");
++ MyCatPrint (Str, L"%s,", L"CHAP_BI");
+
+ }
+
+- CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved");
++ MyCatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved");
+ }
+
+ /**
+@@ -1007,7 +1007,7 @@ DevPathVlan (
+ VLAN_DEVICE_PATH *Vlan;
+
+ Vlan = DevPath;
+- CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);
++ MyCatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);
+ }
+
+ /**
+@@ -1031,7 +1031,7 @@ DevPathHardDrive (
+ Hd = DevPath;
+ switch (Hd->SignatureType) {
+ case SIGNATURE_TYPE_MBR:
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"HD(Part%d,Sig%08x)",
+ (UINTN) Hd->PartitionNumber,
+@@ -1040,7 +1040,7 @@ DevPathHardDrive (
+ break;
+
+ case SIGNATURE_TYPE_GUID:
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"HD(Part%d,Sig%g)",
+ (UINTN) Hd->PartitionNumber,
+@@ -1049,7 +1049,7 @@ DevPathHardDrive (
+ break;
+
+ default:
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"HD(Part%d,MBRType=%02x,SigType=%02x)",
+ (UINTN) Hd->PartitionNumber,
+@@ -1079,7 +1079,7 @@ DevPathCDROM (
+ CDROM_DEVICE_PATH *Cd;
+
+ Cd = DevPath;
+- CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry);
++ MyCatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry);
+ }
+
+ /**
+@@ -1101,7 +1101,7 @@ DevPathFilePath (
+ FILEPATH_DEVICE_PATH *Fp;
+
+ Fp = DevPath;
+- CatPrint (Str, L"%s", Fp->PathName);
++ MyCatPrint (Str, L"%s", Fp->PathName);
+ }
+
+ /**
+@@ -1123,7 +1123,7 @@ DevPathMediaProtocol (
+ MEDIA_PROTOCOL_DEVICE_PATH *MediaProt;
+
+ MediaProt = DevPath;
+- CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);
++ MyCatPrint (Str, L"Media(%g)", &MediaProt->Protocol);
+ }
+
+ /**
+@@ -1145,7 +1145,7 @@ DevPathFvFilePath (
+ MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath;
+
+ FvFilePath = DevPath;
+- CatPrint (Str, L"%g", &FvFilePath->FvFileName);
++ MyCatPrint (Str, L"%g", &FvFilePath->FvFileName);
+ }
+
+ /**
+@@ -1167,7 +1167,7 @@ MyDevPathRelativeOffsetRange (
+ MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
+
+ Offset = DevPath;
+- CatPrint (
++ MyCatPrint (
+ Str,
+ L"Offset(%lx,%lx)",
+ Offset->StartingOffset,
+@@ -1228,7 +1228,7 @@ DevPathBssBss (
+ Type = L"?";
+ break;
+ }
+- CatPrint (Str, L"Legacy-%s", Type);
++ MyCatPrint (Str, L"Legacy-%s", Type);
+ }
+
+ /**
+@@ -1247,7 +1247,7 @@ DevPathEndInstance (
+ IN VOID *DevPath
+ )
+ {
+- CatPrint (Str, L",");
++ MyCatPrint (Str, L",");
+ }
+
+ /**
+@@ -1266,7 +1266,7 @@ DevPathNodeUnknown (
+ IN VOID *DevPath
+ )
+ {
+- CatPrint (Str, L"?");
++ MyCatPrint (Str, L"?");
+ }
+ /**
+ Convert Device Path to a Unicode string for printing.
+@@ -1287,7 +1287,7 @@ DevPathFvPath (
+ MEDIA_FW_VOL_DEVICE_PATH *FvPath;
+
+ FvPath = DevPath;
+- CatPrint (Str, L"Fv(%g)", &FvPath->FvName);
++ MyCatPrint (Str, L"Fv(%g)", &FvPath->FvName);
+ }
+
+ DEVICE_PATH_STRING_TABLE DevPathTable[] = {
+@@ -1553,7 +1553,7 @@ DevicePathToStr (
+ // Put a path seperator in if needed
+ //
+ if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) {
+- CatPrint (&Str, L"/");
++ MyCatPrint (&Str, L"/");
+ }
+ //
+ // Print this node of the device path
+diff --git a/EfiLib/GenericBdsLib.h b/EfiLib/GenericBdsLib.h
+index be4325b..afc10cb 100644
+--- a/EfiLib/GenericBdsLib.h
++++ b/EfiLib/GenericBdsLib.h
+@@ -872,11 +872,6 @@ BdsLibSaveMemoryTypeInformation (
+ @retval EFI_ACCESS_DENIED The user was not successfully identified.
+
+ **/
+-// EFI_STATUS
+-// EFIAPI
+-// BdsLibUserIdentify (
+-// OUT EFI_USER_PROFILE_HANDLE *User
+-// );
+
+ /**
+ This function checks if a Fv file device path is valid, according to a file GUID. If it is invalid,
+@@ -961,7 +956,7 @@ DevPathVendor (
+
+ CHAR16 *
+ EFIAPI
+-CatPrint (
++MyCatPrint (
+ IN OUT POOL_PRINT *Str,
+ IN CHAR16 *Fmt,
+ ...
+diff --git a/EfiLib/gnuefi-helper.c b/EfiLib/gnuefi-helper.c
+index d4f269d..f8cd9a3 100644
+--- a/EfiLib/gnuefi-helper.c
++++ b/EfiLib/gnuefi-helper.c
+@@ -21,7 +21,6 @@
+ #include "LegacyBios.h"
+
+ EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = { 0x09576E91, 0x6D3F, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
+-EFI_GUID gEfiGlobalVariableGuid = { 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }};
+ EFI_GUID gEfiLegacyBiosProtocolGuid = { 0xdb9a1e3d, 0x45cb, 0x4abb, { 0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d }};
+
+ /**
+diff --git a/EfiLib/legacy.c b/EfiLib/legacy.c
+index 3e5edee..271b948 100644
+--- a/EfiLib/legacy.c
++++ b/EfiLib/legacy.c
+@@ -36,6 +36,7 @@ UINTN mBootOptionBbsMappingCount = 0;
+ extern EFI_DEVICE_PATH EndDevicePath[];
+ extern EFI_GUID gEfiLegacyBiosProtocolGuid;
+ EFI_GUID gEfiLegacyDevOrderVariableGuid = { 0xa56074db, 0x65fe, 0x45f7, {0xbd, 0x21, 0x2d, 0x2b, 0xdd, 0x8e, 0x96, 0x52 }};
++static EFI_GUID EfiGlobalVariableGuid = { 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }};
+
+ /**
+
+@@ -276,7 +277,7 @@ BdsFindLegacyBootOptionByDevTypeAndName (
+ UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", (UINTN) BootOrder[Index]);
+ BootOptionVar = BdsLibGetVariableAndSize (
+ BootOption,
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ &BootOptionSize
+ );
+ if (NULL == BootOptionVar) {
+@@ -462,7 +463,7 @@ BdsCreateLegacyBootOption (
+
+ Status = refit_call5_wrapper(gRT->SetVariable,
+ BootString,
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ VAR_FLAG,
+ BufferSize,
+ Buffer
+@@ -747,7 +748,7 @@ BdsAddNonExistingLegacyBootOptions (
+
+ BootOrder = BdsLibGetVariableAndSize (
+ L"BootOrder",
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ &BootOrderSize
+ );
+ if (BootOrder == NULL) {
+@@ -817,13 +818,13 @@ BdsAddNonExistingLegacyBootOptions (
+ if (BootOrderSize > 0) {
+ Status = refit_call5_wrapper(gRT->SetVariable,
+ L"BootOrder",
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ VAR_FLAG,
+ BootOrderSize,
+ BootOrder
+ );
+ } else {
+- EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
++ EfiLibDeleteVariable (L"BootOrder", &EfiGlobalVariableGuid);
+ }
+
+ if (BootOrder != NULL) {
+@@ -861,7 +862,7 @@ BdsDeleteBootOption (
+ Index2Del = 0;
+
+ UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", OptionNumber);
+- Status = EfiLibDeleteVariable (BootOption, &gEfiGlobalVariableGuid);
++ Status = EfiLibDeleteVariable (BootOption, &EfiGlobalVariableGuid);
+
+ //
+ // adjust boot order array
+@@ -940,7 +941,7 @@ BdsDeleteAllInvalidLegacyBootOptions (
+
+ BootOrder = BdsLibGetVariableAndSize (
+ L"BootOrder",
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ &BootOrderSize
+ );
+ if (BootOrder == NULL) {
+@@ -952,14 +953,14 @@ BdsDeleteAllInvalidLegacyBootOptions (
+ UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", BootOrder[Index]);
+ BootOptionVar = BdsLibGetVariableAndSize (
+ BootOption,
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ &BootOptionSize
+ );
+ if (NULL == BootOptionVar) {
+ BootOptionSize = 0;
+ Status = refit_call5_wrapper(gRT->GetVariable,
+ BootOption,
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ NULL,
+ &BootOptionSize,
+ BootOptionVar
+@@ -1035,13 +1036,13 @@ BdsDeleteAllInvalidLegacyBootOptions (
+ if (BootOrderSize != 0) {
+ Status = refit_call5_wrapper(gRT->SetVariable,
+ L"BootOrder",
+- &gEfiGlobalVariableGuid,
++ &EfiGlobalVariableGuid,
+ VAR_FLAG,
+ BootOrderSize,
+ BootOrder
+ );
+ } else {
+- EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
++ EfiLibDeleteVariable (L"BootOrder", &EfiGlobalVariableGuid);
+ }
+
+ if (BootOrder != NULL) {
+diff --git a/filesystems/edk2/DriverBinding.h b/filesystems/edk2/DriverBinding.h
+index fdb16c5..c2de33a 100644
+--- a/filesystems/edk2/DriverBinding.h
++++ b/filesystems/edk2/DriverBinding.h
+@@ -21,30 +21,32 @@ Revision History
+
+ --*/
+
++/*
++ * rEFInd NOTE: This file is included only when compiling with GNU-EFI,
++ * which has not traditionally provided the definitions supplied here.
++ * Unfortunately, recent (ca. 3.0.5) versions of GNU-EFI have added
++ * SOME of these functions to an existing header file, creating problems
++ * when trying to maintain compatibility with multiple GNU-EFI versions.
++ * I've therefore renamed the relevant defines, types, and functions,
++ * both here and in fsw_efi.c; and included a define to match the only
++ * used name (REFIND_EFI_DRIVER_BINDING_PROTOCOL) to the traditional
++ * name (EFI_DRIVER_BINDING_PROTOCOL) in fsw_efi.c for compiling with
++ * TianoCore.
++ */
++
+ #ifndef _EFI_DRIVER_BINDING_H_
+ #define _EFI_DRIVER_BINDING_H_
+
+ #include <efidevp.h>
+
+-//
+-// Global ID for the ControllerHandle Driver Protocol
+-//
+-#define EFI_DRIVER_BINDING_PROTOCOL_GUID \
++#define REFIND_EFI_DRIVER_BINDING_PROTOCOL_GUID \
+ { \
+ 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71} \
+ }
+
+ #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
+
+-EFI_FORWARD_DECLARATION (EFI_DRIVER_BINDING_PROTOCOL);
+-
+-///
+-/// Device Path protocol.
+-///
+-#define EFI_DEVICE_PATH_PROTOCOL_GUID \
+- { \
+- 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+- }
++EFI_FORWARD_DECLARATION (REFIND_EFI_DRIVER_BINDING_PROTOCOL);
+
+ // Begin included from DevicePath.h....
+
+@@ -79,18 +81,19 @@ typedef struct {
+ UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
+ ///< type of data. Size of data is included in Length.
+
+-} EFI_DEVICE_PATH_PROTOCOL;
++} REFIND_EFI_DEVICE_PATH_PROTOCOL;
+
+ #pragma pack()
+
++
+ // End included from DevicePath.h
+
+ typedef
+ EFI_STATUS
+ (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (
+- IN EFI_DRIVER_BINDING_PROTOCOL * This,
++ IN REFIND_EFI_DRIVER_BINDING_PROTOCOL * This,
+ IN EFI_HANDLE ControllerHandle,
+- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
++ IN REFIND_EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
+ )
+ /*++
+
+@@ -114,9 +117,9 @@ EFI_STATUS
+ typedef
+ EFI_STATUS
+ (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_START) (
+- IN EFI_DRIVER_BINDING_PROTOCOL * This,
++ IN REFIND_EFI_DRIVER_BINDING_PROTOCOL * This,
+ IN EFI_HANDLE ControllerHandle,
+- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
++ IN REFIND_EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
+ )
+ /*++
+
+@@ -140,7 +143,7 @@ EFI_STATUS
+ typedef
+ EFI_STATUS
+ (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_STOP) (
+- IN EFI_DRIVER_BINDING_PROTOCOL * This,
++ IN REFIND_EFI_DRIVER_BINDING_PROTOCOL * This,
+ IN EFI_HANDLE ControllerHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE * ChildHandleBuffer
+@@ -167,7 +170,7 @@ EFI_STATUS
+ //
+ // Interface structure for the ControllerHandle Driver Protocol
+ //
+-struct _EFI_DRIVER_BINDING_PROTOCOL {
++struct _REFIND_EFI_DRIVER_BINDING_PROTOCOL {
+ EFI_DRIVER_BINDING_SUPPORTED Supported;
+ EFI_DRIVER_BINDING_START Start;
+ EFI_DRIVER_BINDING_STOP Stop;
+diff --git a/filesystems/fsw_efi.c b/filesystems/fsw_efi.c
+index a7257fa..635985e 100644
+--- a/filesystems/fsw_efi.c
++++ b/filesystems/fsw_efi.c
+@@ -43,9 +43,18 @@
+ #ifdef __MAKEWITH_GNUEFI
+ #include "edk2/DriverBinding.h"
+ #include "edk2/ComponentName.h"
++#define gMyEfiSimpleFileSystemProtocolGuid FileSystemProtocol
+ #else
++#define REFIND_EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL
+ #define REFIND_EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL
++#define REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID EFI_COMPONENT_NAME_PROTOCOL_GUID
++#define REFIND_EFI_DRIVER_BINDING_PROTOCOL_GUID EFI_DRIVER_BINDING_PROTOCOL_GUID
++#define REFIND_EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL
++#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
++ { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
++#define gMyEfiSimpleFileSystemProtocolGuid gEfiSimpleFileSystemProtocolGuid
+ #endif
++
+ #include "../include/refit_call_wrapper.h"
+
+ #define DEBUG_LEVEL 0
+@@ -55,27 +64,13 @@
+ #define FSTYPE ext2
+ #endif
+
+-#ifdef __MAKEWITH_GNUEFI
+-
+-#define EFI_DISK_IO_PROTOCOL_GUID \
+- { \
+- 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+- }
+-
+-#define EFI_BLOCK_IO_PROTOCOL_GUID \
+- { \
+- 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+- }
+-
+-EFI_GUID gEfiDriverBindingProtocolGuid = EFI_DRIVER_BINDING_PROTOCOL_GUID;
+-EFI_GUID gEfiComponentNameProtocolGuid = REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID;
+-EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID;
+-EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
+-EFI_GUID gEfiFileInfoGuid = EFI_FILE_INFO_ID;
+-EFI_GUID gEfiFileSystemInfoGuid = EFI_FILE_SYSTEM_INFO_ID;
+-EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
+-#define gEfiSimpleFileSystemProtocolGuid FileSystemProtocol
+-#endif
++EFI_GUID gMyEfiDriverBindingProtocolGuid = REFIND_EFI_DRIVER_BINDING_PROTOCOL_GUID;
++EFI_GUID gMyEfiComponentNameProtocolGuid = REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID;
++EFI_GUID gMyEfiDiskIoProtocolGuid = REFIND_EFI_DISK_IO_PROTOCOL_GUID;
++EFI_GUID gMyEfiBlockIoProtocolGuid = REFIND_EFI_BLOCK_IO_PROTOCOL_GUID;
++EFI_GUID gMyEfiFileInfoGuid = EFI_FILE_INFO_ID;
++EFI_GUID gMyEfiFileSystemInfoGuid = EFI_FILE_SYSTEM_INFO_ID;
++EFI_GUID gMyEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
+
+ /** Helper macro for stringification. */
+ #define FSW_EFI_STRINGIFY(x) #x
+@@ -84,25 +79,25 @@ EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO
+
+ // function prototypes
+
+-EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL *This,
+- IN EFI_HANDLE ControllerHandle,
+- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
+-EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *This,
+- IN EFI_HANDLE ControllerHandle,
+- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
+-EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *This,
+- IN EFI_HANDLE ControllerHandle,
+- IN UINTN NumberOfChildren,
+- IN EFI_HANDLE *ChildHandleBuffer);
++EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
++ IN EFI_HANDLE ControllerHandle,
++ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
++EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
++ IN EFI_HANDLE ControllerHandle,
++ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
++EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
++ IN EFI_HANDLE ControllerHandle,
++ IN UINTN NumberOfChildren,
++ IN EFI_HANDLE *ChildHandleBuffer);
+
+ EFI_STATUS EFIAPI fsw_efi_ComponentName_GetDriverName(IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
+- IN CHAR8 *Language,
+- OUT CHAR16 **DriverName);
+-EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
+- IN EFI_HANDLE ControllerHandle,
+- IN EFI_HANDLE ChildHandle OPTIONAL,
+- IN CHAR8 *Language,
+- OUT CHAR16 **ControllerName);
++ IN CHAR8 *Language,
++ OUT CHAR16 **DriverName);
++EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
++ IN EFI_HANDLE ControllerHandle,
++ IN EFI_HANDLE ChildHandle OPTIONAL,
++ IN CHAR8 *Language,
++ OUT CHAR16 **ControllerName);
+
+ void EFIAPI fsw_efi_change_blocksize(struct fsw_volume *vol,
+ fsw_u32 old_phys_blocksize, fsw_u32 old_log_blocksize,
+@@ -164,7 +159,7 @@ static int LastRead = -1;
+ * Interface structure for the EFI Driver Binding protocol.
+ */
+
+-EFI_DRIVER_BINDING_PROTOCOL fsw_efi_DriverBinding_table = {
++REFIND_EFI_DRIVER_BINDING_PROTOCOL fsw_efi_DriverBinding_table = {
+ fsw_efi_DriverBinding_Supported,
+ fsw_efi_DriverBinding_Start,
+ fsw_efi_DriverBinding_Stop,
+@@ -233,7 +228,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE ImageHandle,
+ fsw_efi_DriverBinding_table.DriverBindingHandle = ImageHandle;
+ // install Driver Binding protocol
+ Status = refit_call4_wrapper(BS->InstallProtocolInterface, &fsw_efi_DriverBinding_table.DriverBindingHandle,
+- &gEfiDriverBindingProtocolGuid,
++ &gMyEfiDriverBindingProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ &fsw_efi_DriverBinding_table);
+ if (EFI_ERROR (Status)) {
+@@ -242,7 +237,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE ImageHandle,
+
+ // install Component Name protocol
+ Status = refit_call4_wrapper(BS->InstallProtocolInterface, &fsw_efi_DriverBinding_table.DriverBindingHandle,
+- &gEfiComponentNameProtocolGuid,
++ &gMyEfiComponentNameProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ &fsw_efi_ComponentName_table);
+ if (EFI_ERROR (Status)) {
+@@ -272,9 +267,9 @@ EFI_DRIVER_ENTRY_POINT(fsw_efi_main)
+ * and implicitly checks if the disk is already in use by another driver.
+ */
+
+-EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL *This,
++EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
++ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
+ {
+ EFI_STATUS Status;
+ EFI_DISK_IO *DiskIo;
+@@ -283,7 +278,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
+
+ // first, open DiskIO
+ Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
+- &gEfiDiskIoProtocolGuid,
++ &gMyEfiDiskIoProtocolGuid,
+ (VOID **) &DiskIo,
+ This->DriverBindingHandle,
+ ControllerHandle,
+@@ -293,13 +288,13 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
+
+ // we were just checking, close it again
+ refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
+- &gEfiDiskIoProtocolGuid,
++ &gMyEfiDiskIoProtocolGuid,
+ This->DriverBindingHandle,
+ ControllerHandle);
+
+ // next, check BlockIO without actually opening it
+ Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
+- &gEfiBlockIoProtocolGuid,
++ &gMyEfiBlockIoProtocolGuid,
+ NULL,
+ This->DriverBindingHandle,
+ ControllerHandle,
+@@ -320,9 +315,9 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
+ * device handle.
+ */
+
+-EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *This,
++EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
++ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
+ {
+ EFI_STATUS Status;
+ EFI_BLOCK_IO *BlockIo;
+@@ -335,7 +330,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
+
+ // open consumed protocols
+ Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
+- &gEfiBlockIoProtocolGuid,
++ &gMyEfiBlockIoProtocolGuid,
+ (VOID **) &BlockIo,
+ This->DriverBindingHandle,
+ ControllerHandle,
+@@ -346,7 +341,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
+ }
+
+ Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
+- &gEfiDiskIoProtocolGuid,
++ &gMyEfiDiskIoProtocolGuid,
+ (VOID **) &DiskIo,
+ This->DriverBindingHandle,
+ ControllerHandle,
+@@ -373,7 +368,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
+ Volume->FileSystem.Revision = EFI_FILE_IO_INTERFACE_REVISION;
+ Volume->FileSystem.OpenVolume = fsw_efi_FileSystem_OpenVolume;
+ Status = refit_call4_wrapper(BS->InstallMultipleProtocolInterfaces, &ControllerHandle,
+- &gEfiSimpleFileSystemProtocolGuid,
++ &gMyEfiSimpleFileSystemProtocolGuid,
+ &Volume->FileSystem,
+ NULL);
+ if (EFI_ERROR(Status)) {
+@@ -388,7 +383,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
+ FreePool(Volume);
+
+ refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
+- &gEfiDiskIoProtocolGuid,
++ &gMyEfiDiskIoProtocolGuid,
+ This->DriverBindingHandle,
+ ControllerHandle);
+ }
+@@ -405,7 +400,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
+ * case; it closes all file handles between commands.
+ */
+
+-EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *This,
++EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer)
+@@ -420,7 +415,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *T
+
+ // get the installed SimpleFileSystem interface
+ Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
+- &gEfiSimpleFileSystemProtocolGuid,
++ &gMyEfiSimpleFileSystemProtocolGuid,
+ (VOID **) &FileSystem,
+ This->DriverBindingHandle,
+ ControllerHandle,
+@@ -433,7 +428,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *T
+
+ // uninstall Simple File System protocol
+ Status = refit_call4_wrapper(BS->UninstallMultipleProtocolInterfaces, ControllerHandle,
+- &gEfiSimpleFileSystemProtocolGuid, &Volume->FileSystem,
++ &gMyEfiSimpleFileSystemProtocolGuid, &Volume->FileSystem,
+ NULL);
+ if (EFI_ERROR(Status)) {
+ // Print(L"Fsw ERROR: UninstallMultipleProtocolInterfaces returned %x\n", Status);
+@@ -450,7 +445,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *T
+
+ // close the consumed protocols
+ Status = refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
+- &gEfiDiskIoProtocolGuid,
++ &gMyEfiDiskIoProtocolGuid,
+ This->DriverBindingHandle,
+ ControllerHandle);
+
+@@ -1027,14 +1022,14 @@ EFI_STATUS fsw_efi_dnode_getinfo(IN FSW_FILE_DATA *File,
+ struct fsw_volume_stat vsb;
+
+
+- if (CompareGuid(InformationType, &gEfiFileInfoGuid)) {
++ if (CompareGuid(InformationType, &gMyEfiFileInfoGuid)) {
+ #if DEBUG_LEVEL
+ Print(L"fsw_efi_dnode_getinfo: FILE_INFO\n");
+ #endif
+
+ Status = fsw_efi_dnode_fill_FileInfo(Volume, File->shand.dnode, BufferSize, Buffer);
+
+- } else if (CompareGuid(InformationType, &gEfiFileSystemInfoGuid)) {
++ } else if (CompareGuid(InformationType, &gMyEfiFileSystemInfoGuid)) {
+ #if DEBUG_LEVEL
+ Print(L"fsw_efi_dnode_getinfo: FILE_SYSTEM_INFO\n");
+ #endif
+@@ -1065,7 +1060,7 @@ EFI_STATUS fsw_efi_dnode_getinfo(IN FSW_FILE_DATA *File,
+ *BufferSize = RequiredSize;
+ Status = EFI_SUCCESS;
+
+- } else if (CompareGuid(InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {
++ } else if (CompareGuid(InformationType, &gMyEfiFileSystemVolumeLabelInfoIdGuid)) {
+ #if DEBUG_LEVEL
+ Print(L"fsw_efi_dnode_getinfo: FILE_SYSTEM_VOLUME_LABEL\n");
+ #endif
+diff --git a/filesystems/fsw_efi.h b/filesystems/fsw_efi.h
+index c3b7a3c..d9442ef 100644
+--- a/filesystems/fsw_efi.h
++++ b/filesystems/fsw_efi.h
+@@ -44,6 +44,16 @@
+ #define CompareGuid(a, b) CompareGuid(a, b)==0
+ #endif
+
++#define REFIND_EFI_DISK_IO_PROTOCOL_GUID \
++ { \
++ 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
++ }
++
++#define REFIND_EFI_BLOCK_IO_PROTOCOL_GUID \
++ { \
++ 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
++ }
++
+ /**
+ * EFI Host: Private per-volume structure.
+ */
+diff --git a/filesystems/scandisk.c b/filesystems/scandisk.c
+index d8b862a..ddd6908 100644
+--- a/filesystems/scandisk.c
++++ b/filesystems/scandisk.c
+@@ -24,8 +24,11 @@
+ #ifdef __MAKEWITH_GNUEFI
+ #include "edk2/DriverBinding.h"
+ #include "edk2/ComponentName.h"
+-extern EFI_GUID gEfiDiskIoProtocolGuid;
+-extern EFI_GUID gEfiBlockIoProtocolGuid;
++extern EFI_GUID gMyEfiDiskIoProtocolGuid;
++extern EFI_GUID gMyEfiBlockIoProtocolGuid;
++#else
++#define gMyEfiBlockIoProtocolGuid gEfiBlockIoProtocolGuid
++#define gMyEfiDiskIoProtocolGuid gEfiDiskIoProtocolGuid
+ #endif
+ #include "../include/refit_call_wrapper.h"
+
+@@ -99,16 +102,16 @@ static int scan_disks(int (*hook)(struct fsw_volume *, struct fsw_volume *), str
+ Print(L" ");
+ #endif
+ DPRINT(L"Scanning disks\n");
+- Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &gEfiDiskIoProtocolGuid, NULL, &HandleCount, &Handles);
++ Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &gMyEfiDiskIoProtocolGuid, NULL, &HandleCount, &Handles);
+ if (Status == EFI_NOT_FOUND)
+ return -1; // no filesystems. strange, but true...
+ for (i = 0; i < HandleCount; i++) {
+ EFI_DISK_IO *diskio;
+ EFI_BLOCK_IO *blockio;
+- Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiDiskIoProtocolGuid, (VOID **) &diskio);
++ Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gMyEfiDiskIoProtocolGuid, (VOID **) &diskio);
+ if (Status != 0)
+ continue;
+- Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiBlockIoProtocolGuid, (VOID **) &blockio);
++ Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gMyEfiBlockIoProtocolGuid, (VOID **) &blockio);
+ if (Status != 0)
+ continue;
+ struct fsw_volume *vol = create_dummy_volume(diskio, blockio->Media->MediaId);
+diff --git a/refind.conf-sample b/refind.conf-sample
+index 8b5853e..69cef8b 100644
+--- a/refind.conf-sample
++++ b/refind.conf-sample
+@@ -395,7 +395,7 @@ timeout 20
+ #default_selection Microsoft
+ #default_selection "+,bzImage,vmlinuz"
+ #default_selection Maintenance 23:30 2:00
+-#default_selection "Maintenance,OS X" 1:00 2:30
++#default_selection "Maintenance,macOS" 1:00 2:30
+
+ # Enable VMX bit and lock the CPU MSR if unlocked.
+ # On some Intel Apple computers, the firmware does not lock the MSR 0x3A.
+diff --git a/refind/driver_support.c b/refind/driver_support.c
+index 26c5965..8ab25ff 100644
+--- a/refind/driver_support.c
++++ b/refind/driver_support.c
+@@ -85,37 +85,34 @@
+ #define DRIVER_DIRS L"drivers"
+ #endif
+
+-#ifdef __MAKEWITH_GNUEFI
+ // Following "global" constants are from EDK2's AutoGen.c....
+-EFI_GUID gEfiLoadedImageProtocolGuid = { 0x5B1B31A1, 0x9562, 0x11D2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
+-EFI_GUID gEfiDriverBindingProtocolGuid = { 0x18A031AB, 0xB443, 0x4D1A, { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 }};
+-EFI_GUID gEfiDriverConfiguration2ProtocolGuid = { 0xBFD7DC1D, 0x24F1, 0x40D9, { 0x82, 0xE7, 0x2E, 0x09, 0xBB, 0x6B, 0x4E, 0xBE }};
+-EFI_GUID gEfiDriverConfigurationProtocolGuid = { 0x107A772B, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
+-EFI_GUID gEfiDriverDiagnosticsProtocolGuid = { 0x0784924F, 0xE296, 0x11D4, { 0x9A, 0x49, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
+-EFI_GUID gEfiDriverDiagnostics2ProtocolGuid = { 0x4D330321, 0x025F, 0x4AAC, { 0x90, 0xD8, 0x5E, 0xD9, 0x00, 0x17, 0x3B, 0x63 }};
+-EFI_GUID gEfiComponentNameProtocolGuid = { 0x107A772C, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
+-EFI_GUID gEfiComponentName2ProtocolGuid = { 0x6A7A5CFF, 0xE8D9, 0x4F70, { 0xBA, 0xDA, 0x75, 0xAB, 0x30, 0x25, 0xCE, 0x14 }};
+-EFI_GUID gEfiDevicePathProtocolGuid = { 0x09576E91, 0x6D3F, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
+-EFI_GUID gEfiDiskIoProtocolGuid = { 0xCE345171, 0xBA0B, 0x11D2, { 0x8E, 0x4F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
+-EFI_GUID gEfiBlockIoProtocolGuid = { 0x964E5B21, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
+-EFI_GUID gEfiSimpleFileSystemProtocolGuid = { 0x964E5B22, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
+-
+-struct EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
+-struct EFI_FILE_PROTOCOL;
++EFI_GUID gMyEfiLoadedImageProtocolGuid = { 0x5B1B31A1, 0x9562, 0x11D2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
++EFI_GUID gMyEfiDriverBindingProtocolGuid = { 0x18A031AB, 0xB443, 0x4D1A, { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 }};
++EFI_GUID gMyEfiDriverConfigurationProtocolGuid = { 0x107A772B, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
++EFI_GUID gMyEfiDriverDiagnosticsProtocolGuid = { 0x0784924F, 0xE296, 0x11D4, { 0x9A, 0x49, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
++EFI_GUID gMyEfiComponentNameProtocolGuid = { 0x107A772C, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
++EFI_GUID gMyEfiDevicePathProtocolGuid = { 0x09576E91, 0x6D3F, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
++EFI_GUID gMyEfiDiskIoProtocolGuid = { 0xCE345171, 0xBA0B, 0x11D2, { 0x8E, 0x4F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
++EFI_GUID gMyEfiBlockIoProtocolGuid = { 0x964E5B21, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
++EFI_GUID gMyEfiSimpleFileSystemProtocolGuid = { 0x964E5B22, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
++
++#ifdef __MAKEWITH_GNUEFI
++struct MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
++struct MY_EFI_FILE_PROTOCOL;
+
+ typedef
+ EFI_STATUS
+-(EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(
+- IN struct EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
+- OUT struct EFI_FILE_PROTOCOL **Root
++(EFIAPI *MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(
++ IN struct MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
++ OUT struct MY_EFI_FILE_PROTOCOL **Root
+ );
+
+-typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
++typedef struct _MY_MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
+ UINT64 Revision;
+- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
+-} EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
++ MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
++} MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
+
+-typedef struct _EFI_FILE_PROTOCOL {
++typedef struct _MY_EFI_FILE_PROTOCOL {
+ UINT64 Revision;
+ EFI_FILE_OPEN Open;
+ EFI_FILE_CLOSE Close;
+@@ -127,16 +124,20 @@ typedef struct _EFI_FILE_PROTOCOL {
+ EFI_FILE_GET_INFO GetInfo;
+ EFI_FILE_SET_INFO SetInfo;
+ EFI_FILE_FLUSH Flush;
+-} EFI_FILE_PROTOCOL;
++} MY_EFI_FILE_PROTOCOL;
+
+-typedef struct _EFI_BLOCK_IO_PROTOCOL {
++typedef struct _MY_EFI_BLOCK_IO_PROTOCOL {
+ UINT64 Revision;
+ EFI_BLOCK_IO_MEDIA *Media;
+ EFI_BLOCK_RESET Reset;
+ EFI_BLOCK_READ ReadBlocks;
+ EFI_BLOCK_WRITE WriteBlocks;
+ EFI_BLOCK_FLUSH FlushBlocks;
+-} EFI_BLOCK_IO_PROTOCOL;
++} MY_EFI_BLOCK_IO_PROTOCOL;
++#else /* Make with Tianocore */
++#define MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
++#define MY_EFI_FILE_PROTOCOL EFI_FILE_PROTOCOL
++#define MY_EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL
+ #endif
+
+ /* LibScanHandleDatabase() is used by rEFInd's driver-loading code (inherited
+@@ -232,27 +233,27 @@ LibScanHandleDatabase (EFI_HANDLE DriverBindingHandle, OPTIONAL
+
+ for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) {
+
+- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid) == 0) {
++ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiLoadedImageProtocolGuid) == 0) {
+ (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_IMAGE_HANDLE;
+ }
+
+- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverBindingProtocolGuid) == 0) {
++ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDriverBindingProtocolGuid) == 0) {
+ (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DRIVER_BINDING_HANDLE;
+ }
+
+- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfigurationProtocolGuid) == 0) {
++ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDriverConfigurationProtocolGuid) == 0) {
+ (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DRIVER_CONFIGURATION_HANDLE;
+ }
+
+- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnosticsProtocolGuid) == 0) {
++ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDriverDiagnosticsProtocolGuid) == 0) {
+ (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DRIVER_DIAGNOSTICS_HANDLE;
+ }
+
+- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentNameProtocolGuid) == 0) {
++ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiComponentNameProtocolGuid) == 0) {
+ (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_COMPONENT_NAME_HANDLE;
+ }
+
+- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDevicePathProtocolGuid) == 0) {
++ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDevicePathProtocolGuid) == 0) {
+ (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DEVICE_HANDLE;
+ }
+ //
+@@ -453,8 +454,8 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
+ UINTN Index;
+ UINTN OpenInfoIndex;
+ EFI_HANDLE *Handles = NULL;
+- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Fs;
+- EFI_BLOCK_IO_PROTOCOL *BlockIo;
++ MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Fs;
++ MY_EFI_BLOCK_IO_PROTOCOL *BlockIo;
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo;
+ UINTN OpenInfoCount;
+ EFI_HANDLE DriverHandleList[2];
+@@ -464,7 +465,7 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
+ //
+ Status = refit_call5_wrapper(gBS->LocateHandleBuffer,
+ ByProtocol,
+- &gEfiDiskIoProtocolGuid,
++ &gMyEfiDiskIoProtocolGuid,
+ NULL,
+ &HandleCount,
+ &Handles);
+@@ -483,7 +484,7 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
+ //
+ Status = refit_call3_wrapper(gBS->HandleProtocol,
+ Handles[Index],
+- &gEfiBlockIoProtocolGuid,
++ &gMyEfiBlockIoProtocolGuid,
+ (VOID **) &BlockIo);
+ if (EFI_ERROR (Status))
+ continue;
+@@ -494,9 +495,9 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
+ // If SimpleFileSystem is already produced - skip it, this is ok
+ //
+ Status = refit_call3_wrapper(gBS->HandleProtocol,
+- Handles[Index],
+- &gEfiSimpleFileSystemProtocolGuid,
+- (VOID **) &Fs);
++ Handles[Index],
++ &gMyEfiSimpleFileSystemProtocolGuid,
++ (VOID **) &Fs);
+ if (Status == EFI_SUCCESS)
+ continue;
+
+@@ -506,7 +507,7 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
+ //
+ Status = refit_call4_wrapper(gBS->OpenProtocolInformation,
+ Handles[Index],
+- &gEfiDiskIoProtocolGuid,
++ &gMyEfiDiskIoProtocolGuid,
+ &OpenInfo,
+ &OpenInfoCount);
+ if (EFI_ERROR (Status))
+diff --git a/refind/legacy.c b/refind/legacy.c
+index aead421..cd4ee9b 100644
+--- a/refind/legacy.c
++++ b/refind/legacy.c
+@@ -76,6 +76,8 @@ extern REFIT_MENU_SCREEN MainMenu;
+ #define DevicePathProtocol gEfiDevicePathProtocolGuid
+ #endif
+
++EFI_GUID EfiGlobalVariableGuid = { 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }};
++
+ static EFI_STATUS ActivateMbrPartition(IN EFI_BLOCK_IO *BlockIO, IN UINTN PartitionIndex)
+ {
+ EFI_STATUS Status;
+@@ -538,7 +540,7 @@ static VOID ScanLegacyUEFI(IN UINTN DiskType)
+ } // if
+
+ // Grab the boot order
+- BootOrder = BdsLibGetVariableAndSize(L"BootOrder", &gEfiGlobalVariableGuid, &BootOrderSize);
++ BootOrder = BdsLibGetVariableAndSize(L"BootOrder", &EfiGlobalVariableGuid, &BootOrderSize);
+ if (BootOrder == NULL) {
+ BootOrderSize = 0;
+ }
+--
+2.13.0
+
diff --git a/sys-boot/refind/refind-0.10.7.ebuild b/sys-boot/refind/refind-0.10.7-r1.ebuild
similarity index 98%
rename from sys-boot/refind/refind-0.10.7.ebuild
rename to sys-boot/refind/refind-0.10.7-r1.ebuild
index 044b7ed7c12..b77f6fc42e8 100644
--- a/sys-boot/refind/refind-0.10.7.ebuild
+++ b/sys-boot/refind/refind-0.10.7-r1.ebuild
@@ -54,6 +54,9 @@ pkg_setup() {
src_prepare() {
default
+ # bug 616668 - build fails against gnu-efi-3.0.5
+ eapply "${FILESDIR}"/"${PF}"-fix_build_gnuefi-3.0.5.patch
+
# bug 598647 - PIE not supported
sed -e 's:CFLAGS =:& -fno-PIE:' -i "${S}/Make.common" || die
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/, sys-boot/refind/files/
@ 2017-06-04 6:16 Sam Jorna
0 siblings, 0 replies; 6+ messages in thread
From: Sam Jorna @ 2017-06-04 6:16 UTC (permalink / raw
To: gentoo-commits
commit: daeac026af7e05b679a46dbb68cc9fdaec90437f
Author: Sam Jorna <wraeth <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 4 04:37:56 2017 +0000
Commit: Sam Jorna <wraeth <AT> gentoo <DOT> org>
CommitDate: Sun Jun 4 06:12:09 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=daeac026
sys-boot/refind: move large patch to dev.g.o hosting
Uncompressed patch too large for QA constraints (50KB), moved to
hosting on dev.g.o.
Gentoo-Bug: 620632
Package-Manager: Portage-2.3.6, Repoman-2.3.2
sys-boot/refind/Manifest | 1 +
.../refind-0.10.7-fix_build_gnuefi-3.0.5.patch | 1387 --------------------
sys-boot/refind/refind-0.10.7-r1.ebuild | 5 +-
3 files changed, 4 insertions(+), 1389 deletions(-)
diff --git a/sys-boot/refind/Manifest b/sys-boot/refind/Manifest
index 77b0cb5dfa7..c6f9278a867 100644
--- a/sys-boot/refind/Manifest
+++ b/sys-boot/refind/Manifest
@@ -1,2 +1,3 @@
+DIST refind-0.10.7-fix_build_gnuefi-3.0.5.patch.xz 9920 SHA256 262af553bc782394d08fa208452e81ef0b8cbefd6ec3857bee0a7d7f862bd86f SHA512 48ef45c7650347b82ee14a01459fd8f59d99623ae12f40f198d0d36d2471b3e93de85a4c3d39825e58e70c08b03fe00506fb71173deaef1889f5a806b103564d WHIRLPOOL e250f230221fd3920547c2684cffe258931d8a79c47bf458cc422551b1d5ee0a3930a8ba9353ae120cd87500ec478d13cf085933f41f78b4d2e5ed7d71dd3e4e
DIST refind-src-0.10.4.tar.gz 3970380 SHA256 c3e428b27a0d4c61ee052603aedea7118bf04a7917216b10bfde2a3d2a2442a5 SHA512 a75a6210ee51427c474e69c2de8c719545b2599c19f1c7541048b77ab1996a0e4b4b5fd4840f6240cd6704e5f5338cbaff432d7dc5ec4042854e26d6df18bed5 WHIRLPOOL a5d84831ea3c6282560fcc7491e7aabeb4a0598c34843a09b7baadf9398092a9495290180d05fbd935ad09207814a3fa4f72cfa3bf798f2422fecf07dc27037d
DIST refind-src-0.10.7.tar.gz 4045026 SHA256 32e9a1cb11a910a26f555792d287f1b26d677c6d15666c19814d2b67b78b4201 SHA512 42830ac8c06221e2244426059add134afc6b63e5120c78fc6fed54eb3a6a1aee1b07da4833f53b3e5ed85689ab818d9bccdd7d1eb7e8fd326ea118ad0d3a542f WHIRLPOOL a8ac31f0fe3ee5726ecca56f339a1a63835ee608c947a0d86ed6995ad3fa09d66cce7bb4a5d878a6e20755d18b784822c6032ec7f67ea99a14ff3c9f44c49d88
diff --git a/sys-boot/refind/files/refind-0.10.7-fix_build_gnuefi-3.0.5.patch b/sys-boot/refind/files/refind-0.10.7-fix_build_gnuefi-3.0.5.patch
deleted file mode 100644
index 5320241acb0..00000000000
--- a/sys-boot/refind/files/refind-0.10.7-fix_build_gnuefi-3.0.5.patch
+++ /dev/null
@@ -1,1387 +0,0 @@
-diff --git a/EfiLib/DevicePath.c b/EfiLib/DevicePath.c
-index bfaf1c6..023ea3f 100644
---- a/EfiLib/DevicePath.c
-+++ b/EfiLib/DevicePath.c
-@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- CHAR16 *
- EFIAPI
--CatPrint (
-+MyCatPrint (
- IN OUT POOL_PRINT *Str,
- IN CHAR16 *Fmt,
- ...
-@@ -94,7 +94,7 @@ DevPathPci (
- PCI_DEVICE_PATH *Pci;
-
- Pci = DevPath;
-- CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);
-+ MyCatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);
- }
-
- /**
-@@ -116,7 +116,7 @@ DevPathPccard (
- PCCARD_DEVICE_PATH *Pccard;
-
- Pccard = DevPath;
-- CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber);
-+ MyCatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber);
- }
-
- /**
-@@ -138,7 +138,7 @@ DevPathMemMap (
- MEMMAP_DEVICE_PATH *MemMap;
-
- MemMap = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"MemMap(%d:%lx-%lx)",
- (UINTN) MemMap->MemoryType,
-@@ -166,7 +166,7 @@ DevPathController (
- CONTROLLER_DEVICE_PATH *Controller;
-
- Controller = DevPath;
-- CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber);
-+ MyCatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber);
- }
-
-
-@@ -202,30 +202,30 @@ DevPathVendor (
- Type = L"Msg";
- /*
- if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) {
-- CatPrint (Str, L"VenPcAnsi()");
-+ MyCatPrint (Str, L"VenPcAnsi()");
- return ;
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) {
-- CatPrint (Str, L"VenVt100()");
-+ MyCatPrint (Str, L"VenVt100()");
- return ;
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) {
-- CatPrint (Str, L"VenVt100Plus()");
-+ MyCatPrint (Str, L"VenVt100Plus()");
- return ;
- } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {
-- CatPrint (Str, L"VenUft8()");
-+ MyCatPrint (Str, L"VenUft8()");
- return ;
- } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) {
- FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);
- switch (FlowControlMap & 0x00000003) {
- case 0:
-- CatPrint (Str, L"UartFlowCtrl(%s)", L"None");
-+ MyCatPrint (Str, L"UartFlowCtrl(%s)", L"None");
- break;
-
- case 1:
-- CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware");
-+ MyCatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware");
- break;
-
- case 2:
-- CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff");
-+ MyCatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff");
- break;
-
- default:
-@@ -237,7 +237,7 @@ DevPathVendor (
- } else
- */
- if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"SAS(%lx,%lx,%x,",
- ((SAS_DEVICE_PATH *) Vendor)->SasAddress,
-@@ -246,9 +246,9 @@ DevPathVendor (
- );
- Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology);
- if ((Info & 0x0f) == 0) {
-- CatPrint (Str, L"NoTopology,0,0,0,");
-+ MyCatPrint (Str, L"NoTopology,0,0,0,");
- } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) {
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"%s,%s,%s,",
- ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",
-@@ -256,19 +256,19 @@ DevPathVendor (
- ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"
- );
- if ((Info & 0x0f) == 1) {
-- CatPrint (Str, L"0,");
-+ MyCatPrint (Str, L"0,");
- } else {
-- CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff));
-+ MyCatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff));
- }
- } else {
-- CatPrint (Str, L"0,0,0,0,");
-+ MyCatPrint (Str, L"0,0,0,0,");
- }
-
-- CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);
-+ MyCatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);
- return ;
-
- } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) {
-- CatPrint (Str, L"DebugPort()");
-+ MyCatPrint (Str, L"DebugPort()");
- return ;
- }
- break;
-@@ -282,15 +282,15 @@ DevPathVendor (
- break;
- }
-
-- CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid);
-+ MyCatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid);
- DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH);
- if (DataLength > 0) {
-- CatPrint (Str, L",");
-+ MyCatPrint (Str, L",");
- for (Index = 0; Index < DataLength; Index++) {
-- CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);
-+ MyCatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);
- }
- }
-- CatPrint (Str, L")");
-+ MyCatPrint (Str, L")");
- }
-
- /**
-@@ -313,9 +313,9 @@ DevPathAcpi (
-
- Acpi = DevPath;
- if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
-- CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);
-+ MyCatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);
- } else {
-- CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);
-+ MyCatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);
- }
- }
-
-@@ -388,50 +388,50 @@ DevPathExtendedAcpi (
- }
-
- if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) {
-- CatPrint (Str, L"AcpiExp(");
-+ MyCatPrint (Str, L"AcpiExp(");
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
-- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
-+ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
- } else {
-- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
-+ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
- }
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
-- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
-+ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
- } else {
-- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
-+ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
- }
- if (UIDSTRIdx != 0) {
-- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
-+ MyCatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
- } else {
-- CatPrint (Str, L"\"\")");
-+ MyCatPrint (Str, L"\"\")");
- }
- } else {
-- CatPrint (Str, L"AcpiEx(");
-+ MyCatPrint (Str, L"AcpiEx(");
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
-- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
-+ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));
- } else {
-- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
-+ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);
- }
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
-- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
-+ MyCatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));
- } else {
-- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
-+ MyCatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);
- }
-- CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID);
-+ MyCatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID);
-
- if (HIDSTRIdx != 0) {
-- CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx);
-+ MyCatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx);
- } else {
-- CatPrint (Str, L"\"\",");
-+ MyCatPrint (Str, L"\"\",");
- }
- if (CIDSTRIdx != 0) {
-- CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx);
-+ MyCatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx);
- } else {
-- CatPrint (Str, L"\"\",");
-+ MyCatPrint (Str, L"\"\",");
- }
- if (UIDSTRIdx != 0) {
-- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
-+ MyCatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);
- } else {
-- CatPrint (Str, L"\"\")");
-+ MyCatPrint (Str, L"\"\")");
- }
- }
-
-@@ -462,11 +462,11 @@ DevPathAdrAcpi (
- Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr);
- AdditionalAdrCount = (UINT16) ((Length - 8) / 4);
-
-- CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR);
-+ MyCatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR);
- for (Index = 0; Index < AdditionalAdrCount; Index++) {
-- CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));
-+ MyCatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));
- }
-- CatPrint (Str, L")");
-+ MyCatPrint (Str, L")");
- }
-
- /**
-@@ -488,7 +488,7 @@ DevPathAtapi (
- ATAPI_DEVICE_PATH *Atapi;
-
- Atapi = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"Ata(%s,%s)",
- (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary",
-@@ -515,7 +515,7 @@ DevPathScsi (
- SCSI_DEVICE_PATH *Scsi;
-
- Scsi = DevPath;
-- CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);
-+ MyCatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);
- }
-
- /**
-@@ -537,7 +537,7 @@ DevPathFibre (
- FIBRECHANNEL_DEVICE_PATH *Fibre;
-
- Fibre = DevPath;
-- CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun);
-+ MyCatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun);
- }
-
- /**
-@@ -559,7 +559,7 @@ DevPath1394 (
- F1394_DEVICE_PATH *F1394Path;
-
- F1394Path = DevPath;
-- CatPrint (Str, L"1394(%lx)", &F1394Path->Guid);
-+ MyCatPrint (Str, L"1394(%lx)", &F1394Path->Guid);
- }
-
- /**
-@@ -581,7 +581,7 @@ DevPathUsb (
- USB_DEVICE_PATH *Usb;
-
- Usb = DevPath;
-- CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber);
-+ MyCatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber);
- }
-
- /**
-@@ -603,7 +603,7 @@ DevPathUsbWWID (
- USB_WWID_DEVICE_PATH *UsbWWId;
-
- UsbWWId = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"UsbWwid(%x,%x,%x,\"WWID\")",
- (UINTN) UsbWWId->VendorId,
-@@ -631,7 +631,7 @@ DevPathLogicalUnit (
- DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit;
-
- LogicalUnit = DevPath;
-- CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun);
-+ MyCatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun);
- }
-
- /**
-@@ -653,7 +653,7 @@ DevPathUsbClass (
- USB_CLASS_DEVICE_PATH *UsbClass;
-
- UsbClass = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"Usb Class(%x,%x,%x,%x,%x)",
- (UINTN) UsbClass->VendorId,
-@@ -684,14 +684,14 @@ DevPathSata (
-
- Sata = DevPath;
- if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"Sata(%x,%x)",
- (UINTN) Sata->HBAPortNumber,
- (UINTN) Sata->Lun
- );
- } else {
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"Sata(%x,%x,%x)",
- (UINTN) Sata->HBAPortNumber,
-@@ -720,7 +720,7 @@ DevPathI2O (
- I2O_DEVICE_PATH *I2OPath;
-
- I2OPath = DevPath;
-- CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid);
-+ MyCatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid);
- }
-
- /**
-@@ -750,13 +750,13 @@ DevPathMacAddr (
- HwAddressSize = 6;
- }
-
-- CatPrint (Str, L"Mac(");
-+ MyCatPrint (Str, L"Mac(");
-
- for (Index = 0; Index < HwAddressSize; Index++) {
-- CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]);
-+ MyCatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]);
- }
-
-- CatPrint (Str, L")");
-+ MyCatPrint (Str, L")");
- }
-
- /**
-@@ -778,7 +778,7 @@ DevPathIPv4 (
- IPv4_DEVICE_PATH *IPDevPath;
-
- IPDevPath = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"IPv4(%d.%d.%d.%d:%d)",
- (UINTN) IPDevPath->RemoteIpAddress.Addr[0],
-@@ -808,7 +808,7 @@ DevPathIPv6 (
- IPv6_DEVICE_PATH *IPv6DevPath;
-
- IPv6DevPath = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0],
-@@ -849,7 +849,7 @@ DevPathInfiniBand (
- INFINIBAND_DEVICE_PATH *InfiniBand;
-
- InfiniBand = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"Infiniband(%x,%g,%lx,%lx,%lx)",
- (UINTN) InfiniBand->ResourceFlags,
-@@ -911,36 +911,36 @@ DevPathUart (
- }
-
- if (Uart->BaudRate == 0) {
-- CatPrint (Str, L"Uart(DEFAULT,%c,", Parity);
-+ MyCatPrint (Str, L"Uart(DEFAULT,%c,", Parity);
- } else {
-- CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity);
-+ MyCatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity);
- }
-
- if (Uart->DataBits == 0) {
-- CatPrint (Str, L"D,");
-+ MyCatPrint (Str, L"D,");
- } else {
-- CatPrint (Str, L"%d,", (UINTN) Uart->DataBits);
-+ MyCatPrint (Str, L"%d,", (UINTN) Uart->DataBits);
- }
-
- switch (Uart->StopBits) {
- case 0:
-- CatPrint (Str, L"D)");
-+ MyCatPrint (Str, L"D)");
- break;
-
- case 1:
-- CatPrint (Str, L"1)");
-+ MyCatPrint (Str, L"1)");
- break;
-
- case 2:
-- CatPrint (Str, L"1.5)");
-+ MyCatPrint (Str, L"1.5)");
- break;
-
- case 3:
-- CatPrint (Str, L"2)");
-+ MyCatPrint (Str, L"2)");
- break;
-
- default:
-- CatPrint (Str, L"x)");
-+ MyCatPrint (Str, L"x)");
- break;
- }
- }
-@@ -965,7 +965,7 @@ DevPathiSCSI (
- UINT16 Options;
-
- IScsi = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"iSCSI(%a,%x,%lx,",
- IScsi->TargetName,
-@@ -974,18 +974,18 @@ DevPathiSCSI (
- );
-
- Options = IScsi->LoginOption;
-- CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");
-- CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");
-+ MyCatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");
-+ MyCatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");
- if (((Options >> 11) & 0x0001) != 0) {
-- CatPrint (Str, L"%s,", L"None");
-+ MyCatPrint (Str, L"%s,", L"None");
- } else if (((Options >> 12) & 0x0001) != 0) {
-- CatPrint (Str, L"%s,", L"CHAP_UNI");
-+ MyCatPrint (Str, L"%s,", L"CHAP_UNI");
- } else {
-- CatPrint (Str, L"%s,", L"CHAP_BI");
-+ MyCatPrint (Str, L"%s,", L"CHAP_BI");
-
- }
-
-- CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved");
-+ MyCatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved");
- }
-
- /**
-@@ -1007,7 +1007,7 @@ DevPathVlan (
- VLAN_DEVICE_PATH *Vlan;
-
- Vlan = DevPath;
-- CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);
-+ MyCatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);
- }
-
- /**
-@@ -1031,7 +1031,7 @@ DevPathHardDrive (
- Hd = DevPath;
- switch (Hd->SignatureType) {
- case SIGNATURE_TYPE_MBR:
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"HD(Part%d,Sig%08x)",
- (UINTN) Hd->PartitionNumber,
-@@ -1040,7 +1040,7 @@ DevPathHardDrive (
- break;
-
- case SIGNATURE_TYPE_GUID:
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"HD(Part%d,Sig%g)",
- (UINTN) Hd->PartitionNumber,
-@@ -1049,7 +1049,7 @@ DevPathHardDrive (
- break;
-
- default:
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"HD(Part%d,MBRType=%02x,SigType=%02x)",
- (UINTN) Hd->PartitionNumber,
-@@ -1079,7 +1079,7 @@ DevPathCDROM (
- CDROM_DEVICE_PATH *Cd;
-
- Cd = DevPath;
-- CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry);
-+ MyCatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry);
- }
-
- /**
-@@ -1101,7 +1101,7 @@ DevPathFilePath (
- FILEPATH_DEVICE_PATH *Fp;
-
- Fp = DevPath;
-- CatPrint (Str, L"%s", Fp->PathName);
-+ MyCatPrint (Str, L"%s", Fp->PathName);
- }
-
- /**
-@@ -1123,7 +1123,7 @@ DevPathMediaProtocol (
- MEDIA_PROTOCOL_DEVICE_PATH *MediaProt;
-
- MediaProt = DevPath;
-- CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);
-+ MyCatPrint (Str, L"Media(%g)", &MediaProt->Protocol);
- }
-
- /**
-@@ -1145,7 +1145,7 @@ DevPathFvFilePath (
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath;
-
- FvFilePath = DevPath;
-- CatPrint (Str, L"%g", &FvFilePath->FvFileName);
-+ MyCatPrint (Str, L"%g", &FvFilePath->FvFileName);
- }
-
- /**
-@@ -1167,7 +1167,7 @@ MyDevPathRelativeOffsetRange (
- MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
-
- Offset = DevPath;
-- CatPrint (
-+ MyCatPrint (
- Str,
- L"Offset(%lx,%lx)",
- Offset->StartingOffset,
-@@ -1228,7 +1228,7 @@ DevPathBssBss (
- Type = L"?";
- break;
- }
-- CatPrint (Str, L"Legacy-%s", Type);
-+ MyCatPrint (Str, L"Legacy-%s", Type);
- }
-
- /**
-@@ -1247,7 +1247,7 @@ DevPathEndInstance (
- IN VOID *DevPath
- )
- {
-- CatPrint (Str, L",");
-+ MyCatPrint (Str, L",");
- }
-
- /**
-@@ -1266,7 +1266,7 @@ DevPathNodeUnknown (
- IN VOID *DevPath
- )
- {
-- CatPrint (Str, L"?");
-+ MyCatPrint (Str, L"?");
- }
- /**
- Convert Device Path to a Unicode string for printing.
-@@ -1287,7 +1287,7 @@ DevPathFvPath (
- MEDIA_FW_VOL_DEVICE_PATH *FvPath;
-
- FvPath = DevPath;
-- CatPrint (Str, L"Fv(%g)", &FvPath->FvName);
-+ MyCatPrint (Str, L"Fv(%g)", &FvPath->FvName);
- }
-
- DEVICE_PATH_STRING_TABLE DevPathTable[] = {
-@@ -1553,7 +1553,7 @@ DevicePathToStr (
- // Put a path seperator in if needed
- //
- if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) {
-- CatPrint (&Str, L"/");
-+ MyCatPrint (&Str, L"/");
- }
- //
- // Print this node of the device path
-diff --git a/EfiLib/GenericBdsLib.h b/EfiLib/GenericBdsLib.h
-index be4325b..afc10cb 100644
---- a/EfiLib/GenericBdsLib.h
-+++ b/EfiLib/GenericBdsLib.h
-@@ -872,11 +872,6 @@ BdsLibSaveMemoryTypeInformation (
- @retval EFI_ACCESS_DENIED The user was not successfully identified.
-
- **/
--// EFI_STATUS
--// EFIAPI
--// BdsLibUserIdentify (
--// OUT EFI_USER_PROFILE_HANDLE *User
--// );
-
- /**
- This function checks if a Fv file device path is valid, according to a file GUID. If it is invalid,
-@@ -961,7 +956,7 @@ DevPathVendor (
-
- CHAR16 *
- EFIAPI
--CatPrint (
-+MyCatPrint (
- IN OUT POOL_PRINT *Str,
- IN CHAR16 *Fmt,
- ...
-diff --git a/EfiLib/gnuefi-helper.c b/EfiLib/gnuefi-helper.c
-index d4f269d..f8cd9a3 100644
---- a/EfiLib/gnuefi-helper.c
-+++ b/EfiLib/gnuefi-helper.c
-@@ -21,7 +21,6 @@
- #include "LegacyBios.h"
-
- EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = { 0x09576E91, 0x6D3F, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
--EFI_GUID gEfiGlobalVariableGuid = { 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }};
- EFI_GUID gEfiLegacyBiosProtocolGuid = { 0xdb9a1e3d, 0x45cb, 0x4abb, { 0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d }};
-
- /**
-diff --git a/EfiLib/legacy.c b/EfiLib/legacy.c
-index 3e5edee..271b948 100644
---- a/EfiLib/legacy.c
-+++ b/EfiLib/legacy.c
-@@ -36,6 +36,7 @@ UINTN mBootOptionBbsMappingCount = 0;
- extern EFI_DEVICE_PATH EndDevicePath[];
- extern EFI_GUID gEfiLegacyBiosProtocolGuid;
- EFI_GUID gEfiLegacyDevOrderVariableGuid = { 0xa56074db, 0x65fe, 0x45f7, {0xbd, 0x21, 0x2d, 0x2b, 0xdd, 0x8e, 0x96, 0x52 }};
-+static EFI_GUID EfiGlobalVariableGuid = { 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }};
-
- /**
-
-@@ -276,7 +277,7 @@ BdsFindLegacyBootOptionByDevTypeAndName (
- UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", (UINTN) BootOrder[Index]);
- BootOptionVar = BdsLibGetVariableAndSize (
- BootOption,
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- &BootOptionSize
- );
- if (NULL == BootOptionVar) {
-@@ -462,7 +463,7 @@ BdsCreateLegacyBootOption (
-
- Status = refit_call5_wrapper(gRT->SetVariable,
- BootString,
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- VAR_FLAG,
- BufferSize,
- Buffer
-@@ -747,7 +748,7 @@ BdsAddNonExistingLegacyBootOptions (
-
- BootOrder = BdsLibGetVariableAndSize (
- L"BootOrder",
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- &BootOrderSize
- );
- if (BootOrder == NULL) {
-@@ -817,13 +818,13 @@ BdsAddNonExistingLegacyBootOptions (
- if (BootOrderSize > 0) {
- Status = refit_call5_wrapper(gRT->SetVariable,
- L"BootOrder",
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- VAR_FLAG,
- BootOrderSize,
- BootOrder
- );
- } else {
-- EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
-+ EfiLibDeleteVariable (L"BootOrder", &EfiGlobalVariableGuid);
- }
-
- if (BootOrder != NULL) {
-@@ -861,7 +862,7 @@ BdsDeleteBootOption (
- Index2Del = 0;
-
- UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", OptionNumber);
-- Status = EfiLibDeleteVariable (BootOption, &gEfiGlobalVariableGuid);
-+ Status = EfiLibDeleteVariable (BootOption, &EfiGlobalVariableGuid);
-
- //
- // adjust boot order array
-@@ -940,7 +941,7 @@ BdsDeleteAllInvalidLegacyBootOptions (
-
- BootOrder = BdsLibGetVariableAndSize (
- L"BootOrder",
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- &BootOrderSize
- );
- if (BootOrder == NULL) {
-@@ -952,14 +953,14 @@ BdsDeleteAllInvalidLegacyBootOptions (
- UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", BootOrder[Index]);
- BootOptionVar = BdsLibGetVariableAndSize (
- BootOption,
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- &BootOptionSize
- );
- if (NULL == BootOptionVar) {
- BootOptionSize = 0;
- Status = refit_call5_wrapper(gRT->GetVariable,
- BootOption,
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- NULL,
- &BootOptionSize,
- BootOptionVar
-@@ -1035,13 +1036,13 @@ BdsDeleteAllInvalidLegacyBootOptions (
- if (BootOrderSize != 0) {
- Status = refit_call5_wrapper(gRT->SetVariable,
- L"BootOrder",
-- &gEfiGlobalVariableGuid,
-+ &EfiGlobalVariableGuid,
- VAR_FLAG,
- BootOrderSize,
- BootOrder
- );
- } else {
-- EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
-+ EfiLibDeleteVariable (L"BootOrder", &EfiGlobalVariableGuid);
- }
-
- if (BootOrder != NULL) {
-diff --git a/filesystems/edk2/DriverBinding.h b/filesystems/edk2/DriverBinding.h
-index fdb16c5..c2de33a 100644
---- a/filesystems/edk2/DriverBinding.h
-+++ b/filesystems/edk2/DriverBinding.h
-@@ -21,30 +21,32 @@ Revision History
-
- --*/
-
-+/*
-+ * rEFInd NOTE: This file is included only when compiling with GNU-EFI,
-+ * which has not traditionally provided the definitions supplied here.
-+ * Unfortunately, recent (ca. 3.0.5) versions of GNU-EFI have added
-+ * SOME of these functions to an existing header file, creating problems
-+ * when trying to maintain compatibility with multiple GNU-EFI versions.
-+ * I've therefore renamed the relevant defines, types, and functions,
-+ * both here and in fsw_efi.c; and included a define to match the only
-+ * used name (REFIND_EFI_DRIVER_BINDING_PROTOCOL) to the traditional
-+ * name (EFI_DRIVER_BINDING_PROTOCOL) in fsw_efi.c for compiling with
-+ * TianoCore.
-+ */
-+
- #ifndef _EFI_DRIVER_BINDING_H_
- #define _EFI_DRIVER_BINDING_H_
-
- #include <efidevp.h>
-
--//
--// Global ID for the ControllerHandle Driver Protocol
--//
--#define EFI_DRIVER_BINDING_PROTOCOL_GUID \
-+#define REFIND_EFI_DRIVER_BINDING_PROTOCOL_GUID \
- { \
- 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71} \
- }
-
- #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
-
--EFI_FORWARD_DECLARATION (EFI_DRIVER_BINDING_PROTOCOL);
--
--///
--/// Device Path protocol.
--///
--#define EFI_DEVICE_PATH_PROTOCOL_GUID \
-- { \
-- 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-- }
-+EFI_FORWARD_DECLARATION (REFIND_EFI_DRIVER_BINDING_PROTOCOL);
-
- // Begin included from DevicePath.h....
-
-@@ -79,18 +81,19 @@ typedef struct {
- UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
- ///< type of data. Size of data is included in Length.
-
--} EFI_DEVICE_PATH_PROTOCOL;
-+} REFIND_EFI_DEVICE_PATH_PROTOCOL;
-
- #pragma pack()
-
-+
- // End included from DevicePath.h
-
- typedef
- EFI_STATUS
- (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (
-- IN EFI_DRIVER_BINDING_PROTOCOL * This,
-+ IN REFIND_EFI_DRIVER_BINDING_PROTOCOL * This,
- IN EFI_HANDLE ControllerHandle,
-- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
-+ IN REFIND_EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
- )
- /*++
-
-@@ -114,9 +117,9 @@ EFI_STATUS
- typedef
- EFI_STATUS
- (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_START) (
-- IN EFI_DRIVER_BINDING_PROTOCOL * This,
-+ IN REFIND_EFI_DRIVER_BINDING_PROTOCOL * This,
- IN EFI_HANDLE ControllerHandle,
-- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
-+ IN REFIND_EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
- )
- /*++
-
-@@ -140,7 +143,7 @@ EFI_STATUS
- typedef
- EFI_STATUS
- (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_STOP) (
-- IN EFI_DRIVER_BINDING_PROTOCOL * This,
-+ IN REFIND_EFI_DRIVER_BINDING_PROTOCOL * This,
- IN EFI_HANDLE ControllerHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE * ChildHandleBuffer
-@@ -167,7 +170,7 @@ EFI_STATUS
- //
- // Interface structure for the ControllerHandle Driver Protocol
- //
--struct _EFI_DRIVER_BINDING_PROTOCOL {
-+struct _REFIND_EFI_DRIVER_BINDING_PROTOCOL {
- EFI_DRIVER_BINDING_SUPPORTED Supported;
- EFI_DRIVER_BINDING_START Start;
- EFI_DRIVER_BINDING_STOP Stop;
-diff --git a/filesystems/fsw_efi.c b/filesystems/fsw_efi.c
-index a7257fa..635985e 100644
---- a/filesystems/fsw_efi.c
-+++ b/filesystems/fsw_efi.c
-@@ -43,9 +43,18 @@
- #ifdef __MAKEWITH_GNUEFI
- #include "edk2/DriverBinding.h"
- #include "edk2/ComponentName.h"
-+#define gMyEfiSimpleFileSystemProtocolGuid FileSystemProtocol
- #else
-+#define REFIND_EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL
- #define REFIND_EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL
-+#define REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID EFI_COMPONENT_NAME_PROTOCOL_GUID
-+#define REFIND_EFI_DRIVER_BINDING_PROTOCOL_GUID EFI_DRIVER_BINDING_PROTOCOL_GUID
-+#define REFIND_EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL
-+#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
-+ { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
-+#define gMyEfiSimpleFileSystemProtocolGuid gEfiSimpleFileSystemProtocolGuid
- #endif
-+
- #include "../include/refit_call_wrapper.h"
-
- #define DEBUG_LEVEL 0
-@@ -55,27 +64,13 @@
- #define FSTYPE ext2
- #endif
-
--#ifdef __MAKEWITH_GNUEFI
--
--#define EFI_DISK_IO_PROTOCOL_GUID \
-- { \
-- 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-- }
--
--#define EFI_BLOCK_IO_PROTOCOL_GUID \
-- { \
-- 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-- }
--
--EFI_GUID gEfiDriverBindingProtocolGuid = EFI_DRIVER_BINDING_PROTOCOL_GUID;
--EFI_GUID gEfiComponentNameProtocolGuid = REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID;
--EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID;
--EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
--EFI_GUID gEfiFileInfoGuid = EFI_FILE_INFO_ID;
--EFI_GUID gEfiFileSystemInfoGuid = EFI_FILE_SYSTEM_INFO_ID;
--EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
--#define gEfiSimpleFileSystemProtocolGuid FileSystemProtocol
--#endif
-+EFI_GUID gMyEfiDriverBindingProtocolGuid = REFIND_EFI_DRIVER_BINDING_PROTOCOL_GUID;
-+EFI_GUID gMyEfiComponentNameProtocolGuid = REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID;
-+EFI_GUID gMyEfiDiskIoProtocolGuid = REFIND_EFI_DISK_IO_PROTOCOL_GUID;
-+EFI_GUID gMyEfiBlockIoProtocolGuid = REFIND_EFI_BLOCK_IO_PROTOCOL_GUID;
-+EFI_GUID gMyEfiFileInfoGuid = EFI_FILE_INFO_ID;
-+EFI_GUID gMyEfiFileSystemInfoGuid = EFI_FILE_SYSTEM_INFO_ID;
-+EFI_GUID gMyEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
-
- /** Helper macro for stringification. */
- #define FSW_EFI_STRINGIFY(x) #x
-@@ -84,25 +79,25 @@ EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO
-
- // function prototypes
-
--EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL *This,
-- IN EFI_HANDLE ControllerHandle,
-- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
--EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *This,
-- IN EFI_HANDLE ControllerHandle,
-- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
--EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *This,
-- IN EFI_HANDLE ControllerHandle,
-- IN UINTN NumberOfChildren,
-- IN EFI_HANDLE *ChildHandleBuffer);
-+EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
-+ IN EFI_HANDLE ControllerHandle,
-+ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
-+EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
-+ IN EFI_HANDLE ControllerHandle,
-+ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath);
-+EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
-+ IN EFI_HANDLE ControllerHandle,
-+ IN UINTN NumberOfChildren,
-+ IN EFI_HANDLE *ChildHandleBuffer);
-
- EFI_STATUS EFIAPI fsw_efi_ComponentName_GetDriverName(IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
-- IN CHAR8 *Language,
-- OUT CHAR16 **DriverName);
--EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
-- IN EFI_HANDLE ControllerHandle,
-- IN EFI_HANDLE ChildHandle OPTIONAL,
-- IN CHAR8 *Language,
-- OUT CHAR16 **ControllerName);
-+ IN CHAR8 *Language,
-+ OUT CHAR16 **DriverName);
-+EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
-+ IN EFI_HANDLE ControllerHandle,
-+ IN EFI_HANDLE ChildHandle OPTIONAL,
-+ IN CHAR8 *Language,
-+ OUT CHAR16 **ControllerName);
-
- void EFIAPI fsw_efi_change_blocksize(struct fsw_volume *vol,
- fsw_u32 old_phys_blocksize, fsw_u32 old_log_blocksize,
-@@ -164,7 +159,7 @@ static int LastRead = -1;
- * Interface structure for the EFI Driver Binding protocol.
- */
-
--EFI_DRIVER_BINDING_PROTOCOL fsw_efi_DriverBinding_table = {
-+REFIND_EFI_DRIVER_BINDING_PROTOCOL fsw_efi_DriverBinding_table = {
- fsw_efi_DriverBinding_Supported,
- fsw_efi_DriverBinding_Start,
- fsw_efi_DriverBinding_Stop,
-@@ -233,7 +228,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE ImageHandle,
- fsw_efi_DriverBinding_table.DriverBindingHandle = ImageHandle;
- // install Driver Binding protocol
- Status = refit_call4_wrapper(BS->InstallProtocolInterface, &fsw_efi_DriverBinding_table.DriverBindingHandle,
-- &gEfiDriverBindingProtocolGuid,
-+ &gMyEfiDriverBindingProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &fsw_efi_DriverBinding_table);
- if (EFI_ERROR (Status)) {
-@@ -242,7 +237,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE ImageHandle,
-
- // install Component Name protocol
- Status = refit_call4_wrapper(BS->InstallProtocolInterface, &fsw_efi_DriverBinding_table.DriverBindingHandle,
-- &gEfiComponentNameProtocolGuid,
-+ &gMyEfiComponentNameProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &fsw_efi_ComponentName_table);
- if (EFI_ERROR (Status)) {
-@@ -272,9 +267,9 @@ EFI_DRIVER_ENTRY_POINT(fsw_efi_main)
- * and implicitly checks if the disk is already in use by another driver.
- */
-
--EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL *This,
-+EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
-- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
-+ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
- {
- EFI_STATUS Status;
- EFI_DISK_IO *DiskIo;
-@@ -283,7 +278,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
-
- // first, open DiskIO
- Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-- &gEfiDiskIoProtocolGuid,
-+ &gMyEfiDiskIoProtocolGuid,
- (VOID **) &DiskIo,
- This->DriverBindingHandle,
- ControllerHandle,
-@@ -293,13 +288,13 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
-
- // we were just checking, close it again
- refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
-- &gEfiDiskIoProtocolGuid,
-+ &gMyEfiDiskIoProtocolGuid,
- This->DriverBindingHandle,
- ControllerHandle);
-
- // next, check BlockIO without actually opening it
- Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-- &gEfiBlockIoProtocolGuid,
-+ &gMyEfiBlockIoProtocolGuid,
- NULL,
- This->DriverBindingHandle,
- ControllerHandle,
-@@ -320,9 +315,9 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
- * device handle.
- */
-
--EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *This,
-+EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
-- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
-+ IN REFIND_EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
- {
- EFI_STATUS Status;
- EFI_BLOCK_IO *BlockIo;
-@@ -335,7 +330,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
-
- // open consumed protocols
- Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-- &gEfiBlockIoProtocolGuid,
-+ &gMyEfiBlockIoProtocolGuid,
- (VOID **) &BlockIo,
- This->DriverBindingHandle,
- ControllerHandle,
-@@ -346,7 +341,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
- }
-
- Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-- &gEfiDiskIoProtocolGuid,
-+ &gMyEfiDiskIoProtocolGuid,
- (VOID **) &DiskIo,
- This->DriverBindingHandle,
- ControllerHandle,
-@@ -373,7 +368,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
- Volume->FileSystem.Revision = EFI_FILE_IO_INTERFACE_REVISION;
- Volume->FileSystem.OpenVolume = fsw_efi_FileSystem_OpenVolume;
- Status = refit_call4_wrapper(BS->InstallMultipleProtocolInterfaces, &ControllerHandle,
-- &gEfiSimpleFileSystemProtocolGuid,
-+ &gMyEfiSimpleFileSystemProtocolGuid,
- &Volume->FileSystem,
- NULL);
- if (EFI_ERROR(Status)) {
-@@ -388,7 +383,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
- FreePool(Volume);
-
- refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
-- &gEfiDiskIoProtocolGuid,
-+ &gMyEfiDiskIoProtocolGuid,
- This->DriverBindingHandle,
- ControllerHandle);
- }
-@@ -405,7 +400,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL *T
- * case; it closes all file handles between commands.
- */
-
--EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *This,
-+EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN REFIND_EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer)
-@@ -420,7 +415,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *T
-
- // get the installed SimpleFileSystem interface
- Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-- &gEfiSimpleFileSystemProtocolGuid,
-+ &gMyEfiSimpleFileSystemProtocolGuid,
- (VOID **) &FileSystem,
- This->DriverBindingHandle,
- ControllerHandle,
-@@ -433,7 +428,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *T
-
- // uninstall Simple File System protocol
- Status = refit_call4_wrapper(BS->UninstallMultipleProtocolInterfaces, ControllerHandle,
-- &gEfiSimpleFileSystemProtocolGuid, &Volume->FileSystem,
-+ &gMyEfiSimpleFileSystemProtocolGuid, &Volume->FileSystem,
- NULL);
- if (EFI_ERROR(Status)) {
- // Print(L"Fsw ERROR: UninstallMultipleProtocolInterfaces returned %x\n", Status);
-@@ -450,7 +445,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DRIVER_BINDING_PROTOCOL *T
-
- // close the consumed protocols
- Status = refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
-- &gEfiDiskIoProtocolGuid,
-+ &gMyEfiDiskIoProtocolGuid,
- This->DriverBindingHandle,
- ControllerHandle);
-
-@@ -1027,14 +1022,14 @@ EFI_STATUS fsw_efi_dnode_getinfo(IN FSW_FILE_DATA *File,
- struct fsw_volume_stat vsb;
-
-
-- if (CompareGuid(InformationType, &gEfiFileInfoGuid)) {
-+ if (CompareGuid(InformationType, &gMyEfiFileInfoGuid)) {
- #if DEBUG_LEVEL
- Print(L"fsw_efi_dnode_getinfo: FILE_INFO\n");
- #endif
-
- Status = fsw_efi_dnode_fill_FileInfo(Volume, File->shand.dnode, BufferSize, Buffer);
-
-- } else if (CompareGuid(InformationType, &gEfiFileSystemInfoGuid)) {
-+ } else if (CompareGuid(InformationType, &gMyEfiFileSystemInfoGuid)) {
- #if DEBUG_LEVEL
- Print(L"fsw_efi_dnode_getinfo: FILE_SYSTEM_INFO\n");
- #endif
-@@ -1065,7 +1060,7 @@ EFI_STATUS fsw_efi_dnode_getinfo(IN FSW_FILE_DATA *File,
- *BufferSize = RequiredSize;
- Status = EFI_SUCCESS;
-
-- } else if (CompareGuid(InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {
-+ } else if (CompareGuid(InformationType, &gMyEfiFileSystemVolumeLabelInfoIdGuid)) {
- #if DEBUG_LEVEL
- Print(L"fsw_efi_dnode_getinfo: FILE_SYSTEM_VOLUME_LABEL\n");
- #endif
-diff --git a/filesystems/fsw_efi.h b/filesystems/fsw_efi.h
-index c3b7a3c..d9442ef 100644
---- a/filesystems/fsw_efi.h
-+++ b/filesystems/fsw_efi.h
-@@ -44,6 +44,16 @@
- #define CompareGuid(a, b) CompareGuid(a, b)==0
- #endif
-
-+#define REFIND_EFI_DISK_IO_PROTOCOL_GUID \
-+ { \
-+ 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-+ }
-+
-+#define REFIND_EFI_BLOCK_IO_PROTOCOL_GUID \
-+ { \
-+ 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-+ }
-+
- /**
- * EFI Host: Private per-volume structure.
- */
-diff --git a/filesystems/scandisk.c b/filesystems/scandisk.c
-index d8b862a..ddd6908 100644
---- a/filesystems/scandisk.c
-+++ b/filesystems/scandisk.c
-@@ -24,8 +24,11 @@
- #ifdef __MAKEWITH_GNUEFI
- #include "edk2/DriverBinding.h"
- #include "edk2/ComponentName.h"
--extern EFI_GUID gEfiDiskIoProtocolGuid;
--extern EFI_GUID gEfiBlockIoProtocolGuid;
-+extern EFI_GUID gMyEfiDiskIoProtocolGuid;
-+extern EFI_GUID gMyEfiBlockIoProtocolGuid;
-+#else
-+#define gMyEfiBlockIoProtocolGuid gEfiBlockIoProtocolGuid
-+#define gMyEfiDiskIoProtocolGuid gEfiDiskIoProtocolGuid
- #endif
- #include "../include/refit_call_wrapper.h"
-
-@@ -99,16 +102,16 @@ static int scan_disks(int (*hook)(struct fsw_volume *, struct fsw_volume *), str
- Print(L" ");
- #endif
- DPRINT(L"Scanning disks\n");
-- Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &gEfiDiskIoProtocolGuid, NULL, &HandleCount, &Handles);
-+ Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &gMyEfiDiskIoProtocolGuid, NULL, &HandleCount, &Handles);
- if (Status == EFI_NOT_FOUND)
- return -1; // no filesystems. strange, but true...
- for (i = 0; i < HandleCount; i++) {
- EFI_DISK_IO *diskio;
- EFI_BLOCK_IO *blockio;
-- Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiDiskIoProtocolGuid, (VOID **) &diskio);
-+ Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gMyEfiDiskIoProtocolGuid, (VOID **) &diskio);
- if (Status != 0)
- continue;
-- Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiBlockIoProtocolGuid, (VOID **) &blockio);
-+ Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gMyEfiBlockIoProtocolGuid, (VOID **) &blockio);
- if (Status != 0)
- continue;
- struct fsw_volume *vol = create_dummy_volume(diskio, blockio->Media->MediaId);
-diff --git a/refind.conf-sample b/refind.conf-sample
-index 8b5853e..69cef8b 100644
---- a/refind.conf-sample
-+++ b/refind.conf-sample
-@@ -395,7 +395,7 @@ timeout 20
- #default_selection Microsoft
- #default_selection "+,bzImage,vmlinuz"
- #default_selection Maintenance 23:30 2:00
--#default_selection "Maintenance,OS X" 1:00 2:30
-+#default_selection "Maintenance,macOS" 1:00 2:30
-
- # Enable VMX bit and lock the CPU MSR if unlocked.
- # On some Intel Apple computers, the firmware does not lock the MSR 0x3A.
-diff --git a/refind/driver_support.c b/refind/driver_support.c
-index 26c5965..8ab25ff 100644
---- a/refind/driver_support.c
-+++ b/refind/driver_support.c
-@@ -85,37 +85,34 @@
- #define DRIVER_DIRS L"drivers"
- #endif
-
--#ifdef __MAKEWITH_GNUEFI
- // Following "global" constants are from EDK2's AutoGen.c....
--EFI_GUID gEfiLoadedImageProtocolGuid = { 0x5B1B31A1, 0x9562, 0x11D2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
--EFI_GUID gEfiDriverBindingProtocolGuid = { 0x18A031AB, 0xB443, 0x4D1A, { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 }};
--EFI_GUID gEfiDriverConfiguration2ProtocolGuid = { 0xBFD7DC1D, 0x24F1, 0x40D9, { 0x82, 0xE7, 0x2E, 0x09, 0xBB, 0x6B, 0x4E, 0xBE }};
--EFI_GUID gEfiDriverConfigurationProtocolGuid = { 0x107A772B, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
--EFI_GUID gEfiDriverDiagnosticsProtocolGuid = { 0x0784924F, 0xE296, 0x11D4, { 0x9A, 0x49, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
--EFI_GUID gEfiDriverDiagnostics2ProtocolGuid = { 0x4D330321, 0x025F, 0x4AAC, { 0x90, 0xD8, 0x5E, 0xD9, 0x00, 0x17, 0x3B, 0x63 }};
--EFI_GUID gEfiComponentNameProtocolGuid = { 0x107A772C, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
--EFI_GUID gEfiComponentName2ProtocolGuid = { 0x6A7A5CFF, 0xE8D9, 0x4F70, { 0xBA, 0xDA, 0x75, 0xAB, 0x30, 0x25, 0xCE, 0x14 }};
--EFI_GUID gEfiDevicePathProtocolGuid = { 0x09576E91, 0x6D3F, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
--EFI_GUID gEfiDiskIoProtocolGuid = { 0xCE345171, 0xBA0B, 0x11D2, { 0x8E, 0x4F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
--EFI_GUID gEfiBlockIoProtocolGuid = { 0x964E5B21, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
--EFI_GUID gEfiSimpleFileSystemProtocolGuid = { 0x964E5B22, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
--
--struct EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
--struct EFI_FILE_PROTOCOL;
-+EFI_GUID gMyEfiLoadedImageProtocolGuid = { 0x5B1B31A1, 0x9562, 0x11D2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
-+EFI_GUID gMyEfiDriverBindingProtocolGuid = { 0x18A031AB, 0xB443, 0x4D1A, { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 }};
-+EFI_GUID gMyEfiDriverConfigurationProtocolGuid = { 0x107A772B, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
-+EFI_GUID gMyEfiDriverDiagnosticsProtocolGuid = { 0x0784924F, 0xE296, 0x11D4, { 0x9A, 0x49, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
-+EFI_GUID gMyEfiComponentNameProtocolGuid = { 0x107A772C, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};
-+EFI_GUID gMyEfiDevicePathProtocolGuid = { 0x09576E91, 0x6D3F, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
-+EFI_GUID gMyEfiDiskIoProtocolGuid = { 0xCE345171, 0xBA0B, 0x11D2, { 0x8E, 0x4F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
-+EFI_GUID gMyEfiBlockIoProtocolGuid = { 0x964E5B21, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
-+EFI_GUID gMyEfiSimpleFileSystemProtocolGuid = { 0x964E5B22, 0x6459, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
-+
-+#ifdef __MAKEWITH_GNUEFI
-+struct MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
-+struct MY_EFI_FILE_PROTOCOL;
-
- typedef
- EFI_STATUS
--(EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(
-- IN struct EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
-- OUT struct EFI_FILE_PROTOCOL **Root
-+(EFIAPI *MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(
-+ IN struct MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
-+ OUT struct MY_EFI_FILE_PROTOCOL **Root
- );
-
--typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
-+typedef struct _MY_MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
- UINT64 Revision;
-- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
--} EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
-+ MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
-+} MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
-
--typedef struct _EFI_FILE_PROTOCOL {
-+typedef struct _MY_EFI_FILE_PROTOCOL {
- UINT64 Revision;
- EFI_FILE_OPEN Open;
- EFI_FILE_CLOSE Close;
-@@ -127,16 +124,20 @@ typedef struct _EFI_FILE_PROTOCOL {
- EFI_FILE_GET_INFO GetInfo;
- EFI_FILE_SET_INFO SetInfo;
- EFI_FILE_FLUSH Flush;
--} EFI_FILE_PROTOCOL;
-+} MY_EFI_FILE_PROTOCOL;
-
--typedef struct _EFI_BLOCK_IO_PROTOCOL {
-+typedef struct _MY_EFI_BLOCK_IO_PROTOCOL {
- UINT64 Revision;
- EFI_BLOCK_IO_MEDIA *Media;
- EFI_BLOCK_RESET Reset;
- EFI_BLOCK_READ ReadBlocks;
- EFI_BLOCK_WRITE WriteBlocks;
- EFI_BLOCK_FLUSH FlushBlocks;
--} EFI_BLOCK_IO_PROTOCOL;
-+} MY_EFI_BLOCK_IO_PROTOCOL;
-+#else /* Make with Tianocore */
-+#define MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
-+#define MY_EFI_FILE_PROTOCOL EFI_FILE_PROTOCOL
-+#define MY_EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL
- #endif
-
- /* LibScanHandleDatabase() is used by rEFInd's driver-loading code (inherited
-@@ -232,27 +233,27 @@ LibScanHandleDatabase (EFI_HANDLE DriverBindingHandle, OPTIONAL
-
- for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) {
-
-- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid) == 0) {
-+ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiLoadedImageProtocolGuid) == 0) {
- (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_IMAGE_HANDLE;
- }
-
-- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverBindingProtocolGuid) == 0) {
-+ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDriverBindingProtocolGuid) == 0) {
- (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DRIVER_BINDING_HANDLE;
- }
-
-- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfigurationProtocolGuid) == 0) {
-+ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDriverConfigurationProtocolGuid) == 0) {
- (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DRIVER_CONFIGURATION_HANDLE;
- }
-
-- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnosticsProtocolGuid) == 0) {
-+ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDriverDiagnosticsProtocolGuid) == 0) {
- (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DRIVER_DIAGNOSTICS_HANDLE;
- }
-
-- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentNameProtocolGuid) == 0) {
-+ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiComponentNameProtocolGuid) == 0) {
- (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_COMPONENT_NAME_HANDLE;
- }
-
-- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDevicePathProtocolGuid) == 0) {
-+ if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gMyEfiDevicePathProtocolGuid) == 0) {
- (*HandleType)[HandleIndex] |= EFI_HANDLE_TYPE_DEVICE_HANDLE;
- }
- //
-@@ -453,8 +454,8 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
- UINTN Index;
- UINTN OpenInfoIndex;
- EFI_HANDLE *Handles = NULL;
-- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Fs;
-- EFI_BLOCK_IO_PROTOCOL *BlockIo;
-+ MY_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Fs;
-+ MY_EFI_BLOCK_IO_PROTOCOL *BlockIo;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo;
- UINTN OpenInfoCount;
- EFI_HANDLE DriverHandleList[2];
-@@ -464,7 +465,7 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
- //
- Status = refit_call5_wrapper(gBS->LocateHandleBuffer,
- ByProtocol,
-- &gEfiDiskIoProtocolGuid,
-+ &gMyEfiDiskIoProtocolGuid,
- NULL,
- &HandleCount,
- &Handles);
-@@ -483,7 +484,7 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
- //
- Status = refit_call3_wrapper(gBS->HandleProtocol,
- Handles[Index],
-- &gEfiBlockIoProtocolGuid,
-+ &gMyEfiBlockIoProtocolGuid,
- (VOID **) &BlockIo);
- if (EFI_ERROR (Status))
- continue;
-@@ -494,9 +495,9 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
- // If SimpleFileSystem is already produced - skip it, this is ok
- //
- Status = refit_call3_wrapper(gBS->HandleProtocol,
-- Handles[Index],
-- &gEfiSimpleFileSystemProtocolGuid,
-- (VOID **) &Fs);
-+ Handles[Index],
-+ &gMyEfiSimpleFileSystemProtocolGuid,
-+ (VOID **) &Fs);
- if (Status == EFI_SUCCESS)
- continue;
-
-@@ -506,7 +507,7 @@ VOID ConnectFilesystemDriver(EFI_HANDLE DriverHandle) {
- //
- Status = refit_call4_wrapper(gBS->OpenProtocolInformation,
- Handles[Index],
-- &gEfiDiskIoProtocolGuid,
-+ &gMyEfiDiskIoProtocolGuid,
- &OpenInfo,
- &OpenInfoCount);
- if (EFI_ERROR (Status))
-diff --git a/refind/legacy.c b/refind/legacy.c
-index aead421..cd4ee9b 100644
---- a/refind/legacy.c
-+++ b/refind/legacy.c
-@@ -76,6 +76,8 @@ extern REFIT_MENU_SCREEN MainMenu;
- #define DevicePathProtocol gEfiDevicePathProtocolGuid
- #endif
-
-+EFI_GUID EfiGlobalVariableGuid = { 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }};
-+
- static EFI_STATUS ActivateMbrPartition(IN EFI_BLOCK_IO *BlockIO, IN UINTN PartitionIndex)
- {
- EFI_STATUS Status;
-@@ -538,7 +540,7 @@ static VOID ScanLegacyUEFI(IN UINTN DiskType)
- } // if
-
- // Grab the boot order
-- BootOrder = BdsLibGetVariableAndSize(L"BootOrder", &gEfiGlobalVariableGuid, &BootOrderSize);
-+ BootOrder = BdsLibGetVariableAndSize(L"BootOrder", &EfiGlobalVariableGuid, &BootOrderSize);
- if (BootOrder == NULL) {
- BootOrderSize = 0;
- }
---
-2.13.0
-
diff --git a/sys-boot/refind/refind-0.10.7-r1.ebuild b/sys-boot/refind/refind-0.10.7-r1.ebuild
index a17a793c16f..7bbeb09e4d4 100644
--- a/sys-boot/refind/refind-0.10.7-r1.ebuild
+++ b/sys-boot/refind/refind-0.10.7-r1.ebuild
@@ -8,7 +8,8 @@ inherit toolchain-funcs flag-o-matic versionator
DESCRIPTION="The rEFInd UEFI Boot Manager by Rod Smith"
HOMEPAGE="http://www.rodsbooks.com/refind/"
-SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz
+ gnuefi? ( https://dev.gentoo.org/~wraeth/distfiles/${P}-fix_build_gnuefi-3.0.5.patch.xz )"
LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
SLOT="0"
@@ -55,7 +56,7 @@ src_prepare() {
default
# bug 616668 - build fails against gnu-efi-3.0.5
- eapply "${FILESDIR}"/"${P}"-fix_build_gnuefi-3.0.5.patch
+ use gnuefi && eapply "${WORKDIR}"/"${P}"-fix_build_gnuefi-3.0.5.patch
# bug 598647 - PIE not supported
sed -e 's:CFLAGS =:& -fno-PIE:' -i "${S}/Make.common" || die
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/, sys-boot/refind/files/
@ 2022-05-18 15:30 Joonas Niilola
0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2022-05-18 15:30 UTC (permalink / raw
To: gentoo-commits
commit: 2a0355749f736752aad60ea630dedb87df09b3cc
Author: Matt Jolly <Matt.Jolly <AT> footclan <DOT> ninja>
AuthorDate: Fri May 13 12:20:27 2022 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed May 18 15:29:59 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a035574
sys-boot/refind: drop 0.11.4, 0.12.0-r1
Signed-off-by: Matt Jolly <Matt.Jolly <AT> footclan.ninja>
Closes: https://github.com/gentoo/gentoo/pull/25463
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
sys-boot/refind/Manifest | 2 -
sys-boot/refind/files/refind-0.12.0-gcc10.patch | 11 --
sys-boot/refind/refind-0.11.4.ebuild | 168 ------------------------
sys-boot/refind/refind-0.12.0-r1.ebuild | 146 --------------------
4 files changed, 327 deletions(-)
diff --git a/sys-boot/refind/Manifest b/sys-boot/refind/Manifest
index 402f95579a42..9d884c1c9c9d 100644
--- a/sys-boot/refind/Manifest
+++ b/sys-boot/refind/Manifest
@@ -1,4 +1,2 @@
-DIST refind-src-0.11.4.tar.gz 3812192 BLAKE2B 7219eeffffb63961a7ba8f7617546a12021cfe80df80a83c4dbd47cd40b0d8afbdc510abb44de3029ff15ed49372bd59e0b156f4c27eab3ef7bd6ccc3c7e02db SHA512 529962ae432edaf1895ba98deb00a23c66bd742578e1a367f70f7ed22dd7be7daf1960df8af410fba79ca775169120499a4c10119331b2b12b55a002d4354de1
-DIST refind-src-0.12.0.tar.gz 3898337 BLAKE2B 1197049fb7d91db64135dafda7488bdb1da4997ce6a6d49dfe635526240e3193d8c7c22597aee0f2d6754ce6061b4127d8aa21d43c9f061501de98e25de609d3 SHA512 3ade9642d7acf31097daa5308acb96a9fa3371314073b5a09601a886fc30444752efa08ed9fb35e421efb0b4eb9efbccd7b5c9bd6b3b9ed4af74c58f22a74729
DIST refind-src-0.13.2.tar.gz 4554759 BLAKE2B 2c3b1daf5fa100dcd4e1c801aa625e269ae9c1a99b567a271d7cdd30f95fa1e041e22984623b9a0e61f8af45966919f4b9f3a5b6c2026271d1bc37c6925f1e70 SHA512 e671d44385297295c143824dd95593f2e7bc8e282745d127b041a645aa27003467a3a23f368fd30297f33faa06bd914540d7bdc3c71ec42f6b7a38d7ee8e0ddb
DIST refind-src-0.13.3.1.tar.gz 4550242 BLAKE2B ab8dd27f82954ea6f9831f827550f27b5ca426b7783e918311ba7e178fc3509698a0107f61d0394a7893318528cb3e0c8491f4522de0a4aca6a40e0749f5a6f9 SHA512 7966df5dd8dc66cc49a329ed722a567672da8e2fa3f2334d53db65357cea17cba5a4dc5459e358de1079a938da3c63dc626d096ce28b6bf1fa2964be7359dbd1
diff --git a/sys-boot/refind/files/refind-0.12.0-gcc10.patch b/sys-boot/refind/files/refind-0.12.0-gcc10.patch
deleted file mode 100644
index 1f2e2bc0a5de..000000000000
--- a/sys-boot/refind/files/refind-0.12.0-gcc10.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Make.common
-+++ b/Make.common
-@@ -60,7 +60,7 @@
- #
-
- # ...for both GNU-EFI and TianoCore....
--OPTIMFLAGS = -Os -fno-strict-aliasing
-+OPTIMFLAGS = -Os -fno-strict-aliasing -fno-tree-loop-distribute-patterns
- CFLAGS = $(OPTIMFLAGS) -fno-stack-protector -fshort-wchar -Wall
-
- # ...for GNU-EFI....
diff --git a/sys-boot/refind/refind-0.11.4.ebuild b/sys-boot/refind/refind-0.11.4.ebuild
deleted file mode 100644
index 37ad051eba4d..000000000000
--- a/sys-boot/refind/refind-0.11.4.ebuild
+++ /dev/null
@@ -1,168 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multiprocessing toolchain-funcs
-
-DESCRIPTION="The UEFI Boot Manager by Rod Smith"
-HOMEPAGE="https://www.rodsbooks.com/refind/"
-SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
-
-LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
-SLOT="0"
-KEYWORDS="amd64 x86"
-FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
-IUSE="${FS_USE} custom-cflags doc gnuefi"
-
-DEPEND="gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
- !gnuefi? ( >=sys-boot/udk-2018-r1 )"
-
-DOCS=(README.txt)
-PATCHES=("${FILESDIR}/makefile.patch")
-UDK_WORKSPACE="${T}/udk"
-
-pkg_pretend() {
- if use custom-cflags; then
- ewarn
- ewarn "You have enabled building with USE=custom-cflags. Be aware that"
- ewarn "using this can result in EFI binaries that fail to run and may"
- ewarn "fail to build at all. This is strongly advised against by upstream."
- ewarn
- ewarn "See https://bugs.gentoo.org/598587#c3 for more information"
- ewarn
- fi
-}
-
-pkg_setup() {
- if use x86; then
- export EFIARCH=ia32
- export BUILDARCH=ia32
- elif use amd64; then
- export EFIARCH=x64
- export BUILDARCH=x86_64
- fi
-}
-
-src_prepare() {
- default
-
- # bug 598647 - PIE not supported
- sed -e '/^CFLAGS/s:$: -fno-PIE:' -i Make.common || die
-
- # Prepare UDK workspace
- if ! use gnuefi; then
- mkdir "${UDK_WORKSPACE}" || die
- ln -s "${EPREFIX}/usr/lib/udk/"{Mde,IntelFramework}{,Module}Pkg \
- "${UDK_WORKSPACE}" || die "Could not link UDK files"
- fi
-}
-
-src_configure() {
- if ! use gnuefi; then
- # Use the side effect of the script which will create configuration files
- (. udk-workspace "${UDK_WORKSPACE}" || die)
- sed -e "s:^#\?\s*\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$:\1 $(makeopts_jobs):" \
- -i "${UDK_WORKSPACE}/Conf/target.txt" || die "Failed to configure target file"
- sed -e "s:\(_\(CC\|ASM\|PP\|VFRPP\|ASLCC\|ASLPP\|DLINK\)_PATH\s*=\).*$:\1 $(tc-getCC):" \
- -e "s:\(_ASLDLINK_PATH\s*=\).*$:\1 $(tc-getLD):" \
- -e "s:\(_OBJCOPY_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \
- -e "s:\(_RC_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \
- -e "s:\(_SLINK_PATH\s*=\).*$:\1 $(tc-getAR):" \
- -e "s:-Werror::" \
- -i "${UDK_WORKSPACE}/Conf/tools_def.txt" \
- || die "Failed to prepare tools definition file"
- fi
-}
-
-src_compile() {
- # Update fs targets depending on uses
- local fs fs_names=()
- for fs in ${FS_USE}; do
- fs=${fs#+}
- if use "${fs}"; then
- fs_names+=(${fs})
- fi
- done
- use gnuefi && fs_names=("${fs_names[@]/%/_gnuefi}")
-
- # Prepare flags
- local make_flags=(
- ARCH="${BUILDARCH}"
- CC="$(tc-getCC)"
- AS="$(tc-getAS)"
- LD="$(tc-getLD)"
- AR="$(tc-getAR)"
- RANLIB="$(tc-getRANLIB)"
- OBJCOPY="$(tc-getOBJCOPY)"
- GNUEFILIB="/usr/$(get_libdir)"
- EFILIB="/usr/$(get_libdir)"
- EFICRT0="/usr/$(get_libdir)"
- EDK2BASE="${UDK_WORKSPACE}"
- EDK2_DRIVER_BASENAMES="${fs_names[*]}"
- FILESYSTEMS="${fs_names[*]}"
- FILESYSTEMS_GNUEFI="${fs_names[*]}"
- )
- if use custom-cflags; then
- make_flags=(CFLAGS="${CFLAGS}" "${make_flags[@]}")
- fi
-
- emake "${make_flags[@]}" all_$(usex gnuefi gnuefi edk2)
-}
-
-src_install() {
- exeinto "/usr/lib/${PN}"
- doexe refind-install
- dosym "../lib/${PN}/refind-install" "/usr/sbin/refind-install"
-
- if use doc; then
- doman "docs/man/"*
- DOCS+=(NEWS.txt docs/refind docs/Styles)
- fi
- einstalldocs
-
- insinto "/usr/lib/${PN}/refind"
- doins "refind/refind_${EFIARCH}.efi"
- doins "refind.conf-sample"
- doins -r images icons fonts banners
-
- if [[ -d "drivers_${EFIARCH}" ]]; then
- doins -r "drivers_${EFIARCH}"
- fi
-
- insinto "/usr/lib/${PN}/refind/tools_${EFIARCH}"
- doins "gptsync/gptsync_${EFIARCH}.efi"
-
- insinto "/etc/refind.d"
- doins -r "keys"
-
- dosbin "mkrlconf"
- dosbin "mvrefind"
- dosbin "refind-mkdefault"
-}
-
-pkg_postinst() {
- elog "rEFInd has been built and installed into ${EROOT}/usr/lib/${PN}"
- elog "You will need to use the command 'refind-install' to install"
- elog "the binaries into your EFI System Partition"
- elog ""
- if [[ -z "${REPLACING_VERSIONS}" ]]; then
- elog "refind-install requires additional packages to be fully functional:"
- elog " app-crypt/sbsigntools for binary signing for use with SecureBoot"
- elog " sys-boot/efibootmgr for writing to NVRAM"
- elog " sys-block/parted for automatic ESP location and mount"
- elog ""
- elog "refind-mkdefault requires >=dev-lang/python-3"
- elog ""
- elog "A sample configuration can be found at"
- elog "${EROOT}/usr/lib/${PN}/refind/refind.conf-sample"
- else
- if ver_test "${REPLACING_VERSIONS}" -lt "0.10.3"; then
- elog "The new refind-mkdefault script requires >=dev-lang/python-3"
- elog "to be installed"
- elog ""
- fi
- ewarn "Note that this installation will not update any EFI binaries"
- ewarn "on your EFI System Partition - this needs to be done manually"
- fi
-}
diff --git a/sys-boot/refind/refind-0.12.0-r1.ebuild b/sys-boot/refind/refind-0.12.0-r1.ebuild
deleted file mode 100644
index 39004c2d0093..000000000000
--- a/sys-boot/refind/refind-0.12.0-r1.ebuild
+++ /dev/null
@@ -1,146 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multiprocessing toolchain-funcs
-
-DESCRIPTION="The UEFI Boot Manager by Rod Smith"
-HOMEPAGE="https://www.rodsbooks.com/refind/"
-SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
-
-LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
-SLOT="0"
-KEYWORDS="amd64 x86"
-FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
-IUSE="${FS_USE} custom-cflags doc"
-
-DEPEND="sys-boot/gnu-efi"
-
-PATCHES=(
- "${FILESDIR}/makefile.patch"
- "${FILESDIR}/${P}-gcc10.patch" # Bug 723244
-)
-
-DOCS=( README.txt )
-
-pkg_pretend() {
- if use custom-cflags; then
- ewarn
- ewarn "You have enabled building with USE=custom-cflags. Be aware that"
- ewarn "using this can result in EFI binaries that fail to run and may"
- ewarn "fail to build at all. This is strongly advised against by upstream."
- ewarn
- ewarn "See https://bugs.gentoo.org/598587#c3 for more information"
- ewarn
- fi
-}
-
-pkg_setup() {
- if use x86; then
- export EFIARCH=ia32
- export BUILDARCH=ia32
- elif use amd64; then
- export EFIARCH=x64
- export BUILDARCH=x86_64
- fi
-}
-
-src_prepare() {
- default
-
- # bug 598647 - PIE not supported
- sed -e '/^CFLAGS/s:$: -fno-PIE:' -i Make.common || die
-}
-
-src_compile() {
- # Update fs targets depending on uses
- local fs fs_names=()
- for fs in ${FS_USE}; do
- fs=${fs#+}
- if use "${fs}"; then
- fs_names+=(${fs})
- fi
- done
- fs_names=("${fs_names[@]/%/_gnuefi}")
-
- # Prepare flags
- local make_flags=(
- ARCH="${BUILDARCH}"
- CC="$(tc-getCC)"
- AS="$(tc-getAS)"
- LD="$(tc-getLD)"
- AR="$(tc-getAR)"
- RANLIB="$(tc-getRANLIB)"
- OBJCOPY="$(tc-getOBJCOPY)"
- GNUEFILIB="/usr/$(get_libdir)"
- EFILIB="/usr/$(get_libdir)"
- EFICRT0="/usr/$(get_libdir)"
- EDK2BASE="${UDK_WORKSPACE}"
- EDK2_DRIVER_BASENAMES="${fs_names[*]}"
- FILESYSTEMS="${fs_names[*]}"
- FILESYSTEMS_GNUEFI="${fs_names[*]}"
- )
- if use custom-cflags; then
- make_flags=(CFLAGS="${CFLAGS} -fno-tree-loop-distribute-patterns" "${make_flags[@]}")
- fi
-
- emake "${make_flags[@]}" all_gnuefi
-}
-
-src_install() {
- exeinto "/usr/lib/${PN}"
- doexe refind-install
- dosym "../lib/${PN}/refind-install" "/usr/sbin/refind-install"
-
- if use doc; then
- doman "docs/man/"*
- DOCS+=(NEWS.txt docs/refind docs/Styles)
- fi
- einstalldocs
-
- insinto "/usr/lib/${PN}/refind"
- doins "refind/refind_${EFIARCH}.efi"
- doins "refind.conf-sample"
- doins -r images icons fonts banners
-
- if [[ -d "drivers_${EFIARCH}" ]]; then
- doins -r "drivers_${EFIARCH}"
- fi
-
- insinto "/usr/lib/${PN}/refind/tools_${EFIARCH}"
- doins "gptsync/gptsync_${EFIARCH}.efi"
-
- insinto "/etc/refind.d"
- doins -r "keys"
-
- dosbin "mkrlconf"
- dosbin "mvrefind"
- dosbin "refind-mkdefault"
-}
-
-pkg_postinst() {
- elog "rEFInd has been built and installed into ${EROOT}/usr/lib/${PN}"
- elog "You will need to use the command 'refind-install' to install"
- elog "the binaries into your EFI System Partition"
- elog ""
- elog "refind-install requires additional packages to be fully functional:"
- elog " app-crypt/sbsigntools for binary signing for use with SecureBoot"
- elog " sys-boot/efibootmgr for writing to NVRAM"
- elog " sys-apps/gptfdisk for ESP management"
- elog ""
- elog "refind-mkdefault requires >=dev-lang/python-3"
- elog ""
- if [[ -z "${REPLACING_VERSIONS}" ]]; then
- elog "A sample configuration can be found at"
- elog "${EROOT}/usr/lib/${PN}/refind/refind.conf-sample"
- else
- if ver_test "${REPLACING_VERSIONS}" -lt "0.12.0"; then
- ewarn "This new version uses sys-apps/gptfdisk instead of sys-block/parted"
- ewarn "to manage ESP"
- ewarn ""
- fi
- ewarn "Note that this installation will not update any EFI binaries"
- ewarn "on your EFI System Partition - this needs to be done manually"
- fi
-}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/, sys-boot/refind/files/
@ 2024-07-25 7:10 Viorel Munteanu
0 siblings, 0 replies; 6+ messages in thread
From: Viorel Munteanu @ 2024-07-25 7:10 UTC (permalink / raw
To: gentoo-commits
commit: 7cea90df5543b29b629b40e12235e3cc864bc698
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 07:06:48 2024 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 07:09:45 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cea90df
sys-boot/refind: add fix for gnu-efi 3.0.18
Closes: https://bugs.gentoo.org/934474
Closes: https://bugs.gentoo.org/934320
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
.../files/refind-0.14.2-fix-gnu-efi-3.0.18.patch | 77 ++++++++++++++++++++++
...efind-0.14.2.ebuild => refind-0.14.2-r1.ebuild} | 25 ++-----
2 files changed, 82 insertions(+), 20 deletions(-)
diff --git a/sys-boot/refind/files/refind-0.14.2-fix-gnu-efi-3.0.18.patch b/sys-boot/refind/files/refind-0.14.2-fix-gnu-efi-3.0.18.patch
new file mode 100644
index 000000000000..b5d9d2692883
--- /dev/null
+++ b/sys-boot/refind/files/refind-0.14.2-fix-gnu-efi-3.0.18.patch
@@ -0,0 +1,77 @@
+The same commit from gnu-efi that changed CopyMem in a way that broke refind also changed SetMem.
+This patch attempts to fix it in the same way upstream fixed CopyMem.
+
+The commit: https://sourceforge.net/p/gnu-efi/code/ci/deb8a7f267d96299b9aa41300539f617db54c2a9/
+The bug: https://bugs.gentoo.org/934474
+
+--- a/gptsync/gptsync.c
++++ b/gptsync/gptsync.c
+@@ -164,7 +164,7 @@ static UINTN write_mbr(VOID)
+ }
+ if (!have_bootcode) {
+ // no boot code found in the MBR, add the syslinux MBR code
+- SetMem(sector, MBR_BOOTCODE_SIZE, 0);
++ refit_call3_wrapper(gBS->SetMem, sector, MBR_BOOTCODE_SIZE, 0);
+ refit_call3_wrapper(gBS->CopyMem, sector, syslinux_mbr, SYSLINUX_MBR_SIZE);
+ }
+
+--- a/libeg/lodepng_xtra.c
++++ b/libeg/lodepng_xtra.c
+@@ -87,7 +87,7 @@ int MyStrlen(const char *InString) {
+ } // int MyStrlen()
+
+ VOID *MyMemSet(VOID *s, int c, size_t n) {
+- SetMem(s, c, n);
++ MySetMem(s, c, n);
+ return s;
+ }
+
+--- a/refind/config.c
++++ b/refind/config.c
+@@ -667,7 +667,7 @@ VOID ReadConfig(CHAR16 *FileName)
+ HandleStrings(TokenList, TokenCount, &(GlobalConfig.DriverDirs));
+
+ } else if (MyStriCmp(TokenList[0], L"showtools")) {
+- SetMem(GlobalConfig.ShowTools, NUM_TOOLS * sizeof(UINTN), 0);
++ MySetMem(GlobalConfig.ShowTools, NUM_TOOLS * sizeof(UINTN), 0);
+ GlobalConfig.HiddenTags = FALSE;
+ for (i = 1; (i < TokenCount) && (i < NUM_TOOLS); i++) {
+ FlagName = TokenList[i];
+--- a/refind/launch_legacy.c
++++ b/refind/launch_legacy.c
+@@ -114,7 +114,7 @@ static EFI_STATUS ActivateMbrPartition(IN EFI_BLOCK_IO *BlockIO, IN UINTN Partit
+ }
+ if (!HaveBootCode) {
+ // no boot code found in the MBR, add the syslinux MBR code
+- SetMem(SectorBuffer, MBR_BOOTCODE_SIZE, 0);
++ MySetMem(SectorBuffer, MBR_BOOTCODE_SIZE, 0);
+ MyCopyMem(SectorBuffer, syslinux_mbr, SYSLINUX_MBR_SIZE);
+ }
+
+--- a/refind/lib.c
++++ b/refind/lib.c
+@@ -651,7 +651,7 @@ static VOID SetFilesystemData(IN UINT8 *Buffer, IN UINTN BufferSize, IN OUT REFI
+
+ LOG(2, LOG_LINE_NORMAL, L"Identifying filesystem types....");
+ if ((Buffer != NULL) && (Volume != NULL)) {
+- SetMem(&(Volume->VolUuid), sizeof(EFI_GUID), 0);
++ MySetMem(&(Volume->VolUuid), sizeof(EFI_GUID), 0);
+ Volume->FSType = FS_TYPE_UNKNOWN;
+
+ if (BufferSize >= (1024 + 100)) {
+--- a/refind/lib.h
++++ b/refind/lib.h
+@@ -133,10 +133,13 @@ VOID MyFreePool(IN OUT VOID *Pointer);
+
+ // When using GNU-EFI, call the EFI's built-in gBS->CopyMem() function, because
+ // GNU-EFI 3.0.18 changed its CopyMem() definition in a way that broke rEFInd.
++// Same for SetMem
+ #ifdef __MAKEWITH_GNUEFI
+ #define MyCopyMem(Dest, Src, len) refit_call3_wrapper(gBS->CopyMem, Dest, Src, len)
++#define MySetMem(Dest, Src, len) refit_call3_wrapper(gBS->SetMem, Dest, Src, len)
+ #else
+ #define MyCopyMem(Dest, Src, len) CopyMem(Dest, Src, len)
++#define MySetMem(Dest, Src, len) SetMem(Dest, Src, len)
+ #endif
+
+ BOOLEAN EjectMedia(VOID);
diff --git a/sys-boot/refind/refind-0.14.2.ebuild b/sys-boot/refind/refind-0.14.2-r1.ebuild
similarity index 87%
rename from sys-boot/refind/refind-0.14.2.ebuild
rename to sys-boot/refind/refind-0.14.2-r1.ebuild
index f280380cf1c4..d3866389c5cb 100644
--- a/sys-boot/refind/refind-0.14.2.ebuild
+++ b/sys-boot/refind/refind-0.14.2-r1.ebuild
@@ -11,8 +11,7 @@ SRC_URI="https://downloads.sourceforge.net/project/${PN}/${PV}/${PN}-src-${PV}.t
LICENSE="BSD CC-BY-SA-3.0 CC-BY-SA-4.0 FDL-1.3 GPL-2+ GPL-3+ LGPL-3+"
SLOT="0"
-# Unkeyworded for now because of bug #934474
-#KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 ~x86"
FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
IUSE="${FS_USE} doc"
@@ -23,7 +22,10 @@ BDEPEND="sys-devel/binutils"
DOCS=( README.txt NEWS.txt )
-PATCHES=( "${FILESDIR}"/${PN}-0.14.0.2-clang.patch )
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.14.0.2-clang.patch
+ "${FILESDIR}"/${P}-fix-gnu-efi-3.0.18.patch
+)
checktools() {
if [[ ${MERGE_TYPE} != "binary" ]]; then
@@ -42,28 +44,11 @@ checktools() {
fi
}
-check-gnu-efi() {
- if [[ ${MERGE_TYPE} != "binary" ]]; then
- local efi=sys-boot/gnu-efi
-
- local broken=3.0.18-r1
- has_version -d "=${efi}-${broken}" && die "This version of refind does not boot if compiled with =${efi}-${broken}"
-
- broken=3.0.18
- if has_version -d ">=${efi}-${broken}"; then
- ewarn "This version of refind does not display jpegs correctly if compiled with >=${efi}-${broken} (bug #934474)"
- fi
- fi
-}
-
pkg_pretend() {
- check-gnu-efi
checktools
}
pkg_setup() {
- check-gnu-efi
-
if use x86; then
export EFIARCH=ia32
export BUILDARCH=ia32
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/, sys-boot/refind/files/
@ 2024-08-26 4:34 Viorel Munteanu
0 siblings, 0 replies; 6+ messages in thread
From: Viorel Munteanu @ 2024-08-26 4:34 UTC (permalink / raw
To: gentoo-commits
commit: e0d73710476266df0532c7cbaae7da5404bd4eab
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 23 15:07:47 2024 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 04:28:53 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0d73710
sys-boot/refind: fix build on musl
Bug: https://bugs.gentoo.org/938012
Closes: https://github.com/gentoo/gentoo/pull/38263
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
.../refind-0.14.2-fix-freestanding-on-musl.patch | 63 ++++++++
sys-boot/refind/refind-0.14.2-r2.ebuild | 172 +++++++++++++++++++++
2 files changed, 235 insertions(+)
diff --git a/sys-boot/refind/files/refind-0.14.2-fix-freestanding-on-musl.patch b/sys-boot/refind/files/refind-0.14.2-fix-freestanding-on-musl.patch
new file mode 100644
index 000000000000..42f8d6b13a79
--- /dev/null
+++ b/sys-boot/refind/files/refind-0.14.2-fix-freestanding-on-musl.patch
@@ -0,0 +1,63 @@
+On amd64, musl typedefs wchar_t to int, conflicting with -fshort-wchar.
+Also, /usr/include is searched before the compiler provided include directory.
+As a workaround, use -nostdinc and switch them around.
+
+Add missing `#include <stddef.h>` where wchar_t was defined indirectly by
+other standard includefiles.
+
+We need and extra -D for clang, where wchar_t is defined in
+/usr/include/allbits.h and gets included by other headers, conflicting with
+wchar_t already defined in stddef.h.
+
+See also: https://bugs.gentoo.org/938012
+ https://bugs.gentoo.org/881131
+ https://bugs.gentoo.org/832018
+
+--- a/Make.common
++++ b/Make.common
+@@ -79,7 +79,7 @@
+ #
+
+ # ...for both GNU-EFI and TianoCore....
+-OPTIMFLAGS = -Os -fno-strict-aliasing -fno-tree-loop-distribute-patterns
++OPTIMFLAGS = -Os -fno-strict-aliasing -ffreestanding -nostdinc -isystem $(CPPINCLUDEDIR) -isystem $(EPREFIX)/usr/include $(EXTRACFLAGS)
+ CFLAGS = $(OPTIMFLAGS) -fno-stack-protector -fshort-wchar -Wall
+
+ # ...for GNU-EFI....
+@@ -168,7 +168,7 @@
+ SUBSYSTEM_LDFLAG = -defsym=EFI_SUBSYSTEM=0xa
+ LDFLAGS += --warn-common --no-undefined --fatal-warnings
+
+- ARCH_CFLAGS = -fno-merge-constants -ffreestanding -DEFIAARCH64
++ ARCH_CFLAGS = -fno-merge-constants -ffreestanding -DEFIAARCH64 -nostdinc -isystem $(CPPINCLUDEDIR) -isystem $(EPREFIX)/usr/include $(EXTRACFLAGS)
+ ifeq ($(MAKEWITH),TIANO)
+ ARCH_CFLAGS += -mcmodel=large -Wno-address -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
+ endif
+--- a/libeg/lodepng.h
++++ b/libeg/lodepng.h
+@@ -32,6 +32,7 @@
+ #ifndef LODEPNG_H
+ #define LODEPNG_H
+
++#include <stddef.h>
+ #include <string.h> /*for size_t*/
+
+ // Below block of lines required for GNU-EFI and TianoCore (program hangs
+--- a/libeg/nanojpeg.c
++++ b/libeg/nanojpeg.c
+@@ -211,6 +211,7 @@
+
+ #ifdef _NJ_EXAMPLE_PROGRAM
+
++#include <stddef.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -275,6 +276,7 @@
+ #endif
+
+ #if NJ_USE_LIBC
++ #include <stddef.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #define njAllocMem malloc
diff --git a/sys-boot/refind/refind-0.14.2-r2.ebuild b/sys-boot/refind/refind-0.14.2-r2.ebuild
new file mode 100644
index 000000000000..5755a725f1bf
--- /dev/null
+++ b/sys-boot/refind/refind-0.14.2-r2.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit optfeature secureboot toolchain-funcs
+
+DESCRIPTION="The UEFI Boot Manager by Rod Smith"
+HOMEPAGE="https://www.rodsbooks.com/refind/"
+SRC_URI="https://downloads.sourceforge.net/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD CC-BY-SA-3.0 CC-BY-SA-4.0 FDL-1.3 GPL-2+ GPL-3+ LGPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} doc"
+
+DEPEND="sys-boot/gnu-efi"
+
+# for ld.bfd and objcopy
+BDEPEND="sys-devel/binutils"
+
+DOCS=( README.txt NEWS.txt )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.14.0.2-clang.patch
+ "${FILESDIR}"/${P}-fix-gnu-efi-3.0.18.patch
+ "${FILESDIR}"/${P}-fix-freestanding-on-musl.patch
+)
+
+checktools() {
+ if [[ ${MERGE_TYPE} != "binary" ]]; then
+ # bug #832018
+ tc-export LD
+ tc-ld-force-bfd
+ # the makefile calls LD directly, so try to fix LD too
+ LD="${LD/.lld/.bfd}"
+ tc-ld-is-lld "${LD}" && die "Linking with lld produces broken executables and may lead to unbootable system"
+
+ # bug #732256
+ # llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
+ tc-export OBJCOPY
+ OBJCOPY="${OBJCOPY/llvm-/}"
+ LANG=C LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
+
+ tc-is-gcc || tc-is-clang || die "Unsupported compiler"
+ fi
+}
+
+pkg_pretend() {
+ checktools
+}
+
+pkg_setup() {
+ if use x86; then
+ export EFIARCH=ia32
+ export BUILDARCH=ia32
+ elif use amd64; then
+ export EFIARCH=x64
+ export BUILDARCH=x86_64
+ fi
+ secureboot_pkg_setup
+
+ # this does not only check, but also exports LD and OBJCOPY
+ checktools
+}
+
+src_prepare() {
+ default
+
+ # bug #598647 - PIE not supported
+ sed -e '/^CFLAGS/s/$/ -fno-PIE/' -i Make.common || die
+ sed -e '1 i\.NOTPARALLEL:' -i filesystems/Makefile || die
+
+ cp "${FILESDIR}"/refind-sbat-gentoo-${PV}.csv refind-sbat-gentoo.csv || die
+}
+
+src_compile() {
+ # Update fs targets depending on uses
+ local fs fs_names=()
+ for fs in ${FS_USE}; do
+ fs=${fs#+}
+ if use "${fs}"; then
+ fs_names+=( ${fs} )
+ fi
+ done
+ fs_names=( "${fs_names[@]/%/_gnuefi}" )
+
+ # Prepare flags
+ local make_flags=(
+ ARCH="${BUILDARCH}"
+ CC="$(tc-getCC)"
+ AS="$(tc-getAS)"
+ LD="${LD}"
+ AR="$(tc-getAR)"
+ RANLIB="$(tc-getRANLIB)"
+ OBJCOPY="${OBJCOPY}"
+ GNUEFILIB="${ESYSROOT}/usr/$(get_libdir)"
+ EFILIB="${ESYSROOT}/usr/$(get_libdir)"
+ EFICRT0="${ESYSROOT}/usr/$(get_libdir)"
+ FILESYSTEMS="${fs_names[*]}"
+ FILESYSTEMS_GNUEFI="${fs_names[*]}"
+ REFIND_SBAT_CSV=refind-sbat-gentoo.csv
+ )
+
+ # see the comments in "${FILESDIR}"/${P}-fix-freestanding-on-musl.patch
+ tc-export CC
+ if tc-is-gcc; then
+ local -x CPPINCLUDEDIR=$(LANG=C ${CC} -print-search-dirs 2> /dev/null | grep ^install: | cut -f2 -d' ')/include
+ elif tc-is-clang; then
+ local -x CPPINCLUDEDIR=$(LANG=C ${CC} -print-resource-dir 2> /dev/null)/include
+ local -x EXTRACFLAGS=-D__DEFINED_wchar_t
+ fi
+
+ emake "${make_flags[@]}" all_gnuefi
+}
+
+src_install() {
+ exeinto "/usr/$(get_libdir)/${PN}"
+ doexe refind-install
+ dosym -r "/usr/$(get_libdir)/${PN}/refind-install" "/usr/sbin/refind-install"
+
+ doman "docs/man/"*
+ use doc && DOCS+=( docs/refind docs/Styles )
+ einstalldocs
+
+ insinto "/usr/$(get_libdir)/${PN}/refind"
+ doins "refind/refind_${EFIARCH}.efi"
+ doins "refind.conf-sample"
+ doins -r images icons fonts banners
+
+ if [[ -d "drivers_${EFIARCH}" ]]; then
+ doins -r "drivers_${EFIARCH}"
+ fi
+
+ insinto "/usr/$(get_libdir)/${PN}/refind/tools_${EFIARCH}"
+ doins "gptsync/gptsync_${EFIARCH}.efi"
+
+ insinto "/etc/refind.d"
+ doins -r "keys"
+
+ dosbin "mkrlconf"
+ dosbin "mvrefind"
+ dosbin "refind-mkdefault"
+
+ secureboot_auto_sign --in-place
+}
+
+pkg_postinst() {
+ elog "rEFInd has been built and installed into ${EROOT}/usr/$(get_libdir)/${PN}"
+ elog "You will need to use the command 'refind-install' to install"
+ elog "the binaries into your EFI System Partition"
+
+ optfeature_header "refind-install requires additional packages to be fully functional:"
+ optfeature "binary signing for use with SecureBoot" app-crypt/sbsigntools
+ optfeature "writing to NVRAM" sys-boot/efibootmgr
+ optfeature "ESP management" sys-apps/gptfdisk
+ elog ""
+
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ elog "A sample configuration can be found at"
+ elog "${EROOT}/usr/$(get_libdir)/${PN}/refind/refind.conf-sample"
+ else
+ if ver_test "${REPLACING_VERSIONS}" -lt "0.12.0"; then
+ ewarn "This new version uses sys-apps/gptfdisk instead of sys-block/parted"
+ ewarn "to manage ESP"
+ ewarn ""
+ fi
+ ewarn "Note that this installation will not update any EFI binaries"
+ ewarn "on your EFI System Partition - this needs to be done manually"
+ fi
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-08-26 4:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-04 6:16 [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/, sys-boot/refind/files/ Sam Jorna
-- strict thread matches above, loose matches on Subject: below --
2024-08-26 4:34 Viorel Munteanu
2024-07-25 7:10 Viorel Munteanu
2022-05-18 15:30 Joonas Niilola
2017-05-15 5:13 Sam Jorna
2015-11-21 16:40 Amy Winston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox