diff --git a/srcpkgs/coreboot-utils-me_cleaner b/srcpkgs/coreboot-utils-me_cleaner new file mode 120000 index 00000000000..203b5756865 --- /dev/null +++ b/srcpkgs/coreboot-utils-me_cleaner @@ -0,0 +1 @@ +coreboot-utils \ No newline at end of file diff --git a/srcpkgs/coreboot-utils/patches/inteltool-musl.patch b/srcpkgs/coreboot-utils/patches/inteltool-musl.patch new file mode 100644 index 00000000000..ecb9c7f696c --- /dev/null +++ b/srcpkgs/coreboot-utils/patches/inteltool-musl.patch @@ -0,0 +1,11 @@ +--- util/inteltool/inteltool.h 2018-08-27 12:35:48.049321340 +0200 ++++ util/inteltool/inteltool.h 2018-08-27 12:30:27.434969376 +0200 +@@ -21,7 +21,7 @@ + + #include + +-#if defined(__GLIBC__) ++#if !(defined(__FreeBSD__) || defined(__OpenBSD__) ||defined(__NetBSD__) || defined(__DARWIN__)) + #include + #endif + #if (defined(__MACH__) && defined(__APPLE__)) diff --git a/srcpkgs/coreboot-utils/patches/nvramtool-musl.patch b/srcpkgs/coreboot-utils/patches/nvramtool-musl.patch new file mode 100644 index 00000000000..ba152cd5cb5 --- /dev/null +++ b/srcpkgs/coreboot-utils/patches/nvramtool-musl.patch @@ -0,0 +1,11 @@ +--- util/nvramtool/accessors/cmos-hw-unix.c 2018-08-27 12:20:14.139599118 +0200 ++++ util/nvramtool/accessors/cmos-hw-unix.c 2018-08-27 12:19:45.558280906 +0200 +@@ -11,7 +11,7 @@ + #define INW(x) __extension__ ({ u_int tmp = (x); inw(tmp); }) + #define INL(x) __extension__ ({ u_int tmp = (x); inl(tmp); }) + #else +-#if defined(__GLIBC__) && (defined(__i386__) || defined(__x86_64__)) ++#if (defined(__i386__) || defined(__x86_64__)) && !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)) + #include + #endif + #if (defined(__MACH__) && defined(__APPLE__)) diff --git a/srcpkgs/coreboot-utils/patches/superiotool-musl.patch b/srcpkgs/coreboot-utils/patches/superiotool-musl.patch new file mode 100644 index 00000000000..779ccee3c31 --- /dev/null +++ b/srcpkgs/coreboot-utils/patches/superiotool-musl.patch @@ -0,0 +1,22 @@ +--- util/superiotool/Makefile 2018-05-16 21:00:17.000000000 +0200 ++++ util/superiotool/Makefile 2018-08-27 12:56:28.070741476 +0200 +@@ -25,7 +25,7 @@ + VERSION := -D'SUPERIOTOOL_VERSION="$(shell git describe 2>/dev/null)"' + + CFLAGS += -O2 -Wall -Wstrict-prototypes -Wundef -Wstrict-aliasing \ +- -Werror-implicit-function-declaration -ansi -pedantic $(VERSION) ++ -Werror-implicit-function-declaration -pedantic $(VERSION) + LDFLAGS += -lz + + OBJS = superiotool.o serverengines.o ali.o exar.o fintek.o ite.o nsc.o \ +--- util/superiotool/superiotool.h 2018-05-16 21:00:17.000000000 +0200 ++++ util/superiotool/superiotool.h 2018-08-27 12:50:25.627387315 +0200 +@@ -25,7 +25,7 @@ + #include + #include + #include +-#if defined(__GLIBC__) ++#if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)) + #include + #endif + #if (defined(__MACH__) && defined(__APPLE__)) diff --git a/srcpkgs/coreboot-utils/template b/srcpkgs/coreboot-utils/template new file mode 100644 index 00000000000..cba5be90462 --- /dev/null +++ b/srcpkgs/coreboot-utils/template @@ -0,0 +1,43 @@ +# Template file for 'coreboot-utils' +pkgname=coreboot-utils +version=4.8.1 +revision=1 +only_for_archs="i686 i686-musl x86_64 x86_64-musl" +build_style=gnu-makefile +wrksrc="coreboot-${version}" +build_wrksrc="util" +makedepends="pciutils-devel zlib-devel" +short_desc="Coreboot firmware utilities" +maintainer="m3tav3rse " +license="GPL-2.0-only" +homepage="https://coreboot.org" +distfiles="https://coreboot.org/releases/coreboot-${version}.tar.xz>${pkgname}-\ +${version}.tar.xz" +checksum=f0ddf4db0628c1fe1e8348c40084d9cbeb5771400c963fd419cda3995b69ad23 + +do_build() { + for util in cbfstool cbmem ectool ifdtool inteltool intelmetool \ + nvramtool superiotool; do + make ${makejobs} -C $util + done +} + +do_install() { + for util in cbfstool cbmem ectool ifdtool inteltool intelmetool \ + nvramtool superiotool; do + vbin $util/$util + done + vman inteltool/inteltool.8 + vman nvramtool/cli/nvramtool.8 + vman superiotool/superiotool.8 +} + +coreboot-utils-me_cleaner_package() { + depends="python3" + short_desc+=" - tool for partial deblobbing Intel ME/TXE firmware" + license="GPL-3.0-or-later" + pkg_install() { + vbin me_cleaner/me_cleaner.py me_cleaner + vman me_cleaner/man/me_cleaner.1 + } +}