New port: sysutils/sbsigntool

Set of utilities for managing UEFI Secure Boot signatures.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2015-01-15 19:54:16 +00:00
parent f10f721657
commit 6db4bdcb5a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=377140
9 changed files with 117 additions and 0 deletions

View file

@ -854,6 +854,7 @@
SUBDIR += sas2ircu SUBDIR += sas2ircu
SUBDIR += savelogs SUBDIR += savelogs
SUBDIR += sb16config SUBDIR += sb16config
SUBDIR += sbsigntool
SUBDIR += scalpel SUBDIR += scalpel
SUBDIR += scan_ffs SUBDIR += scan_ffs
SUBDIR += scanbuttond SUBDIR += scanbuttond

View file

@ -0,0 +1,34 @@
# Created by: Edward Tomasz Napierala <trasz@brick>
# $FreeBSD$
PORTNAME= sbsigntool
PORTVERSION= 0.6
CATEGORIES= sysutils
MASTER_SITES= https://launchpad.net/ubuntu/+archive/primary/+files/
DISTNAME= ${PORTNAME}_${PORTVERSION}.orig
MAINTAINER= trasz@FreeBSD.org
COMMENT= Signing utility for UEFI secure boot
LICENSE= GPLv3
BUILD_DEPENDS= ${NONEXISTENT}:${PORTSDIR}/devel/gnu-efi \
help2man:${PORTSDIR}/misc/help2man
LIB_DEPENDS= libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib
GNU_CONFIGURE= yes
CONFIGURE_ENV= libcrypto_CFLAGS=-lcrypto libcrypto_LIBS=-lcrypto LOCALBASE=${LOCALBASE} ac_cv_header_bfd_h=yes
USES= gmake pkgconfig
.include <bsd.port.pre.mk>
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000
BROKEN= This port works only on FreeBSD 10 and newer
.endif
post-patch:
@${REINPLACE_CMD} -e 's|<endian.h>|<sys/endian.h>|' ${WRKSRC}/configure ${WRKSRC}/lib/ccan/ccan/hash/hash.c
.include <bsd.port.post.mk>

View file

@ -0,0 +1,2 @@
SHA256 (sbsigntool_0.6.orig.tar.gz) = 84fb0c8f6fb1e79aa418a4f70a3139b38d5630043b28291c875f383e9b4294b8
SIZE (sbsigntool_0.6.orig.tar.gz) = 212375

View file

@ -0,0 +1,15 @@
--- configure.orig 2012-10-12 02:16:35.000000000 +0200
+++ configure 2014-11-30 19:14:24.000000000 +0100
@@ -5496,7 +5496,11 @@ $as_echo "yes" >&6; }
fi
EFI_ARCH=$(uname -m)
-EFI_CPPFLAGS="-I/usr/include/efi -I/usr/include/efi/$EFI_ARCH \
+if [ "$EFI_ARCH" = "amd64" ]; then
+ EFI_ARCH="x86_64"
+fi
+
+EFI_CPPFLAGS="-I$LOCALBASE/include/efi -I$LOCALBASE/include/efi/$EFI_ARCH \
-DEFI_FUNCTION_WRAPPER"
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $EFI_CPPFLAGS"

View file

@ -0,0 +1,29 @@
--- src/coff/external.h.orig 2014-11-30 17:11:35.000000000 +0100
+++ src/coff/external.h 2014-11-30 17:12:19.000000000 +0100
@@ -51,7 +51,7 @@ typedef struct external_aouthdr
char entry[4]; /* entry pt. */
char text_start[4]; /* base of text used for this file */
char data_start[4]; /* base of data used for this file */
- } ATTRIBUTE_PACKED
+ } __attribute__((packed))
AOUTHDR;
#define AOUTHDRSZ 28
@@ -165,7 +165,7 @@ struct external_syment
char e_type[2];
char e_sclass[1];
char e_numaux[1];
-} ATTRIBUTE_PACKED ;
+} __attribute__((packed));
#define SYMENT struct external_syment
#define SYMESZ 18
@@ -257,7 +257,7 @@ union external_auxent
char x_tvlen[2]; /* length of .tv */
char x_tvran[2][2]; /* tv range */
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
-} ATTRIBUTE_PACKED ;
+} __attribute__((packed));
#define AUXENT union external_auxent
#define AUXESZ 18

View file

@ -0,0 +1,12 @@
--- src/image.h.orig 2015-01-15 19:43:49.000000000 +0100
+++ src/image.h 2015-01-15 19:49:04.000000000 +0100
@@ -34,6 +34,9 @@
#include <stdint.h>
+#define ATTRIBUTE_UNUSED __unused
+#define ENUM_BITFIELD(X) enum X
+
#include <bfd.h>
#define DO_NOT_DEFINE_LINENO

View file

@ -0,0 +1,12 @@
--- src/sbkeysync.c.orig 2014-11-30 19:18:11.000000000 +0100
+++ src/sbkeysync.c 2014-11-30 19:18:32.000000000 +0100
@@ -38,7 +38,8 @@
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
-#include <sys/statfs.h>
+#include <sys/param.h>
+#include <sys/mount.h>
#include <sys/types.h>
#include <getopt.h>

View file

@ -0,0 +1 @@
Set of utilities for managing UEFI Secure Boot signatures.

View file

@ -0,0 +1,11 @@
bin/sbattach
bin/sbkeysync
bin/sbsiglist
bin/sbsign
bin/sbvarsign
bin/sbverify
man/man1/sbattach.1.gz
man/man1/sbsiglist.1.gz
man/man1/sbsign.1.gz
man/man1/sbvarsign.1.gz
man/man1/sbverify.1.gz