From bba72903eca8ead305ebb80cd61986b745057ca8 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 13 Jun 2026 20:01:19 +0300 Subject: [PATCH] Switch to new package format --- pkg.info => info.yml | 4 +- source.sh => recipe.sh | 8 ++- source-files/sbsigntools-binutils.patch | 12 +++++ source-files/sbsigntools-gnu-efi.patch | 65 +++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 2 deletions(-) rename pkg.info => info.yml (91%) rename source.sh => recipe.sh (86%) create mode 100644 source-files/sbsigntools-binutils.patch create mode 100644 source-files/sbsigntools-gnu-efi.patch diff --git a/pkg.info b/info.yml similarity index 91% rename from pkg.info rename to info.yml index b9b3ceb..43f4f80 100644 --- a/pkg.info +++ b/info.yml @@ -1,9 +1,11 @@ name: sbsigntools description: Tools to add signatures to EFI binaries and Drivers version: 0.9.5 -revision: 1 +revision: 2 url: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/ license: GPL3-or-later +maintainers: + - enumdev@enumerated.dev architecture: any type: source depends: diff --git a/source.sh b/recipe.sh similarity index 86% rename from source.sh rename to recipe.sh index 7cc8dee..ed6d57c 100644 --- a/source.sh +++ b/recipe.sh @@ -1,4 +1,4 @@ -# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT @@ -6,8 +6,14 @@ # This function is used for putting downloaded files to the correct location or applying patches prepare() { cd "$BPM_SOURCE" + git submodule init git submodule update + + # Patches from Fedora + patch -Np1 -i "$BPM_WORKDIR"/sbsigntools-gnu-efi.patch + patch -Np1 -i "$BPM_WORKDIR"/sbsigntools-binutils.patch + ./autogen.sh } diff --git a/source-files/sbsigntools-binutils.patch b/source-files/sbsigntools-binutils.patch new file mode 100644 index 0000000..9658db1 --- /dev/null +++ b/source-files/sbsigntools-binutils.patch @@ -0,0 +1,12 @@ +diff -up sbsigntools-0.9.5/tests/Makefile.am.orig sbsigntools-0.9.5/tests/Makefile.am +--- sbsigntools-0.9.5/tests/Makefile.am.orig 2025-10-03 10:20:11.676718647 +0200 ++++ sbsigntools-0.9.5/tests/Makefile.am 2025-10-03 10:20:40.506763759 +0200 +@@ -18,7 +18,7 @@ if TEST_BINARY_FORMAT + EFILDFLAGS = --defsym=EFI_SUBSYSTEM=0x0a + FORMAT = -O binary + else +-FORMAT = --target=efi-app-$(EFI_ARCH:x64=x86_64) ++FORMAT = --output-target=efi-app-$(EFI_ARCH:x64=x86_64) + endif + check_DATA = $(test_key) $(test_cert) + check_SCRIPTS = test-wrapper.sh diff --git a/source-files/sbsigntools-gnu-efi.patch b/source-files/sbsigntools-gnu-efi.patch new file mode 100644 index 0000000..349fe46 --- /dev/null +++ b/source-files/sbsigntools-gnu-efi.patch @@ -0,0 +1,65 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -68,18 +68,29 @@ PKG_CHECK_MODULES(uuid, uuid, + + dnl gnu-efi headers require extra include dirs + EFI_ARCH=$(uname -m | sed 's/i.86/ia32/;s/arm.*/arm/') +-AM_CONDITIONAL(TEST_BINARY_FORMAT, [ test "$EFI_ARCH" = "arm" -o "$EFI_ARCH" = "aarch64" -o "$EFI_ARCH" = riscv64 ]) ++AM_CONDITIONAL(TEST_BINARY_FORMAT, [ test "$EFI_ARCH" = "arm" -o "$EFI_ARCH" = riscv64 ]) + + ## + # no consistent view of where gnu-efi should dump the efi stuff, so find it + ## +-for path in /lib /lib64 /usr/lib /usr/lib64 /usr/lib32 /lib/efi /lib64/efi /usr/lib/efi /usr/lib64/efi /usr/lib/gnuefi /usr/lib64/gnuefi ; do +- if test -e $path/crt0-efi-$EFI_ARCH.o; then ++AC_MSG_CHECKING([gnu-efi crt path]) ++for path in /lib /lib64 /usr/lib /usr/lib64 /usr/lib32 /lib/efi /lib64/efi /usr/lib/efi /usr/lib64/efi /usr/lib/gnuefi /usr/lib64/gnuefi /usr/lib/gnuefi/$EFI_ARCH ; do ++ if test -e $path/crt0.o; then + CRTPATH=$path ++ CRT=crt0.o ++ LDS=efi.lds ++ EFI_PATH=$path ++ elif test -e $path/crt0-efi-$EFI_ARCH.o; then ++ CRTPATH=$path ++ CRT=crt0-efi-${EFI_ARCH}.o ++ LDS=elf_${EFI_ARCH}_efi.lds ++ EFI_PATH=$path + fi + done + if test -z "$CRTPATH"; then + AC_MSG_ERROR([cannot find the gnu-efi crt path]) ++else ++ AC_MSG_RESULT($CRTPATH) + fi + + EFI_CPPFLAGS="-I/usr/include/efi -I/usr/include/efi/$EFI_ARCH \ +@@ -91,6 +102,9 @@ CPPFLAGS="$CPPFLAGS_save" + AC_SUBST(EFI_CPPFLAGS, $EFI_CPPFLAGS) + AC_SUBST(EFI_ARCH, $EFI_ARCH) + AC_SUBST(CRTPATH, $CRTPATH) ++AC_SUBST(CRT, $CRT) ++AC_SUBST(LDS, $LDS) ++AC_SUBST(EFI_PATH, $EFI_PATH) + + AC_CONFIG_FILES([Makefile src/Makefile lib/ccan/Makefile] + [docs/Makefile tests/Makefile]) +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -18,7 +18,7 @@ if TEST_BINARY_FORMAT + EFILDFLAGS = --defsym=EFI_SUBSYSTEM=0x0a + FORMAT = -O binary + else +-FORMAT = --target=efi-app-$(EFI_ARCH) ++FORMAT = --target=efi-app-$(EFI_ARCH:x64=x86_64) + endif + check_DATA = $(test_key) $(test_cert) + check_SCRIPTS = test-wrapper.sh +@@ -31,7 +31,7 @@ check_SCRIPTS = test-wrapper.sh + $(FORMAT) $^ $@ + + .$(OBJEXT).elf: +- $(LD) $(EFILDFLAGS) -nostdlib -L /usr/lib -L /usr/lib64 -L $(CRTPATH) -shared -Bsymbolic $(CRTPATH)/crt0-efi-$(EFI_ARCH).o -T elf_$(EFI_ARCH)_efi.lds $< -o $@ -lefi -lgnuefi ++ $(LD) $(EFILDFLAGS) -nostdlib -L /usr/lib -L /usr/lib64 -L $(CRTPATH) -shared -Bsymbolic $(CRTPATH)/$(CRT) -T $(LDS) $< -o $@ $(EFI_PATH)/libefi.a $(EFI_PATH)/libgnuefi.a + + AM_CFLAGS=-fpic -I/usr/include/efi -I/usr/include/efi/$(EFI_ARCH) +