diff --git a/.gitignore b/.gitignore index 2898a74..8db06b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/gnu-efi_3.0u.orig.tar.gz +SOURCES/gnu-efi-3.0.2.tar.bz2 diff --git a/.gnu-efi.metadata b/.gnu-efi.metadata index 9ac36ca..2e6dc61 100644 --- a/.gnu-efi.metadata +++ b/.gnu-efi.metadata @@ -1 +1 @@ -c31638487a21ef39aa1d3626e3722a897fa53450 SOURCES/gnu-efi_3.0u.orig.tar.gz +9ba6583cb045fc5d901856abef2e2bb01da78aa7 SOURCES/gnu-efi-3.0.2.tar.bz2 diff --git a/SOURCES/0001-fix-compilation-on-x86_64-without-HAVE_USE_MS_ABI.patch b/SOURCES/0001-fix-compilation-on-x86_64-without-HAVE_USE_MS_ABI.patch deleted file mode 100644 index b2447a1..0000000 --- a/SOURCES/0001-fix-compilation-on-x86_64-without-HAVE_USE_MS_ABI.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 023ad973f8260ab88445ae36365ce309eff8e59b Mon Sep 17 00:00:00 2001 -From: Nigel Croxon -Date: Tue, 25 Jun 2013 08:45:44 -0400 -Subject: [PATCH 1/3] fix compilation on x86_64 without HAVE_USE_MS_ABI - -make -C apps would fail on tcc.c because uefi_call_wrapper() doesn't -deal correctly with efi_call0-type invocation. Fixed by this patch. - -Signed-off-by: David Decotigny ---- - inc/x86_64/efibind.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/inc/x86_64/efibind.h b/inc/x86_64/efibind.h -index 065a965..2133798 100644 ---- a/inc/x86_64/efibind.h -+++ b/inc/x86_64/efibind.h -@@ -368,7 +368,7 @@ UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3, - - /* main wrapper (va_num ignored) */ - #define uefi_call_wrapper(func,va_num,...) \ -- __VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func, __VA_ARGS__) -+ __VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__) - - #endif - #define EFI_FUNCTION __attribute__((ms_abi)) --- -1.8.3.1 - diff --git a/SOURCES/0002-be-more-pedantic-when-linking.patch b/SOURCES/0002-be-more-pedantic-when-linking.patch deleted file mode 100644 index 2593258..0000000 --- a/SOURCES/0002-be-more-pedantic-when-linking.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f99c72fe642e7ccc00012f01b8fc2adf8f93a79c Mon Sep 17 00:00:00 2001 -From: Nigel Croxon -Date: Tue, 25 Jun 2013 08:47:03 -0400 -Subject: [PATCH 2/3] be more pedantic when linking - -Don't allow duplicate symbols, abort upon first error. -also make sure the linker script comes last for apps. - -Signed-off-by: David Decotigny ---- - Make.defaults | 2 +- - apps/Makefile | 8 ++++++-- - 2 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/Make.defaults b/Make.defaults -index a22a1b4..6b4b6de 100644 ---- a/Make.defaults -+++ b/Make.defaults -@@ -114,4 +114,4 @@ CFLAGS += $(ARCH3264) -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing \ - -fno-merge-constants -ffreestanding -fno-stack-protector \ - -fno-stack-check - ASFLAGS += $(ARCH3264) --LDFLAGS += -nostdlib --no-undefined -+LDFLAGS += -nostdlib --warn-common --no-undefined --fatal-warnings -diff --git a/apps/Makefile b/apps/Makefile -index 773bc08..6834e14 100644 ---- a/apps/Makefile -+++ b/apps/Makefile -@@ -52,8 +52,12 @@ ifneq (,$(findstring FreeBSD,$(OS))) - LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_fbsd_efi.lds - endif - --LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS) --LOADLIBES = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name) -+LDFLAGS += -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS) -+ -+LOADLIBES += -lefi -lgnuefi -+LOADLIBES += $(shell $(CC) $(ARCH3264) -print-libgcc-file-name) -+LOADLIBES += -T $(LDSCRIPT) -+ - FORMAT = efi-app-$(ARCH) - - TARGETS = t.efi t2.efi t3.efi t4.efi t5.efi t6.efi printenv.efi t7.efi tcc.efi modelist.efi route80h.efi --- -1.8.3.1 - diff --git a/SOURCES/0003-Sample-boot-service-driver.patch b/SOURCES/0003-Sample-boot-service-driver.patch deleted file mode 100644 index 4a85a56..0000000 --- a/SOURCES/0003-Sample-boot-service-driver.patch +++ /dev/null @@ -1,371 +0,0 @@ -From b2a2a1fa80dd57be7d5445f1c2fbbe25feedd39d Mon Sep 17 00:00:00 2001 -From: Nigel Croxon -Date: Tue, 25 Jun 2013 08:53:58 -0400 -Subject: [PATCH 3/3] Sample boot service driver. - -Signed-off-by: David Decotigny ---- - apps/Makefile | 11 +++- - apps/drv0.c | 193 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - apps/drv0.h | 37 +++++++++++ - apps/drv0_use.c | 79 +++++++++++++++++++++++ - 4 files changed, 319 insertions(+), 1 deletion(-) - create mode 100644 apps/drv0.c - create mode 100644 apps/drv0.h - create mode 100644 apps/drv0_use.c - -diff --git a/apps/Makefile b/apps/Makefile -index 6834e14..8643ba1 100644 ---- a/apps/Makefile -+++ b/apps/Makefile -@@ -60,10 +60,19 @@ LOADLIBES += -T $(LDSCRIPT) - - FORMAT = efi-app-$(ARCH) - --TARGETS = t.efi t2.efi t3.efi t4.efi t5.efi t6.efi printenv.efi t7.efi tcc.efi modelist.efi route80h.efi -+TARGET_APPS = t.efi t2.efi t3.efi t4.efi t5.efi t6.efi \ -+ printenv.efi t7.efi tcc.efi modelist.efi \ -+ route80h.efi drv0_use.efi -+TARGET_BSDRIVERS = drv0.efi -+TARGET_RTDRIVERS = -+ -+TARGETS = $(TARGET_APPS) $(TARGET_BSDRIVERS) $(TARGET_RTDRIVERS) - - all: $(TARGETS) - -+$(TARGET_BSDRIVERS): FORMAT=efi-bsdrv-$(ARCH) -+$(TARGET_RTDRIVERS): FORMAT=efi-rtdrv-$(ARCH) -+ - clean: - rm -f $(TARGETS) *~ *.o *.so - -diff --git a/apps/drv0.c b/apps/drv0.c -new file mode 100644 -index 0000000..126e8e7 ---- /dev/null -+++ b/apps/drv0.c -@@ -0,0 +1,193 @@ -+/* -+ * Copyright (C) 2013 David Decotigny -+ * -+ * Sample EFI shell session, together with drv0_use.efi: -+ * -+ * # Loading first instance: -+ * -+ * fs0:\> load drv0.efi -+ * Driver instance loaded successfully. -+ * load: Image fs0:\drv0.efi loaded at 2FD7C000 - Success -+ * -+ * # Testing 1st instance: -+ * -+ * fs0:\> drv0_use.efi -+ * Playing with driver instance 0... -+ * Hello Sample UEFI Driver! -+ * Hello was called 1 time(s). -+ * -+ * fs0:\> drv0_use.efi -+ * Playing with driver instance 0... -+ * Hello Sample UEFI Driver! -+ * Hello was called 2 time(s). -+ * -+ * # Loading another instance: -+ * -+ * fs0:\> load drv0.efi -+ * Driver instance loaded successfully. -+ * load: Image fs0:\drv0.efi loaded at 2FD6D000 - Success -+ * -+ * # Using both instances: -+ * -+ * fs0:\> drv0_use.efi -+ * Playing with driver instance 0... -+ * Hello Sample UEFI Driver! -+ * Hello was called 3 time(s). -+ * Playing with driver instance 1... -+ * Hello Sample UEFI Driver! -+ * Hello was called 1 time(s). -+ * -+ * fs0:\> drv0_use.efi -+ * Playing with driver instance 0... -+ * Hello Sample UEFI Driver! -+ * Hello was called 4 time(s). -+ * Playing with driver instance 1... -+ * Hello Sample UEFI Driver! -+ * Hello was called 2 time(s). -+ * -+ * # Removing 1st instance: -+ * -+ * fs0:\> dh -+ * Handle dump -+ * 1: Image(DxeCore) -+ * [...] -+ * 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi) -+ * 7A: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi) -+ * -+ * fs0:\> unload 79 -+ * 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi) -+ * Unload driver image (y/n)? y -+ * Driver instance unloaded. -+ * unload: Success -+ * -+ * # Only 2nd instance remaining: -+ * -+ * fs0:\> drv0_use.efi -+ * Playing with driver instance 0... -+ * Hello Sample UEFI Driver! -+ * Hello was called 3 time(s). -+ * -+ * # Removing 2nd/last instance: -+ * -+ * fs0:\> dh -+ * Handle dump -+ * 1: Image(DxeCore) -+ * [...] -+ * 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi) -+ * -+ * fs0:\> unload 79 -+ * 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi) -+ * Unload driver image (y/n)? y -+ * Driver instance unloaded. -+ * unload: Success -+ * -+ * # Expect error: no other drv0 instance left -+ * -+ * fs0:\> drv0_use.efi -+ * Error looking up handles for proto: 14 -+ */ -+ -+#include -+#include -+#include "drv0.h" -+ -+ -+static const EFI_GUID GnuEfiAppsDrv0ProtocolGuid -+ = GNU_EFI_APPS_DRV0_PROTOCOL_GUID; -+ -+static struct { -+ GNU_EFI_APPS_DRV0_PROTOCOL Proto; -+ UINTN Counter; -+} InternalGnuEfiAppsDrv0ProtocolData; -+ -+ -+static -+EFI_STATUS -+EFI_FUNCTION -+Drv0SayHello( -+ IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This, -+ IN const CHAR16 *HelloWho -+ ) -+{ -+ if (! HelloWho) -+ return EFI_INVALID_PARAMETER; -+ -+ Print(L"Hello %s!\n", HelloWho); -+ InternalGnuEfiAppsDrv0ProtocolData.Counter ++; -+ return EFI_SUCCESS; -+} -+ -+ -+static -+EFI_STATUS -+EFI_FUNCTION -+Drv0GetNumberOfHello( -+ IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This, -+ OUT UINTN *NumberOfHello -+ ) -+{ -+ if (! NumberOfHello) -+ return EFI_INVALID_PARAMETER; -+ -+ *NumberOfHello = InternalGnuEfiAppsDrv0ProtocolData.Counter; -+ return EFI_SUCCESS; -+} -+ -+ -+static -+EFI_STATUS -+EFI_FUNCTION -+Drv0Unload(IN EFI_HANDLE ImageHandle) -+{ -+ LibUninstallProtocolInterfaces(ImageHandle, -+ &GnuEfiAppsDrv0ProtocolGuid, -+ &InternalGnuEfiAppsDrv0ProtocolData.Proto, -+ NULL); -+ Print(L"Driver instance unloaded.\n", ImageHandle); -+ return EFI_SUCCESS; -+} -+ -+ -+EFI_STATUS -+efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SysTab) -+{ -+ EFI_STATUS Status; -+ EFI_LOADED_IMAGE *LoadedImage = NULL; -+ -+ InitializeLib(ImageHandle, SysTab); -+ -+ /* Initialize global protocol definition + data */ -+ InternalGnuEfiAppsDrv0ProtocolData.Proto.SayHello -+ = (GNU_EFI_APPS_DRV0_SAY_HELLO) Drv0SayHello; -+ InternalGnuEfiAppsDrv0ProtocolData.Proto.GetNumberOfHello -+ = (GNU_EFI_APPS_DRV0_GET_NUMBER_OF_HELLO) Drv0GetNumberOfHello; -+ InternalGnuEfiAppsDrv0ProtocolData.Counter = 0; -+ -+ /* Grab handle to this image: we'll attach our proto instance to it */ -+ Status = uefi_call_wrapper(BS->OpenProtocol, 6, -+ ImageHandle, &LoadedImageProtocol, -+ &LoadedImage, ImageHandle, -+ NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ if (EFI_ERROR(Status)) { -+ Print(L"Could not open loaded image protocol: %d\n", Status); -+ return Status; -+ } -+ -+ /* Attach our proto to the current driver image */ -+ Status = LibInstallProtocolInterfaces( -+ &ImageHandle, &GnuEfiAppsDrv0ProtocolGuid, -+ &InternalGnuEfiAppsDrv0ProtocolData.Proto, NULL); -+ if (EFI_ERROR(Status)) { -+ Print(L"Error registering driver instance: %d\n", Status); -+ return Status; -+ } -+ -+ /* Register Unload callback, used to unregister current protocol -+ * instance from system */ -+ LoadedImage->Unload = (EFI_IMAGE_UNLOAD)Drv0Unload; -+ -+ Print(L"Driver instance loaded successfully.\n"); -+ return EFI_SUCCESS; /* at this point, this instance stays resident -+ * until image is unloaded, eg. with shell's unload, -+ * ExitBootServices() */ -+} -diff --git a/apps/drv0.h b/apps/drv0.h -new file mode 100644 -index 0000000..26d2ffd ---- /dev/null -+++ b/apps/drv0.h -@@ -0,0 +1,37 @@ -+#ifndef _GNU_EFI_APPS_DRV0_H_ -+#define _GNU_EFI_APPS_DRV0_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/* UEFI naming conventions */ -+#define GNU_EFI_APPS_DRV0_PROTOCOL_GUID \ -+{ 0xe4dcafd0, 0x586c, 0x4b3d, {0x86, 0xe7, 0x28, 0xde, 0x7f, 0xcc, 0x04, 0xb8} } -+ -+INTERFACE_DECL(_GNU_EFI_APPS_DRV0_PROTOCOL); -+ -+typedef -+EFI_STATUS -+(EFIAPI *GNU_EFI_APPS_DRV0_SAY_HELLO) ( -+ IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This, -+ IN const CHAR16 *HelloWho -+ ); -+ -+typedef -+EFI_STATUS -+(EFIAPI *GNU_EFI_APPS_DRV0_GET_NUMBER_OF_HELLO) ( -+ IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This, -+ OUT UINTN *NumberOfHello -+ ); -+ -+typedef struct _GNU_EFI_APPS_DRV0_PROTOCOL { -+ GNU_EFI_APPS_DRV0_SAY_HELLO SayHello; -+ GNU_EFI_APPS_DRV0_GET_NUMBER_OF_HELLO GetNumberOfHello; -+} GNU_EFI_APPS_DRV0_PROTOCOL; -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff --git a/apps/drv0_use.c b/apps/drv0_use.c -new file mode 100644 -index 0000000..f7c5869 ---- /dev/null -+++ b/apps/drv0_use.c -@@ -0,0 +1,79 @@ -+/* -+ * Copyright (C) 2013 David Decotigny -+ * -+ * See drv0.c for an example session. -+ */ -+ -+#include -+#include -+#include "drv0.h" -+ -+ -+static EFI_GUID GnuEfiAppsDrv0ProtocolGuid -+ = GNU_EFI_APPS_DRV0_PROTOCOL_GUID; -+ -+ -+static -+EFI_STATUS -+PlayWithGnuEfiAppsDrv0Protocol(IN EFI_HANDLE DrvHandle) { -+ EFI_STATUS Status; -+ GNU_EFI_APPS_DRV0_PROTOCOL *drv = NULL; -+ UINTN NumberOfHello = 0; -+ -+ Status = uefi_call_wrapper(BS->OpenProtocol, 6, -+ DrvHandle, -+ &GnuEfiAppsDrv0ProtocolGuid, -+ &drv, -+ DrvHandle, -+ NULL, -+ EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ if (EFI_ERROR(Status)) { -+ Print(L"Cannot open proto: %d\n", Status); -+ return Status; -+ } -+ -+ Status = uefi_call_wrapper(drv->SayHello, 2, drv, L"Sample UEFI Driver"); -+ if (EFI_ERROR(Status)) { -+ Print(L"Cannot call SayHello: %d\n", Status); -+ } -+ -+ Status = uefi_call_wrapper(drv->GetNumberOfHello, 2, drv, &NumberOfHello); -+ if (EFI_ERROR(Status)) { -+ Print(L"Cannot call GetNumberOfHello: %d\n", Status); -+ } else { -+ Print(L"Hello was called %d time(s).\n", NumberOfHello); -+ } -+ -+ return EFI_SUCCESS; -+} -+ -+ -+EFI_STATUS -+efi_main (EFI_HANDLE Image, EFI_SYSTEM_TABLE *SysTab) -+{ -+ EFI_STATUS Status; -+ EFI_HANDLE *Handles = NULL; -+ UINTN i, NoHandles = 0; -+ -+ InitializeLib(Image, SysTab); -+ -+ Status = LibLocateHandle(ByProtocol, &GnuEfiAppsDrv0ProtocolGuid, -+ NULL, &NoHandles, &Handles); -+ if (EFI_ERROR(Status)) { -+ Print(L"Error looking up handles for proto: %d\n", Status); -+ return Status; -+ } -+ -+ for (i = 0 ; i < NoHandles ; ++i) -+ { -+ Print(L"Playing with driver instance %d...\n", i); -+ Status = PlayWithGnuEfiAppsDrv0Protocol(Handles[i]); -+ if (EFI_ERROR(Status)) -+ Print(L"Error playing with instance %d, skipping\n", i); -+ } -+ -+ if (Handles) -+ FreePool(Handles); -+ -+ return EFI_SUCCESS; -+} --- -1.8.3.1 - diff --git a/SPECS/gnu-efi.spec b/SPECS/gnu-efi.spec index 3a894b6..5d3f87a 100644 --- a/SPECS/gnu-efi.spec +++ b/SPECS/gnu-efi.spec @@ -1,26 +1,26 @@ Summary: Development Libraries and headers for EFI Name: gnu-efi -Version: 3.0u +Version: 3.0.2 Release: 2%{?dist} +Epoch: 1 Group: Development/System License: BSD URL: ftp://ftp.hpl.hp.com/pub/linux-ia64 -Source: ftp://ftp.hpl.hp.com/pub/linux-ia64/gnu-efi_%{version}.orig.tar.gz -Patch0001: 0001-fix-compilation-on-x86_64-without-HAVE_USE_MS_ABI.patch -Patch0002: 0002-be-more-pedantic-when-linking.patch -Patch0003: 0003-Sample-boot-service-driver.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -ExclusiveArch: x86_64 +ExclusiveArch: x86_64 aarch64 BuildRequires: git +Source: http://superb-dca2.dl.sourceforge.net/project/gnu-efi/gnu-efi-%{version}.tar.bz2 %define debug_package %{nil} # Figure out the right file path to use -%if 0%{?rhel} -%global efidir redhat +%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')) + +%ifarch x86_64 +%global efiarch x86_64 %endif -%if 0%{?fedora} -%global efidir fedora +%ifarch aarch64 +%global efiarch aarch64 %endif %description @@ -30,7 +30,8 @@ applications that run under EFI (Extensible Firmware Interface). %package devel Summary: Development Libraries and headers for EFI Group: Development/System -Obsoletes: gnu-efi < %{version}-%{release} +Obsoletes: gnu-efi < 1:3.0.2-1 +Requires: gnu-efi %description devel This package contains development headers and libraries for developing @@ -44,17 +45,21 @@ Group: Applications/System This package contains utilties for debugging and developing EFI systems. %prep -%setup -q -n gnu-efi-3.0 +%setup -q -n gnu-efi-%{version} git init -git config user.email "pjones@fedoraproject.org" -git config user.name "Fedora Ninjas" +git config user.email "gnu-efi-owner@redhat.com" +git config user.name "RHEL Ninjas" +git config sendemail.to "gnu-efi-owner@fedoraproject.org" git add . git commit -a -q -m "%{version} baseline." git am %{patches} - 3.0.2-2 +- Fix .spec mismerge from upstream that causes ia32 to build. + Related: rhbz#1190191 + Related: rhbz#1115843 + Related: rhbz#1100048 + +* Mon Jun 15 2015 Peter Jones - 3.0.2-1 +- Update to 3.0.2 + Related: rhbz#1190191 + Related: rhbz#1115843 + Related: rhbz#1100048 +- Fix base package requirement on subpackages + +* Fri Aug 22 2014 Kyle McMartin - 3.0w-0.1 +- New upstream version 3.0w +- Add pjones' build fixes patch from that other distro. +- Enable AArch64 + * Fri Dec 27 2013 Daniel Mach - 3.0u-2 - Mass rebuild 2013-12-27