From 59eb44c608c274031fee1e5fadb6200c1bf4644d404b158340e876d0e98086f2 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 16 Jun 2015 07:46:08 +0000 Subject: [PATCH] Accepting request 312219 from home:gary_lin:branches:Base:System Add patches to adopt the latest efivar OBS-URL: https://build.opensuse.org/request/show/312219 OBS-URL: https://build.opensuse.org/package/show/Base:System/pesign?expand=0&rev=32 --- pesign-efivar-pkgconfig.patch | 28 ++++++++ pesign-make-efi_guid_t-const.patch | 107 +++++++++++++++++++++++++++++ pesign.changes | 8 +++ pesign.spec | 8 ++- 4 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 pesign-efivar-pkgconfig.patch create mode 100644 pesign-make-efi_guid_t-const.patch diff --git a/pesign-efivar-pkgconfig.patch b/pesign-efivar-pkgconfig.patch new file mode 100644 index 0000000..40757e6 --- /dev/null +++ b/pesign-efivar-pkgconfig.patch @@ -0,0 +1,28 @@ +From 2a1de2b6535161b1bd600ec2262e81e9f7aeffcc Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 26 May 2015 09:43:10 -0400 +Subject: [PATCH] Make efivar compiler parameters come from pkg-config. + +Signed-off-by: Peter Jones +--- + src/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 007505c..dd69425 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -3,8 +3,8 @@ TOPDIR = $(SRCDIR)/.. + + include $(TOPDIR)/Make.defaults + +-PKLIBS = nss +-LIBS = popt uuid efivar ++PKLIBS = nss efivar ++LIBS = popt uuid + STATIC_LIBS = $(TOPDIR)/libdpe/libdpe.a + LDFLAGS = + CCLDFLAGS = -L../libdpe $(foreach pklib,$(PKLIBS), $(shell pkg-config --libs-only-L $(pklib))) -pie -fPIE -Wl,-z,relro,-z,now +-- +2.1.4 + diff --git a/pesign-make-efi_guid_t-const.patch b/pesign-make-efi_guid_t-const.patch new file mode 100644 index 0000000..62497fa --- /dev/null +++ b/pesign-make-efi_guid_t-const.patch @@ -0,0 +1,107 @@ +From 727f93f8ea3dc467694d541d28ba4f1ed0e0a671 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 7 Nov 2014 14:09:41 -0500 +Subject: [PATCH] make efi_guid_t's const. + +Signed-off-by: Peter Jones +--- + src/cms_common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cms_common.c b/src/cms_common.c +index a360961..7e032c8 100644 +--- a/src/cms_common.c ++++ b/src/cms_common.c +@@ -45,7 +45,7 @@ struct digest_param { + SECOidTag digest_tag; + SECOidTag signature_tag; + SECOidTag digest_encryption_tag; +- efi_guid_t *efi_guid; ++ const efi_guid_t *efi_guid; + int size; + }; + +-- +2.1.4 + +From ac9de615112114e222527b2eabc9b7f2642f01fe Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 26 May 2015 09:42:32 -0400 +Subject: [PATCH] Propogate some "const" declarations better. + +Signed-off-by: Peter Jones +--- + src/efisiglist.c | 2 +- + src/siglist.c | 8 ++++---- + src/siglist.h | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/efisiglist.c b/src/efisiglist.c +index aedfc4c..a078640 100644 +--- a/src/efisiglist.c ++++ b/src/efisiglist.c +@@ -32,7 +32,7 @@ + + struct hash_param { + char *name; +- efi_guid_t *guid; ++ const efi_guid_t *guid; + int size; + }; + +diff --git a/src/siglist.c b/src/siglist.c +index 38a9a2a..a7154aa 100644 +--- a/src/siglist.c ++++ b/src/siglist.c +@@ -51,7 +51,7 @@ struct efi_signature_list { + }; + + struct signature_list { +- efi_guid_t *SignatureType; ++ const efi_guid_t *SignatureType; + uint32_t SignatureListSize; + uint32_t SignatureHeaderSize; + uint32_t SignatureSize; +@@ -60,7 +60,7 @@ struct signature_list { + }; + + struct sig_type { +- efi_guid_t *type; ++ const efi_guid_t *type; + uint32_t size; + }; + +@@ -78,7 +78,7 @@ static struct sig_type sig_types[] = { + static int num_sig_types = sizeof (sig_types) / sizeof (struct sig_type); + + static int32_t +-get_sig_type_size(efi_guid_t *sig_type) ++get_sig_type_size(const efi_guid_t *sig_type) + { + for (int i = 0; i < num_sig_types; i++) { + if (!memcmp(sig_type, sig_types[i].type, sizeof (*sig_type))) +@@ -88,7 +88,7 @@ get_sig_type_size(efi_guid_t *sig_type) + } + + signature_list * +-signature_list_new(efi_guid_t *SignatureType) ++signature_list_new(const efi_guid_t *SignatureType) + { + int32_t size = get_sig_type_size(SignatureType); + if (size < 0) +diff --git a/src/siglist.h b/src/siglist.h +index e789264..2b72a27 100644 +--- a/src/siglist.h ++++ b/src/siglist.h +@@ -21,7 +21,7 @@ + + typedef struct signature_list signature_list; + +-extern signature_list *signature_list_new(efi_guid_t *SignatureType); ++extern signature_list *signature_list_new(const efi_guid_t *SignatureType); + extern int signature_list_add_sig(signature_list *sl, efi_guid_t owner, + uint8_t *sig, uint32_t sigsize); + extern int signature_list_realize(signature_list *sl, +-- +2.1.4 + diff --git a/pesign.changes b/pesign.changes index afc3ab1..8bd0f4b 100644 --- a/pesign.changes +++ b/pesign.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jun 16 06:52:21 UTC 2015 - glin@suse.com + +- Add pesign-efivar-pkgconfig.patch to get the efivar compiler + parameters from pkg-confg +- Add pesign-make-efi_guid_t-const.patch to avoid the error from + gcc + ------------------------------------------------------------------- Wed Nov 26 09:46:50 UTC 2014 - glin@suse.com diff --git a/pesign.spec b/pesign.spec index 96df24e..6a1a527 100644 --- a/pesign.spec +++ b/pesign.spec @@ -1,7 +1,7 @@ # # spec file for package pesign # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -40,6 +40,10 @@ Patch6: pesign-fix-authvar-write-loop.patch Patch7: pesign-install-supplementary-programs.patch # PATCH-FIX-UPSTREAM pesign-fix-import-sig-check.patch glin@suse.com -- Fix the signature size check while importing a signature Patch8: pesign-fix-import-sig-check.patch +# PATCH-FIX-UPSTREAM pesign-efivar-pkgconfig.patch glin@suse.com -- Make efivar compiler parameters come from pkg-config +Patch9: pesign-efivar-pkgconfig.patch +# PATCH-FIX-UPSTREAM pesign-make-efi_guid_t-const.patch glin@suse.com -- make efi_guid_t's const +Patch10: pesign-make-efi_guid_t-const.patch BuildRequires: efivar-devel BuildRequires: libuuid-devel BuildRequires: mozilla-nss-devel @@ -70,6 +74,8 @@ Authors: %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build make %{?_smp_mflags} OPTFLAGS="%{optflags}"