diff --git a/shim-fix-mokmanager-sections.patch b/shim-fix-mokmanager-sections.patch new file mode 100644 index 0000000..5a7dc62 --- /dev/null +++ b/shim-fix-mokmanager-sections.patch @@ -0,0 +1,99 @@ +From 61f1bfea2250c38b6c381a3876b41acf007f4289 Mon Sep 17 00:00:00 2001 +From: Gary Ching-Pang Lin +Date: Mon, 10 Nov 2014 17:19:58 +0800 +Subject: [PATCH 1/2] Fix objcopy parameters to include .rel and .rela + +The objcopy parameters -j .rel* and -j .rela* looked like that the +two sections would be in the EFI binary, but it's actually not, and +this caused MokManager.efi crash. + +Remove the asterisks to fix MokManager.efi. + +Signed-off-by: Gary Ching-Pang Lin +--- + Makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 332a29b..39160c5 100644 +--- a/Makefile ++++ b/Makefile +@@ -133,13 +133,13 @@ FORMAT ?= --target efi-app-$(ARCH) + + %.efi: %.so + $(OBJCOPY) -j .text -j .sdata -j .data \ +- -j .dynamic -j .dynsym -j .rel* \ +- -j .rela* -j .reloc -j .eh_frame \ ++ -j .dynamic -j .dynsym -j .rel \ ++ -j .rela -j .reloc -j .eh_frame \ + -j .vendor_cert \ + $(FORMAT) $^ $@ + $(OBJCOPY) -j .text -j .sdata -j .data \ +- -j .dynamic -j .dynsym -j .rel* \ +- -j .rela* -j .reloc -j .eh_frame \ ++ -j .dynamic -j .dynsym -j .rel \ ++ -j .rela -j .reloc -j .eh_frame \ + -j .debug_info -j .debug_abbrev -j .debug_aranges \ + -j .debug_line -j .debug_str -j .debug_ranges \ + $(FORMAT) $^ $@.debug +-- +1.8.4.5 + + +From a0d319c24c064b3275f4dc91cf141336fb7449fa Mon Sep 17 00:00:00 2001 +From: Gary Ching-Pang Lin +Date: Mon, 10 Nov 2014 17:31:15 +0800 +Subject: [PATCH 2/2] Add nostdinc to the CFLAGS for lib + +We don't need the headers from the standard include path. + +Signed-off-by: Gary Ching-Pang Lin +--- + lib/Makefile | 2 +- + lib/console.c | 4 ++-- + lib/guid.c | 1 - + 3 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/lib/Makefile b/lib/Makefile +index ebd21a1..3c5101e 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -4,7 +4,7 @@ LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variab + + EFI_INCLUDES = -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I../include + +-CFLAGS = -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic \ ++CFLAGS = -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic -nostdinc\ + -fshort-wchar -Wall -DBUILD_EFI -fno-builtin -Werror \ + $(EFI_INCLUDES) + +diff --git a/lib/console.c b/lib/console.c +index 83ee679..fd8cc5c 100644 +--- a/lib/console.c ++++ b/lib/console.c +@@ -4,8 +4,8 @@ + * + * see COPYING file + */ +-#include +-#include ++#include ++#include + + #include + #include +diff --git a/lib/guid.c b/lib/guid.c +index 56ec952..c97a7ca 100644 +--- a/lib/guid.c ++++ b/lib/guid.c +@@ -5,7 +5,6 @@ + */ + + #include +-#include + + #ifndef BUILD_EFI + /* EFI has %g for this, so it's only needed in platform c */ +-- +1.8.4.5 + diff --git a/shim.changes b/shim.changes index 41003c8..d8e2679 100644 --- a/shim.changes +++ b/shim.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 11 04:26:00 UTC 2014 - glin@suse.com + +- Add shim-fix-mokmanager-sections.patch to fix the objcopy + parameters for the EFI files + ------------------------------------------------------------------- Tue Oct 28 04:00:51 UTC 2014 - glin@suse.com diff --git a/shim.spec b/shim.spec index 5a9326d..111b521 100644 --- a/shim.spec +++ b/shim.spec @@ -46,6 +46,8 @@ Patch1: shim-mokx-support.patch Patch2: shim-only-os-name.patch # PATCH-FIX-UPSTREAM shim-fix-gnu-efi-30w.patch glin@suse.com -- Adapt the change in gnu-efi 3.0w Patch3: shim-fix-gnu-efi-30w.patch +# PATCH-FIX-UPSTREAM shim-fix-mokmanager-sections.patch glin@suse.com -- Fix the objcopy parameters for the EFI files +Patch4: shim-fix-mokmanager-sections.patch # PATCH-FIX-OPENSUSE shim-opensuse-cert-prompt.patch glin@suse.com -- Show the prompt to ask whether the user trusts openSUSE certificate or not Patch100: shim-opensuse-cert-prompt.patch BuildRequires: gnu-efi >= 3.0t @@ -74,6 +76,7 @@ Authors: %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %patch100 -p1 %build