summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorMaxin B. John <maxin.john@intel.com>2016-03-31 12:00:16 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-31 23:01:37 +0100
commit22bd875a5a7a5ccd8021c17ebb9b3eab2226f190 (patch)
treeeefb6f710d97e61ddc5469960a78640feba27843 /meta/recipes-core
parent4b7790915f77731e2bcb5ed3159cc8f4d8adc176 (diff)
downloadpoky-22bd875a5a7a5ccd8021c17ebb9b3eab2226f190.tar.gz
systemd: fix build with gcrypt PACKAGECONFIG disabled
systemd-resolved build fails without gcrypt PACKAGECONFIG. Backport the fix. Also remove the comment about resolved's dependence on gcrypt. [YOCTO #9219] (From OE-Core rev: 5ba3115a699357a5d272836b7edf883753a551d0) Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch122
-rw-r--r--meta/recipes-core/systemd/systemd_229.bb2
2 files changed, 123 insertions, 1 deletions
diff --git a/meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch b/meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch
new file mode 100644
index 0000000000..1ae3d66c78
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch
@@ -0,0 +1,122 @@
1From b68f10bf1f7519e012da5e35fab3a57da7dc46d4 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
3Date: Sun, 27 Mar 2016 17:33:54 -0400
4Subject: [PATCH] build-sys: fix build with libgrcypt disabled
5
6- Move gcrypt.h include inside grcrypt-util.h.
7- Allow gcrypt-util.[ch] to be compiled even without gcrypt.
8This allows the logic in files using gcrypt to be simplified.
9
10- Fix compilation of systemd-resolve without gcrypt.
11systemd-resolved already supported that.
12
13Upstream-Status: Backport [ https://github.com/systemd/systemd/pull/2905 ]
14
15Fixes [YOCTO #9219]
16
17Signed-off-by: Maxin B. John <maxin.john@intel.com>
18---
19 Makefile.am | 8 ++++----
20 src/resolve/resolve-tool.c | 3 +--
21 src/shared/gcrypt-util.c | 4 +++-
22 src/shared/gcrypt-util.h | 14 ++++++++++++++
23 4 files changed, 22 insertions(+), 7 deletions(-)
24
25diff --git a/Makefile.am b/Makefile.am
26index 2b72a53..95eaa9a 100644
27--- a/Makefile.am
28+++ b/Makefile.am
29@@ -4262,7 +4262,9 @@ libsystemd_journal_internal_la_SOURCES = \
30 src/journal/mmap-cache.h \
31 src/journal/compress.c \
32 src/journal/audit-type.h \
33- src/journal/audit-type.c
34+ src/journal/audit-type.c \
35+ src/shared/gcrypt-util.h \
36+ src/shared/gcrypt-util.c
37
38 nodist_libsystemd_journal_internal_la_SOURCES = \
39 src/journal/audit_type-to-name.h
40@@ -4294,9 +4296,7 @@ libsystemd_journal_internal_la_SOURCES += \
41 src/journal/journal-authenticate.c \
42 src/journal/journal-authenticate.h \
43 src/journal/fsprg.c \
44- src/journal/fsprg.h \
45- src/shared/gcrypt-util.c \
46- src/shared/gcrypt-util.h
47+ src/journal/fsprg.h
48
49 libsystemd_journal_internal_la_LIBADD += \
50 $(GCRYPT_LIBS)
51diff --git a/src/resolve/resolve-tool.c b/src/resolve/resolve-tool.c
52index 009cc73..14ee01c 100644
53--- a/src/resolve/resolve-tool.c
54+++ b/src/resolve/resolve-tool.c
55@@ -17,7 +17,6 @@
56 along with systemd; If not, see <http://www.gnu.org/licenses/>.
57 ***/
58
59-#include <gcrypt.h>
60 #include <getopt.h>
61 #include <net/if.h>
62
63@@ -863,7 +862,7 @@ static int resolve_openpgp(sd_bus *bus, const char *address) {
64 }
65 domain++;
66
67- r = string_hashsum(address, domain - 1 - address, GCRY_MD_SHA224, &hashed);
68+ r = string_hashsum_sha224(address, domain - 1 - address, &hashed);
69 if (r < 0)
70 return log_error_errno(r, "Hashing failed: %m");
71
72diff --git a/src/shared/gcrypt-util.c b/src/shared/gcrypt-util.c
73index 4ff9452..39b544b 100644
74--- a/src/shared/gcrypt-util.c
75+++ b/src/shared/gcrypt-util.c
76@@ -19,10 +19,11 @@
77 along with systemd; If not, see <http://www.gnu.org/licenses/>.
78 ***/
79
80+#ifdef HAVE_GCRYPT
81 #include <gcrypt.h>
82
83-#include "hexdecoct.h"
84 #include "gcrypt-util.h"
85+#include "hexdecoct.h"
86
87 void initialize_libgcrypt(bool secmem) {
88 const char *p;
89@@ -67,3 +68,4 @@ int string_hashsum(const char *s, size_t len, int md_algorithm, char **out) {
90 *out = enc;
91 return 0;
92 }
93+#endif
94diff --git a/src/shared/gcrypt-util.h b/src/shared/gcrypt-util.h
95index c7652c2..cf33b3c 100644
96--- a/src/shared/gcrypt-util.h
97+++ b/src/shared/gcrypt-util.h
98@@ -19,7 +19,21 @@
99 along with systemd; If not, see <http://www.gnu.org/licenses/>.
100 ***/
101
102+#include <errno.h>
103 #include <stdbool.h>
104+#include <stddef.h>
105+
106+#ifdef HAVE_GCRYPT
107+#include <gcrypt.h>
108
109 void initialize_libgcrypt(bool secmem);
110 int string_hashsum(const char *s, size_t len, int md_algorithm, char **out);
111+#endif
112+
113+static inline int string_hashsum_sha224(const char *s, size_t len, char **out) {
114+#ifdef HAVE_GCRYPT
115+ return string_hashsum(s, len, GCRY_MD_SHA224, out);
116+#else
117+ return -EOPNOTSUPP;
118+#endif
119+}
120--
1212.4.0
122
diff --git a/meta/recipes-core/systemd/systemd_229.bb b/meta/recipes-core/systemd/systemd_229.bb
index b16cacb10f..309a4c3a08 100644
--- a/meta/recipes-core/systemd/systemd_229.bb
+++ b/meta/recipes-core/systemd/systemd_229.bb
@@ -53,6 +53,7 @@ SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \
53 file://0020-check-for-uchar.h-in-configure.patch \ 53 file://0020-check-for-uchar.h-in-configure.patch \
54 file://0021-include-missing.h-for-getting-secure_getenv-definiti.patch \ 54 file://0021-include-missing.h-for-getting-secure_getenv-definiti.patch \
55 file://0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \ 55 file://0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
56 file://0023-build-sys-fix-build-with-libgrcypt-disabled.patch \
56" 57"
57SRC_URI_append_libc-uclibc = "\ 58SRC_URI_append_libc-uclibc = "\
58 file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \ 59 file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
@@ -101,7 +102,6 @@ PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
101PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" 102PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
102PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" 103PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
103PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils" 104PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
104# resolved needs gcrypt
105PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved" 105PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
106PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd" 106PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
107PACKAGECONFIG[machined] = "--enable-machined,--disable-machined" 107PACKAGECONFIG[machined] = "--enable-machined,--disable-machined"