Index: head/sysutils/shim/Makefile =================================================================== --- head/sysutils/shim/Makefile (revision 487804) +++ head/sysutils/shim/Makefile (revision 487805) @@ -1,42 +1,42 @@ # Created by: Edward Tomasz Napierala # $FreeBSD$ PORTNAME= shim PORTVERSION= 0.9 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MAINTAINER= egypcio@FreeBSD.org COMMENT= UEFI Secure Boot shim loader LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/COPYRIGHT BUILD_DEPENDS= ${LOCALBASE}/lib/libgnuefi.a:devel/gnu-efi \ bash:shells/bash USES= compiler gmake shebangfix -USE_CSTD= gnu89 +USE_CSTD= gnu99 USE_GCC= yes SHEBANG_FILES= make-certs USE_GITHUB= yes GH_ACCOUNT= mjg59 MAKE_ARGS= CC="${CC} ${CFLAGS:M-std=*}" LD="${LD}" OBJCOPY="${OBJCOPY}" MAKE_JOBS_UNSAFE= yes PLIST_FILES= lib/shim/shim.pem lib/shim/shim.key \ lib/shim/MokManager.efi lib/shim/fallback.efi lib/shim/shim.efi do-install: # Note that before this step, the shim.pem contains the _private_ key. openssl x509 -inform der -in ${WRKSRC}/shim.cer -outform pem -out ${WRKSRC}/shim.pem ${MKDIR} ${STAGEDIR}${PREFIX}/lib/shim ${INSTALL_DATA} -m 600 ${WRKSRC}/shim.key ${STAGEDIR}${PREFIX}/lib/shim .for file in shim.pem MokManager.efi fallback.efi shim.efi ${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${PREFIX}/lib/shim .endfor .include Index: head/sysutils/shim/files/patch-Cryptlib-Makefile =================================================================== --- head/sysutils/shim/files/patch-Cryptlib-Makefile (revision 487804) +++ head/sysutils/shim/files/patch-Cryptlib-Makefile (revision 487805) @@ -1,9 +1,12 @@ --- Cryptlib/Makefile.orig 2015-06-30 18:20:12 UTC +++ Cryptlib/Makefile -@@ -1,3 +1,6 @@ +@@ -1,3 +1,9 @@ +ifeq ($(ARCH),amd64) + override ARCH = x86_64 ++endif ++ifeq ($(ARCH),i386) ++ override ARCH = ia32 +endif EFI_INCLUDES = -IInclude -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol Index: head/sysutils/shim/files/patch-Cryptlib-OpenSSL-Makefile =================================================================== --- head/sysutils/shim/files/patch-Cryptlib-OpenSSL-Makefile (revision 487804) +++ head/sysutils/shim/files/patch-Cryptlib-OpenSSL-Makefile (revision 487805) @@ -1,9 +1,12 @@ --- Cryptlib/OpenSSL/Makefile.orig 2015-06-30 18:20:12 UTC +++ Cryptlib/OpenSSL/Makefile -@@ -1,3 +1,6 @@ +@@ -1,3 +1,9 @@ +ifeq ($(ARCH),amd64) + override ARCH = x86_64 ++endif ++ifeq ($(ARCH),i386) ++ override ARCH = ia32 +endif EFI_INCLUDES = -I../Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol Index: head/sysutils/shim/files/patch-Makefile =================================================================== --- head/sysutils/shim/files/patch-Makefile (revision 487804) +++ head/sysutils/shim/files/patch-Makefile (revision 487805) @@ -1,53 +1,56 @@ --- Makefile.orig 2015-06-30 18:20:12 UTC +++ Makefile @@ -1,5 +1,5 @@ VERSION = 0.9 -RELEASE := +RELEASE := "" ifneq ($(RELEASE),"") RELEASE="-$(RELEASE)" endif -@@ -9,15 +9,20 @@ LD = $(CROSS_COMPILE)ld +@@ -9,15 +9,23 @@ LD = $(CROSS_COMPILE)ld OBJCOPY = $(CROSS_COMPILE)objcopy ARCH = $(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,) + +ifeq ($(ARCH),amd64) + override ARCH := x86_64 +endif ++ifeq ($(ARCH),i386) ++ override ARCH := ia32 ++endif + OBJCOPY_GTE224 = $(shell expr `$(OBJCOPY) --version |grep ^"GNU objcopy" | sed 's/^.* //g' | cut -f1-2 -d.` \>= 2.24) SUBDIRS = Cryptlib lib -LIB_PATH = /usr/lib64 +LIB_PATH = /usr/lib -L$(LOCALBASE)/lib -EFI_INCLUDE := /usr/include/efi -EFI_INCLUDES = -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I$(shell pwd)/include -EFI_PATH := /usr/lib64/gnuefi +EFI_INCLUDE := $(LOCALBASE)/include/efi +EFI_INCLUDES = -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I$(shell pwd)/include -I/usr/include +EFI_PATH := $(LOCALBASE)/lib LIB_GCC = $(shell $(CC) -print-libgcc-file-name) EFI_LIBS = -lefi -lgnuefi --start-group Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a --end-group $(LIB_GCC) -@@ -65,7 +70,7 @@ endif +@@ -65,7 +73,7 @@ endif LDFLAGS = --hash-style=sysv -nostdlib -znocombreloc -T $(EFI_LDS) -shared -Bsymbolic -L$(EFI_PATH) -L$(LIB_PATH) -LCryptlib -LCryptlib/OpenSSL $(EFI_CRT_OBJS) --build-id=sha1 -TARGET = shim.efi MokManager.efi.signed fallback.efi.signed +TARGET = shim.efi MokManager.efi fallback.efi OBJS = shim.o netboot.o cert.o replacements.o version.o KEYS = shim_cert.h ocsp.* ca.* shim.crt shim.csr shim.p12 shim.pem shim.key shim.cer SOURCES = shim.c shim.h netboot.c include/PeImage.h include/wincert.h include/console.h replacements.c replacements.h version.c version.h -@@ -156,9 +161,6 @@ endif +@@ -156,9 +164,6 @@ endif -j .note.gnu.build-id \ $(FORMAT) $^ $@.debug -%.efi.signed: %.efi certdb/secmod.db - pesign -n certdb -i $< -c "shim" -s -o $@ -f - clean: $(MAKE) -C Cryptlib clean $(MAKE) -C Cryptlib/OpenSSL clean Index: head/sysutils/shim/files/patch-MokManager.c =================================================================== --- head/sysutils/shim/files/patch-MokManager.c (nonexistent) +++ head/sysutils/shim/files/patch-MokManager.c (revision 487805) @@ -0,0 +1,16 @@ +--- MokManager.c.orig 2015-06-30 18:20:12 UTC ++++ MokManager.c +@@ -588,11 +588,11 @@ static void show_mok_info (EFI_GUID Type + + static EFI_STATUS list_keys (void *KeyList, UINTN KeyListSize, CHAR16 *title) + { +- INTN MokNum = 0; ++ UINT32 MokNum = 0; + MokListNode *keys = NULL; + UINT32 key_num = 0; + CHAR16 **menu_strings; +- int i; ++ UINT32 i; + + if (KeyListSize < (sizeof(EFI_SIGNATURE_LIST) + + sizeof(EFI_SIGNATURE_DATA))) { Property changes on: head/sysutils/shim/files/patch-MokManager.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/sysutils/shim/files/patch-elf__ia32__efi.lds =================================================================== --- head/sysutils/shim/files/patch-elf__ia32__efi.lds (nonexistent) +++ head/sysutils/shim/files/patch-elf__ia32__efi.lds (revision 487805) @@ -0,0 +1,8 @@ +--- elf_ia32_efi.lds.orig 2018-12-15 14:43:25 UTC ++++ elf_ia32_efi.lds +@@ -1,4 +1,4 @@ +-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") ++OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", "elf32-i386-freebsd") + OUTPUT_ARCH(i386) + ENTRY(_start) + SECTIONS Property changes on: head/sysutils/shim/files/patch-elf__ia32__efi.lds ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/sysutils/shim/files/patch-lib-Makefile =================================================================== --- head/sysutils/shim/files/patch-lib-Makefile (revision 487804) +++ head/sysutils/shim/files/patch-lib-Makefile (revision 487805) @@ -1,10 +1,13 @@ --- lib/Makefile.orig 2015-06-30 18:20:12 UTC +++ lib/Makefile -@@ -1,3 +1,7 @@ +@@ -1,3 +1,10 @@ +ifeq ($(ARCH),amd64) + override ARCH = x86_64 ++endif ++ifeq ($(ARCH),i386) ++ override ARCH = ia32 +endif + TARGET = lib.a LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variables.o security_policy.o