summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2015-01-15 19:54:16 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2015-01-15 19:54:16 +0000
commit6db4bdcb5acbdcee70a2e5c661552d2ed4795d1f (patch)
tree47177dce851043f5a81545a094140279487b57dc /sysutils
parentUpdate to 4.3.33 (diff)
New port: sysutils/sbsigntool
Set of utilities for managing UEFI Secure Boot signatures. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=377140
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/sbsigntool/Makefile34
-rw-r--r--sysutils/sbsigntool/distinfo2
-rw-r--r--sysutils/sbsigntool/files/patch-configure15
-rw-r--r--sysutils/sbsigntool/files/patch-src-coff-external.h29
-rw-r--r--sysutils/sbsigntool/files/patch-src-image.h12
-rw-r--r--sysutils/sbsigntool/files/patch-src-sbkeysync.c12
-rw-r--r--sysutils/sbsigntool/pkg-descr1
-rw-r--r--sysutils/sbsigntool/pkg-plist11
9 files changed, 117 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 8e52560b663b..d2ed1fe0d809 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -854,6 +854,7 @@
SUBDIR += sas2ircu
SUBDIR += savelogs
SUBDIR += sb16config
+ SUBDIR += sbsigntool
SUBDIR += scalpel
SUBDIR += scan_ffs
SUBDIR += scanbuttond
diff --git a/sysutils/sbsigntool/Makefile b/sysutils/sbsigntool/Makefile
new file mode 100644
index 000000000000..b7c05afe39b4
--- /dev/null
+++ b/sysutils/sbsigntool/Makefile
@@ -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>
diff --git a/sysutils/sbsigntool/distinfo b/sysutils/sbsigntool/distinfo
new file mode 100644
index 000000000000..1b072cd1f940
--- /dev/null
+++ b/sysutils/sbsigntool/distinfo
@@ -0,0 +1,2 @@
+SHA256 (sbsigntool_0.6.orig.tar.gz) = 84fb0c8f6fb1e79aa418a4f70a3139b38d5630043b28291c875f383e9b4294b8
+SIZE (sbsigntool_0.6.orig.tar.gz) = 212375
diff --git a/sysutils/sbsigntool/files/patch-configure b/sysutils/sbsigntool/files/patch-configure
new file mode 100644
index 000000000000..0275fef319db
--- /dev/null
+++ b/sysutils/sbsigntool/files/patch-configure
@@ -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"
diff --git a/sysutils/sbsigntool/files/patch-src-coff-external.h b/sysutils/sbsigntool/files/patch-src-coff-external.h
new file mode 100644
index 000000000000..51ecda84507c
--- /dev/null
+++ b/sysutils/sbsigntool/files/patch-src-coff-external.h
@@ -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
diff --git a/sysutils/sbsigntool/files/patch-src-image.h b/sysutils/sbsigntool/files/patch-src-image.h
new file mode 100644
index 000000000000..18c42c738fdb
--- /dev/null
+++ b/sysutils/sbsigntool/files/patch-src-image.h
@@ -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
+
diff --git a/sysutils/sbsigntool/files/patch-src-sbkeysync.c b/sysutils/sbsigntool/files/patch-src-sbkeysync.c
new file mode 100644
index 000000000000..c1eba1cc889c
--- /dev/null
+++ b/sysutils/sbsigntool/files/patch-src-sbkeysync.c
@@ -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>
diff --git a/sysutils/sbsigntool/pkg-descr b/sysutils/sbsigntool/pkg-descr
new file mode 100644
index 000000000000..bc4cf17d8dfc
--- /dev/null
+++ b/sysutils/sbsigntool/pkg-descr
@@ -0,0 +1 @@
+Set of utilities for managing UEFI Secure Boot signatures.
diff --git a/sysutils/sbsigntool/pkg-plist b/sysutils/sbsigntool/pkg-plist
new file mode 100644
index 000000000000..a7a84ae3c741
--- /dev/null
+++ b/sysutils/sbsigntool/pkg-plist
@@ -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