pesign/pesign-suse-build.patch
Gary Ching-Pang Lin 2a0da6d5f1 - Update to 115
+ macros: drop %{_pesign_args}
  + Fix two bugs from package building
  + Fix bad free of cms data (DoS only)
  + Send pesign stdout/err to systemd journal
  + Add missing Install section
  + Add default packages for pkg-config
  + Short delay to ensure /run/pesign/socket exists
  + Resolve crash when signature that is removed is not the end of
    the list
  + Enhance error diagnostics about version mismatch
  + Upstream all Fedora changes
  + Add some hardening options to build
  + Add code of conduct
  + Fix build on gcc 12 and non-Fedora
- Refresh patches
  + harden_pesign.service.patch
  + pesign-boo1143063-remove-var-tracking.patch
  + pesign-boo1185663-set-rpmmacrodir.patch
  + pesign-fix-authvar-write-loop.patch
  + pesign-suse-build.patch
- Remove upstreamed/unnecessary patches
  + pesign-boo1158197-fix-pesigncheck-gcc10.patch
  + pesign-efikeygen-Fix-the-build-with-nss-3.44.patch
  + pesign-privkey_unneeded.diff
  + pesign-run.patch
  + Fix wrong oid offsets (bsc#1205323)

OBS-URL: https://build.opensuse.org/package/show/Base:System/pesign?expand=0&rev=66
2022-12-02 08:28:13 +00:00

87 lines
3.1 KiB
Diff

Index: pesign-115/util/Makefile
===================================================================
--- pesign-115.orig/util/Makefile
+++ pesign-115/util/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/Make.efirules
include $(TOPDIR)/Make.defaults
FORMAT=efi-app-$(HOSTARCH)
-LDFLAGS = -nostdlib -T $(LIBDIR)/gnuefi/elf_$(HOSTARCH)_efi.lds -shared -Bsymbolic $(LIBDIR)/gnuefi/crt0-efi-$(HOSTARCH).o -L$(LIBDIR)
+LDFLAGS = -nostdlib -T $(LIBDIR)/elf_$(HOSTARCH)_efi.lds -shared -Bsymbolic $(LIBDIR)/crt0-efi-$(HOSTARCH).o -L$(LIBDIR)
LIBS=-lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
CCLDFLAGS =
BUILDFLAGS = -I/usr/include/efi/ -I/usr/include/efi/$(HOSTARCH)/ -I/usr/include/efi/protocol -fpic -fshort-wchar -fno-reorder-functions -fno-strict-aliasing -fno-merge-constants -mno-red-zone -Wimplicit-function-declaration
@@ -20,8 +20,8 @@ clean :
@rm -rfv *.o *.a *.so .*.d $(TARGETS)
install :
- $(INSTALL) -d -m 755 $(INSTALLROOT)/boot/efi/EFI/redhat/
- $(INSTALL) -m 755 *.efi $(INSTALLROOT)/boot/efi/EFI/redhat/
+ $(INSTALL) -d -m 755 $(INSTALLROOT)/boot/efi/EFI/sles/
+ $(INSTALL) -m 755 *.efi $(INSTALLROOT)/boot/efi/EFI/sles/
install_systemd:
Index: pesign-115/src/pesign.sysvinit.in
===================================================================
--- pesign-115.orig/src/pesign.sysvinit.in
+++ pesign-115/src/pesign.sysvinit.in
@@ -6,16 +6,19 @@
# processname: /usr/bin/pesign
# pidfile: @@RUNDIR@@pesign.pid
### BEGIN INIT INFO
-# Provides: pesign
-# Default-Start:
-# Default-Stop:
+# Provides: pesign
+# Should-Start: $remote_fs
+# Should-Stop: $remote_fs
+# Required-Start:
+# Required-Stop:
+# Default-Start: 2 3 5
# Short-Description: The pesign PE signing daemon
# Description: The pesign PE signing daemon
### END INIT INFO
-. /etc/init.d/functions
[ -f /usr/bin/pesign ] || exit 1
+PESIGN_PIDFILE=@@RUNDIR@@pesign.pid
RETVAL=0
start(){
@@ -23,7 +26,7 @@ start(){
mkdir @@RUNDIR@@pesign 2>/dev/null &&
chown pesign:pesign @@RUNDIR@@pesign &&
chmod 0770 @@RUNDIR@@pesign
- daemon /usr/bin/pesign --daemonize
+ startproc -f -p "$PESIGN_PIDFILE" /usr/bin/pesign --daemonize
RETVAL=$?
echo
touch /var/lock/subsys/pesign
Index: pesign-115/Make.defaults
===================================================================
--- pesign-115.orig/Make.defaults
+++ pesign-115/Make.defaults
@@ -83,7 +83,7 @@ CPPFLAGS ?= -D_FORTIFY_SOURCE=2
RANLIBFLAGS ?= $(if $(filter $(CC),gcc),-D)
ARFLAGS ?= $(if $(filter $(CC),gcc),-Dcvqs)$(if $(filter $(CC),clang),-cqvs)
-LDLIBS = $(foreach lib,$(LIBS),-l$(lib)) $(call pkg-config-ldlibs)
+LDLIBS = -lpthread $(foreach lib,$(LIBS),-l$(lib)) $(call pkg-config-ldlibs)
ifeq ($(ARCH),ia64)
efi_cflags += -mfixed-range=f32-f127
Index: pesign-115/Makefile
===================================================================
--- pesign-115.orig/Makefile
+++ pesign-115/Makefile
@@ -11,7 +11,6 @@ SUBDIRS := include libdpe src
install :
$(INSTALL) -d -m 755 $(INSTALLROOT)$(docdir)/pesign-$(VERSION)/
- $(INSTALL) -pm 644 COPYING $(INSTALLROOT)$(docdir)/pesign-$(VERSION)/
@$(call descend)
install_systemd install_sysvinit : install