All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH 0/6] meta-networking patchwork cleanup
@ 2017-10-30 18:11 Joe MacDonald
  2017-10-30 18:11 ` [meta-networking][PATCH 1/6] ddclient: new package Joe MacDonald
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Joe MacDonald @ 2017-10-30 18:11 UTC (permalink / raw)
  To: openembedded-devel

When I started comparing the state of meta-networking/master to master-next and
to patchwork's own view of pending meta-networking patches I found some
disconnects.  So I've been chipping away at this for the last few days, trying
to bring everything in sync.

I've rejected/accepted the patches in patchwork that I was able to verify have
either been rejected or merged already.

ddclient died on the vine for no particular reason, so I refreshed it and added
the persistence support as noted in the patch itself.

Following that was Jackie's update to include freediameter, but it depended on
the currently-broken lksctp-tools, so I took a stab at fixing that.

There was a pending update to bridge-utils for using the xtools AR, but that
needed rework, so I did the rework and updated bridge-utils at the same time.

Finally, most of openssl-no-weak-cyphers was thrown away for good reason, but
two of the patches still made sense to include in meta-networking, IMO, with
just some minor rework, so I did that too.

Here's the report:

Jackie Huang (2):
  freediameter: add new recipe
  net-snmp: support openssl without 3des

Joe MacDonald (2):
  lksctp-tools: update and remove from blacklist
  bridge-utils: update to v1.6

Kai Kang (1):
  stunnel: fix compile error when openssl disable des support

Kinsella, Ray (1):
  ddclient: new package

 .../recipes-daemons/ddclient/ddclient_3.8.3.bb     |  44 ++++
 .../recipes-daemons/ddclient/files/ip-up           |   4 +
 .../recipes-daemons/ddclient/files/persistent      |   1 +
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 .../net-snmp/net-snmp-fix-for-disable-des.patch    |  32 +++
 .../recipes-protocols/net-snmp/net-snmp_5.7.3.bb   |   4 +-
 .../recipes-support/bridge-utils/bridge-utils.inc  |  28 ---
 ...ld-error-out-correctly-if-a-submake-fails.patch |  69 -------
 ...idge-fix-some-build-time-warnings-fcntl.h.patch |  64 ------
 ...idge-fix-some-build-time-warnings-errno.h.patch |  46 -----
 ...dd-missing-include-s-fix-build-against-mu.patch |  47 -----
 ...uild-don-t-ignore-CFLAGS-from-environment.patch |  29 +--
 ...ridge-Modifying-the-AR-to-cross-toolchain.patch |  51 +++++
 ...5-check-error-returns-from-write-to-sysfs.patch |  87 --------
 ...5-fix-error-message-for-incorrect-command.patch |  33 ---
 ...utils-1.5-fix-incorrect-command-in-manual.patch |  33 ---
 .../bridge-utils/bridge-utils/kernel-headers.patch |  29 ++-
 .../bridge-utils/bridge-utils_1.5.bb               |  16 --
 .../bridge-utils/bridge-utils_1.6.bb               |  35 ++++
 .../lksctp-tools/lksctp-tools_1.0.17.bb            |  16 +-
 .../stunnel/stunnel/fix-openssl-no-des.patch       |  54 +++++
 .../recipes-support/stunnel/stunnel_5.35.bb        |   4 +-
 29 files changed, 776 insertions(+), 466 deletions(-)
 create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils.inc
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb
 create mode 100644 meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch

-- 
2.7.4



^ permalink raw reply	[flat|nested] 16+ messages in thread

* [meta-networking][PATCH 1/6] ddclient: new package
  2017-10-30 18:11 [meta-networking][PATCH 0/6] meta-networking patchwork cleanup Joe MacDonald
@ 2017-10-30 18:11 ` Joe MacDonald
  2017-10-30 23:14   ` Khem Raj
  2017-10-30 18:11 ` [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist Joe MacDonald
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Joe MacDonald @ 2017-10-30 18:11 UTC (permalink / raw)
  To: openembedded-devel

From: "Kinsella, Ray" <ray.kinsella@intel.com>

Adding the package ddclient. DDClient updates Dynamic DNS servers with an IP address.
Recipe is based on the original OE recipe found here.

http://cgit.openembedded.org/openembedded/tree/recipes/ddclient/ddclient_3.6.3.bb

with modifications based on the recipe at:

https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb

DDClient version has been updated to 3.8.3.

Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
---
 .../recipes-daemons/ddclient/ddclient_3.8.3.bb     | 44 ++++++++++++++++++++++
 .../recipes-daemons/ddclient/files/ip-up           |  4 ++
 .../recipes-daemons/ddclient/files/persistent      |  1 +
 3 files changed, 49 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent

diff --git a/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb b/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
new file mode 100644
index 0000000..d83a4d4
--- /dev/null
+++ b/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
@@ -0,0 +1,44 @@
+SECTION = "net/misc"
+DESCRIPTION = "Ddclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Services"
+HOMEPAGE = "http://ddclient.sourceforge.net/"
+LICENSE = "GPLv2"
+
+SRC_URI = "\
+    ${SOURCEFORGE_MIRROR}/ddclient/ddclient-${PV}.tar.bz2 \
+    file://ip-up"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+RDEPENDS_${PN} = "\
+    perl-module-getopt-long \
+    perl-module-sys-hostname \
+    perl-module-io-socket \
+    perl-module-vars \
+    perl-module-overload \
+    perl-module-overloading \
+    perl-module-config \
+    perl-module-integer \
+    perl-module-exporter-heavy \
+    perl-module-symbol \
+    perl-module-selectsaver \
+    bash \
+    perl \
+    libio-socket-ssl-perl"
+
+do_install() {
+    install -d ${D}${sbindir} ${D}${sysconfdir}/ddclient ${D}${sysconfdir}/init.d
+    install -d ${D}${sysconfdir}/ppp/ip-up.d/ install -d ${D}${docdir}/ddclient
+    install -m 755 ${S}/ddclient ${D}${sbindir}
+    install ${S}/sample-etc_ddclient.conf ${D}${sysconfdir}/ddclient/ddclient.conf
+    install -m 755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/ip-up.d/ddclient
+    sed -e 's|/etc/ddclient.conf|/etc/ddclient/ddclient.conf|g' ${S}/sample-etc_rc.d_init.d_ddclient > ${S}/rc_init
+    install -m 755 ${S}/rc_init ${D}${sysconfdir}/init.d/ddclient
+    install ${S}/README* ${D}${docdir}/ddclient
+    install ${S}/COPY* ${D}${docdir}/ddclient
+    install ${S}/sample* ${D}${docdir}/ddclient
+}
+
+CONFFILES_${PN} = "${sysconfdir}/ddclient/ddclient.conf"
+
+SRC_URI[md5sum] = "3b426ae52d509e463b42eeb08fb89e0b"
+SRC_URI[sha256sum] = "d40e2f1fd3f4bff386d27bbdf4b8645199b1995d27605a886b8c71e44d819591"
diff --git a/meta-networking/recipes-daemons/ddclient/files/ip-up b/meta-networking/recipes-daemons/ddclient/files/ip-up
new file mode 100644
index 0000000..4411db9
--- /dev/null
+++ b/meta-networking/recipes-daemons/ddclient/files/ip-up
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+logger -t ddclient $PPP_IFACE $PPP_LOCAL
+ddclient -daemon=0 -syslog -use=if -if=$PPP_IFACE >/dev/null 2>&1
diff --git a/meta-networking/recipes-daemons/ddclient/files/persistent b/meta-networking/recipes-daemons/ddclient/files/persistent
new file mode 100644
index 0000000..b721272
--- /dev/null
+++ b/meta-networking/recipes-daemons/ddclient/files/persistent
@@ -0,0 +1 @@
+l root root 0644 /etc/ddclient.conf /var/persistent/etc/ddclient.conf
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist
  2017-10-30 18:11 [meta-networking][PATCH 0/6] meta-networking patchwork cleanup Joe MacDonald
  2017-10-30 18:11 ` [meta-networking][PATCH 1/6] ddclient: new package Joe MacDonald
@ 2017-10-30 18:11 ` Joe MacDonald
  2017-10-30 23:21   ` Khem Raj
  2017-10-30 18:11 ` [meta-networking][PATCH 3/6] freediameter: add new recipe Joe MacDonald
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Joe MacDonald @ 2017-10-30 18:11 UTC (permalink / raw)
  To: openembedded-devel

Switching lksctp-tools to build from the upstream git repository rather
than a source tarball.  At the same time we'll un-blacklist it since it
appears the gold-as-ld issue has been resolved underneath us, probably
related to a Debian bug of the same form that was also resolved with a
binutils update.

Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
---
 .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
index 11c43ff..9166aa5 100644
--- a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
+++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
@@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
     file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
 "
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
+SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
+
+SRC_URI = " \
+    git://github.com/sctp/lksctp-tools.git \
     file://run-ptest \
     file://v4test.sh \
     file://v6test.sh \
 "
 
-SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
-SRC_URI[sha256sum] = "1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"
-
-#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o    -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2 -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1 -o .libs/libsctp.so.1.0.16
-#| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version
-#| collect2: error: ld returned 1 exit status
-#| make[4]: *** [libsctp.la] Error 1
-PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"
-
-S = "${WORKDIR}/${BP}"
+S = "${WORKDIR}/git"
 
 BBCLASSEXTEND = "native"
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [meta-networking][PATCH 3/6] freediameter: add new recipe
  2017-10-30 18:11 [meta-networking][PATCH 0/6] meta-networking patchwork cleanup Joe MacDonald
  2017-10-30 18:11 ` [meta-networking][PATCH 1/6] ddclient: new package Joe MacDonald
  2017-10-30 18:11 ` [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist Joe MacDonald
@ 2017-10-30 18:11 ` Joe MacDonald
  2017-10-30 23:25   ` Khem Raj
  2017-10-31  0:47   ` akuster808
  2017-10-30 18:11 ` [meta-networking][PATCH 4/6] net-snmp: support openssl without 3des Joe MacDonald
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 16+ messages in thread
From: Joe MacDonald @ 2017-10-30 18:11 UTC (permalink / raw)
  To: openembedded-devel

From: Jackie Huang <jackie.huang@windriver.com>

freeDiameter is an open source Diameter protocol
implementation. It provides an extensible platform
for deploying a Diameter network for your Authentication,
Authorization and Accounting needs.

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
---
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 8 files changed, 516 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb

diff --git a/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
new file mode 100644
index 0000000..71a5a1a
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
@@ -0,0 +1,223 @@
+Replace murmurhash algorithm with Robert Jenkin's hash algorithm
+
+Upstream-Status: Pending
+
+From test result, murmurhash algorithm does not work in big endian
+processor, so replace it with Robert Jenkin's hash which has worked
+in linux kernel for many years and has more adaptability.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
+ 1 file changed, 74 insertions(+), 118 deletions(-)
+
+diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
+index 8f29b48..ce1f4dd 100644
+--- a/libfdproto/ostr.c
++++ b/libfdproto/ostr.c
+@@ -430,128 +430,84 @@ after_proto:
+ 
+ 
+ /********************************************************************************************************/
+-/* Hash function -- credits to Austin Appleby, thank you ^^ */
+-/* See http://murmurhash.googlepages.com for more information on this function */
+-
+-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
+-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+-uint32_t fd_os_hash ( uint8_t * string, size_t len )
++/*
++ * Robert Jenkin's hash function.
++ * http://burtleburtle.net/bob/hash/evahash.html
++ * This is in the public domain.
++ */
++#define mix(a, b, c)						\
++	do {							\
++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
++	} while (0)
++
++unsigned hash_rjenkins(const char *str, unsigned length)
+ {
+-	uint32_t hash = len;
+-	uint8_t * data = string;
+-	
+-	const unsigned int m = 0x5bd1e995;
+-	const int r = 24;
+-	int align = (long)string & 3;
+-	
+-	if (!align || (len < 4)) {
+-		/* In case data is aligned, MurmurHash2 function */
+-		while(len >= 4)
+-		{
+-			/* Mix 4 bytes at a time into the hash */
+-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle the last few bytes of the input */
+-		switch(len) {
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-	        		hash *= m;
+-		}
+-		
+-	} else {
+-		/* Unaligned data, use alignment-safe slower version */
+-		
+-		/* Pre-load the temp registers */
+-		uint32_t t = 0, d = 0;
+-		switch(align)
+-		{
+-			case 1: t |= data[2] << 16;
+-			case 2: t |= data[1] << 8;
+-			case 3: t |= data[0];
+-		}
+-		t <<= (8 * align);
+-
+-		data += 4-align;
+-		len -= 4-align;
+-		
+-		/* From this point, "data" can be read by chunks of 4 bytes */
+-		
+-		int sl = 8 * (4-align);
+-		int sr = 8 * align;
+-
+-		/* Mix */
+-		while(len >= 4)
+-		{
+-			uint32_t k;
+-			
+-			d = *(unsigned int *)data;
+-			k = (t >> sr) | (d << sl);
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			t = d;
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle leftover data in temp registers */
+-		d = 0;
+-		if(len >= align)
+-		{
+-			uint32_t k;
+-			
+-			switch(align)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			}
+-
+-			k = (t >> sr) | (d << sl);
+-			_HASH_MIX(hash, k, m);
+-
+-			data += align;
+-			len -= align;
+-
+-			/* Handle tail bytes */
+-
+-			switch(len)
+-			{
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-					hash *= m;
+-			};
+-		}
+-		else
+-		{
+-			switch(len)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			case 0: hash ^= (t >> sr) | (d << sl);
+-					hash *= m;
+-			}
+-		}
+-
++	const unsigned char *k = (const unsigned char *)str;
++	uint32_t a, b, c;  /* the internal state */
++	uint32_t len;      /* how many key bytes still need mixing */
++
++	/* Set up the internal state */
++	len = length;
++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
++	b = a;
++	c = 0;               /* variable initialization of internal state */
++
++	/* handle most of the key */
++	while (len >= 12) {
++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
++			 ((uint32_t)k[3] << 24));
++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
++			 ((uint32_t)k[7] << 24));
++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
++			 ((uint32_t)k[11] << 24));
++		mix(a, b, c);
++		k = k + 12;
++		len = len - 12;
++	}
+ 
++	/* handle the last 11 bytes */
++	c = c + length;
++	switch (len) {            /* all the case statements fall through */
++	case 11:
++		c = c + ((uint32_t)k[10] << 24);
++	case 10:
++		c = c + ((uint32_t)k[9] << 16);
++	case 9:
++		c = c + ((uint32_t)k[8] << 8);
++		/* the first byte of c is reserved for the length */
++	case 8:
++		b = b + ((uint32_t)k[7] << 24);
++	case 7:
++		b = b + ((uint32_t)k[6] << 16);
++	case 6:
++		b = b + ((uint32_t)k[5] << 8);
++	case 5:
++		b = b + k[4];
++	case 4:
++		a = a + ((uint32_t)k[3] << 24);
++	case 3:
++		a = a + ((uint32_t)k[2] << 16);
++	case 2:
++		a = a + ((uint32_t)k[1] << 8);
++	case 1:
++		a = a + k[0];
++		/* case 0: nothing left to add */
+ 	}
++	mix(a, b, c);
+ 
+-	/* Do a few final mixes of the hash to ensure the last few
+-	   bytes are well-incorporated. */
+-	hash ^= hash >> 13;
+-	hash *= m;
+-	hash ^= hash >> 15;
++	return c;
++}
+ 
+-	return hash;
++uint32_t fd_os_hash ( uint8_t * string, size_t len )
++{
++	return hash_rjenkins(string, len); 
+ } 
+ 
+-- 
+1.7.10.4
+
diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.init b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
new file mode 100755
index 0000000..e63a42a
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          freediameter
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Short-Description: Start freeDiameter daemon at boot time
+# Description:       Start the freeDiameter daemon at boot time.
+#       freeDiameter is an extensible implementation of the Diameter protocol,
+#       designed for Authentication, Authorization and Accounting. Diameter is
+#       an evolution of the RADIUS protocol.
+### END INIT INFO#
+DAEMON=/usr/bin/freeDiameterd
+CONF=/etc/freeDiameter/freeDiameter.conf
+NAME=freediameter
+DESC="freeDiameter daemon"
+
+. /etc/init.d/functions
+start() {
+	[ -x $DAEMON ] || exit 5
+	echo -n $"Starting $DAEMON: "
+	start-stop-daemon -S -b -x ${DAEMON} && success || failure
+	retval=$?
+	echo ""
+	return $retval
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	start-stop-daemon -K -x $DAEMON
+	retval=$?
+	echo ""
+	return $retval
+}
+
+restart() {
+	stop
+	sleep 3
+	start
+}
+
+rh_status() {
+	status $DAEMON
+}
+
+rh_status_q() {
+	rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+  start)
+	rh_status_q && exit 0
+	start
+	;;
+  stop)
+	rh_status_q || exit 0
+	stop
+	;;
+  restart)
+	restart
+	;;
+  status)
+	rh_status
+	;;
+  *)
+	echo $"Usage: $prog {start|stop|status|restart}"
+	exit 2
+esac
+
+exit $?
diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
new file mode 100644
index 0000000..514481b
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=freediameter daemon
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/freediameter.pid
+ExecStart=@BINDIR@/freeDiameterd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/freediameter/files/install_test.patch b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
new file mode 100644
index 0000000..151037d
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
@@ -0,0 +1,22 @@
+CMakeLists: add an option to install tests
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Original author: Yao Zhao <yao.zhao@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index da8da1b..de04059 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
+ ####
+ ## INSTALL section ##
+ 
+-# we do not install the tests
++# install the tests
++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
++
++INSTALL(TARGETS ${TEST_LIST}
++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
++        COMPONENT freeDiameter-common)
diff --git a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
new file mode 100644
index 0000000..ea857af
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
@@ -0,0 +1,72 @@
+freediameter ptest cases testmesg_stress.c and testloadext.c need load
+extensions both build time and runtime. Then they search extensions with
+build directory that causes runtime failures.
+
+Pass an environment variable to define runtime extension path.
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
+--- freeDiameter-1.2.0.orig/tests/testloadext.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testloadext.c	2014-02-19 20:08:03.871403924 +0800
+@@ -49,7 +49,7 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 
+ 	/* First, initialize the daemon modules */
+@@ -57,11 +57,16 @@
+ 	CHECK( 0, fd_queues_init()  );
+ 	CHECK( 0, fd_msg_init()  );
+ 	CHECK( 0, fd_rtdisp_init()  );
+-	
++
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
+diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
+--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testmesg_stress.c	2014-02-19 20:08:03.928403924 +0800
+@@ -67,15 +67,20 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 	struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
+ 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
+ 
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest
new file mode 100644
index 0000000..d0ca8d9
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
+        echo "Couldn't load kernel module sctp."
+        echo "Test cases testsctp and testcnx will fail."
+        echo
+fi
+
+export EXTENSIONS_DIR=$EXTENSIONS_DIR
+cmake  -E cmake_echo_color --cyan "Running tests..."
+ctest --force-new-ctest-process
diff --git a/meta-networking/recipes-protocols/freediameter/freediameter.inc b/meta-networking/recipes-protocols/freediameter/freediameter.inc
new file mode 100644
index 0000000..6880d26
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/freediameter.inc
@@ -0,0 +1,98 @@
+SUMMARY = "An open source implementation of the diameter protocol"
+DESCRIPTION = "\
+freeDiameter is an open source Diameter protocol implementation. It \
+provides an extensible platform for deploying a Diameter network for \
+your Authentication, Authorization and Accounting needs."
+
+HOMEPAGE = "http://www.freediameter.net"
+
+DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
+
+pkgname = "freeDiameter"
+
+SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
+           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
+           file://freediameter.service \
+           file://freediameter.init \
+           \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
+           'file://install_test.patch \
+            file://run-ptest \
+            file://pass-ptest-env.patch', '', d)} \
+           "
+
+S = "${WORKDIR}/${pkgname}-${PV}"
+
+PTEST_PATH = "${libdir}/${pkgname}/ptest"
+
+inherit cmake update-rc.d ptest systemd
+
+EXTRA_OECMAKE = " \
+    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
+    -DBUILD_DBG_MONITOR:BOOL=ON  \
+    -DBUILD_TEST_APP:BOOL=ON \
+    -DBUILD_TESTING:BOOL=ON \
+    -DBUILD_APP_RADGW:BOOL=ON \
+    -DBUILD_APP_REDIRECT:BOOL=ON \
+    -DBUILD_TEST_ACCT:BOOL=ON \
+    -DBUILD_TEST_NETEMUL:BOOL=ON \
+    -DBUILD_TEST_RT_ANY:BOOL=ON \
+    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
+    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
+    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
+    -DCMAKE_SKIP_RPATH:BOOL=ON \
+"
+# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
+# specify it on cmd line will fix the SET bug in CMakeList.txt
+
+# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
+
+# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
+# These need MySQL support
+
+# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
+
+# -DALL_EXTENSIONS=ON will enable all
+
+do_install_append() {
+    # install the sample configuration file
+    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
+    for i in ${S}/doc/*.conf.sample; do
+        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
+    done
+    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
+      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
+
+    # install daemon init related files
+    install -d -m 0755 ${D}${sysconfdir}/default
+    install -d -m 0755 ${D}${sysconfdir}/init.d
+    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
+      ${D}${sysconfdir}/default/${BPN}
+    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
+
+    # install for systemd
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
+}
+
+do_install_ptest() {
+    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
+    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
+    rmdir ${D}${PTEST_PATH}-tests
+    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
+}
+
+FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
+
+# include the extensions in main package
+FILES_${PN} += "${libdir}/${pkgname}/*"
+
+RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
+RDEPENDS_${PN}-ptest = "cmake"
+
+INITSCRIPT_NAME = "${BPN}"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "freediameter.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
new file mode 100644
index 0000000..3fb929a
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
@@ -0,0 +1,7 @@
+include freediameter.inc
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
+
+SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
+SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [meta-networking][PATCH 4/6] net-snmp: support openssl without 3des
  2017-10-30 18:11 [meta-networking][PATCH 0/6] meta-networking patchwork cleanup Joe MacDonald
                   ` (2 preceding siblings ...)
  2017-10-30 18:11 ` [meta-networking][PATCH 3/6] freediameter: add new recipe Joe MacDonald
@ 2017-10-30 18:11 ` Joe MacDonald
  2017-10-30 18:11 ` [meta-networking][PATCH 5/6] stunnel: fix compile error when openssl disable des support Joe MacDonald
  2017-10-30 18:11 ` [meta-networking][PATCH 6/6] bridge-utils: update to v1.6 Joe MacDonald
  5 siblings, 0 replies; 16+ messages in thread
From: Joe MacDonald @ 2017-10-30 18:11 UTC (permalink / raw)
  To: openembedded-devel

From: Jackie Huang <jackie.huang@windriver.com>

net-snmp enables 3des support by default and fails to build with distro
feature openssl-no-weak-ciphers:

| ../../net-snmp-5.7.3/snmplib/scapi.c:82:25: fatal error: openssl/des.h: No such file or directory
|  #include <openssl/des.h>

To fix the issue:
* add a patch to include des.h only if it's found in openssl
* disable des when openssl-no-weak-ciphers is enabled

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
---
 .../net-snmp/net-snmp-fix-for-disable-des.patch    | 32 ++++++++++++++++++++++
 .../recipes-protocols/net-snmp/net-snmp_5.7.3.bb   |  4 ++-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch
new file mode 100644
index 0000000..25eb9c9
--- /dev/null
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch
@@ -0,0 +1,32 @@
+From 270e952f58a7e5ddeabe5a15e3ddaaadf40017d0 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 22 Jun 2017 10:25:08 +0800
+Subject: [PATCH] net-snmp: fix for --disable-des
+
+Include des.h only if it's found in openssl so that
+the --disable-des works correctly.
+
+Upstream-Status: Submitted [net-snmp-coders@lists.sourceforge.net]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ snmplib/scapi.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/snmplib/scapi.c b/snmplib/scapi.c
+index 16ac829..271684b 100644
+--- a/snmplib/scapi.c
++++ b/snmplib/scapi.c
+@@ -79,7 +79,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support)
+ #include <openssl/hmac.h>
+ #include <openssl/evp.h>
+ #include <openssl/rand.h>
++#ifdef HAVE_OPENSSL_DES_H
+ #include <openssl/des.h>
++#endif
+ #ifdef HAVE_AES
+ #include <openssl/aes.h>
+ #endif
+-- 
+2.11.0
+
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
index af6fd1b..849ae07 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
@@ -31,6 +31,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
            file://0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch \
            file://0004-configure-fix-incorrect-variable.patch \
            file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
+           file://net-snmp-fix-for-disable-des.patch \
            "
 SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee"
 SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e"
@@ -59,7 +60,8 @@ EXTRA_OECONF = "--enable-shared \
                 --with-defaults \
                 --with-install-prefix=${D} \
                 --with-persistent-directory=${localstatedir}/lib/net-snmp \
-                ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)}"
+                ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
+"
 
 # net-snmp needs to have mib-modules=smux enabled to enable quagga to support snmp
 EXTRA_OECONF += "--with-mib-modules=smux"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [meta-networking][PATCH 5/6] stunnel: fix compile error when openssl disable des support
  2017-10-30 18:11 [meta-networking][PATCH 0/6] meta-networking patchwork cleanup Joe MacDonald
                   ` (3 preceding siblings ...)
  2017-10-30 18:11 ` [meta-networking][PATCH 4/6] net-snmp: support openssl without 3des Joe MacDonald
@ 2017-10-30 18:11 ` Joe MacDonald
  2017-10-30 18:11 ` [meta-networking][PATCH 6/6] bridge-utils: update to v1.6 Joe MacDonald
  5 siblings, 0 replies; 16+ messages in thread
From: Joe MacDonald @ 2017-10-30 18:11 UTC (permalink / raw)
  To: openembedded-devel

From: Kai Kang <kai.kang@windriver.com>

When openssl disable des support with configure option 'no-des', it
doesn't provide des related header file and functions. That causes
stunnel compile failed. Fix it by checking macro OPENSSL_NO_DES to use
openssl des related library conditionaly.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
---
 .../stunnel/stunnel/fix-openssl-no-des.patch       | 54 ++++++++++++++++++++++
 .../recipes-support/stunnel/stunnel_5.35.bb        |  4 +-
 2 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch

diff --git a/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch b/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
new file mode 100644
index 0000000..209b0dd
--- /dev/null
+++ b/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Pending
+
+When openssl disable des support with configure option 'no-des', it doesn't
+provide des related header file and functions. That causes stunnel compile
+failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related
+library conditionaly.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/src/common.h b/src/common.h
+index f7d38b0..bf485af 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -471,7 +471,9 @@ extern char *sys_errlist[];
+ #ifndef OPENSSL_NO_MD4
+ #include <openssl/md4.h>
+ #endif /* !defined(OPENSSL_NO_MD4) */
++#ifndef OPENSSL_NO_DES
+ #include <openssl/des.h>
++#endif
+ #ifndef OPENSSL_NO_DH
+ #include <openssl/dh.h>
+ #if OPENSSL_VERSION_NUMBER<0x10100000L
+diff --git a/src/protocol.c b/src/protocol.c
+index 587df09..8198eb6 100644
+--- a/src/protocol.c
++++ b/src/protocol.c
+@@ -66,7 +66,7 @@ NOEXPORT char *imap_server(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *nntp_client(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *connect_server(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *connect_client(CLI *, SERVICE_OPTIONS *, const PHASE);
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+ NOEXPORT void ntlm(CLI *, SERVICE_OPTIONS *);
+ NOEXPORT char *ntlm1();
+ NOEXPORT char *ntlm3(char *, char *, char *, char *);
+@@ -1175,7 +1175,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
+     fd_printf(c, c->remote_fd.fd, "Host: %s", opt->protocol_host);
+     if(opt->protocol_username && opt->protocol_password) {
+         if(!strcasecmp(opt->protocol_authentication, "ntlm")) {
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+             ntlm(c, opt);
+ #else
+             s_log(LOG_ERR, "NTLM authentication is not available");
+@@ -1216,7 +1216,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
+     return NULL;
+ }
+ 
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+ 
+ /*
+  * NTLM code is based on the following documentation:
diff --git a/meta-networking/recipes-support/stunnel/stunnel_5.35.bb b/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
index efe9d9e..ec8478d 100644
--- a/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
+++ b/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
@@ -8,7 +8,9 @@ DEPENDS = "openssl zlib tcp-wrappers"
 
 RDEPENDS_${PN} += "perl"
 
-SRC_URI = "ftp://ftp.stunnel.org/stunnel/archive/5.x/${BP}.tar.gz"
+SRC_URI = "ftp://ftp.stunnel.org/stunnel/archive/5.x/${BP}.tar.gz \
+           file://fix-openssl-no-des.patch \
+"
 
 SRC_URI[md5sum] = "9079f5fafbccaf88b7d92b227d78249a"
 SRC_URI[sha256sum] = "ffa386ae4c825f35f35157c285e7402a6d58779ad8c3822f74a9d355b54aba1d"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [meta-networking][PATCH 6/6] bridge-utils: update to v1.6
  2017-10-30 18:11 [meta-networking][PATCH 0/6] meta-networking patchwork cleanup Joe MacDonald
                   ` (4 preceding siblings ...)
  2017-10-30 18:11 ` [meta-networking][PATCH 5/6] stunnel: fix compile error when openssl disable des support Joe MacDonald
@ 2017-10-30 18:11 ` Joe MacDonald
  5 siblings, 0 replies; 16+ messages in thread
From: Joe MacDonald @ 2017-10-30 18:11 UTC (permalink / raw)
  To: openembedded-devel

Updating to the latest version (1.6) and taking the opportunity to clean
up the old patches, switch to the upstream git repo for SRC_URI and make
the requested change to the older AR patch from a while back.

Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
---
 .../recipes-support/bridge-utils/bridge-utils.inc  | 28 -------
 ...ld-error-out-correctly-if-a-submake-fails.patch | 69 -----------------
 ...idge-fix-some-build-time-warnings-fcntl.h.patch | 64 ----------------
 ...idge-fix-some-build-time-warnings-errno.h.patch | 46 ------------
 ...dd-missing-include-s-fix-build-against-mu.patch | 47 ------------
 ...uild-don-t-ignore-CFLAGS-from-environment.patch | 29 ++------
 ...ridge-Modifying-the-AR-to-cross-toolchain.patch | 51 +++++++++++++
 ...5-check-error-returns-from-write-to-sysfs.patch | 87 ----------------------
 ...5-fix-error-message-for-incorrect-command.patch | 33 --------
 ...utils-1.5-fix-incorrect-command-in-manual.patch | 33 --------
 .../bridge-utils/bridge-utils/kernel-headers.patch | 29 +++++---
 .../bridge-utils/bridge-utils_1.5.bb               | 16 ----
 .../bridge-utils/bridge-utils_1.6.bb               | 35 +++++++++
 13 files changed, 114 insertions(+), 453 deletions(-)
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils.inc
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb

diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils.inc b/meta-networking/recipes-support/bridge-utils/bridge-utils.inc
deleted file mode 100644
index 0fb18d5..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils.inc
+++ /dev/null
@@ -1,28 +0,0 @@
-SUMMARY = "Tools for ethernet bridging"
-HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge"
-SECTION = "net"
-LICENSE = "GPLv2"
-
-DEPENDS = "sysfsutils"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/bridge/bridge-utils-${PV}.tar.gz \
-          file://bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch \
-          file://bridge-utils-1.5-fix-error-message-for-incorrect-command.patch \
-          file://bridge-utils-1.5-fix-incorrect-command-in-manual.patch \
-"
-
-inherit autotools-brokensep update-alternatives
-
-ALTERNATIVE_${PN} = "brctl"
-ALTERNATIVE_PRIORITY[brctl] = "100"
-ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl"
-
-EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}"
-
-do_install_append () {
-    install -d ${D}/${datadir}/bridge-utils
-    install -d ${D}/${sysconfdir}/network/if-pre-up.d
-    install -d ${D}/${sysconfdir}/network/if-post-down.d
-}
-
-RRECOMMENDS_${PN} = "kernel-module-bridge"
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch
deleted file mode 100644
index c6897b4..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 5e102b453e254d16af1f95053134f58348e0f83a Mon Sep 17 00:00:00 2001
-From: root <git@andred.net>
-Date: Wed, 20 Jul 2016 23:40:30 +0100
-Subject: [PATCH 1/5] build: error out correctly if a submake fails
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Due to use of a for loop, return status from submake was always
-ignored.
-
-In the context of build-systems like OE this causes them to not
-detect any errors and continue happily, resulting in a successful,
-but incomplete, build.
-
-Fix by having a nicer Makefile.in which now has rules for the
-individual targets (directories) so that make itself can
-figure out all the dependencies and build those targets as
-needed rather than using a for loop to iterate over the
-directories in a shell and thus loosing the return status of
-the command inside the loop.
-
-This has the added advantage that parallel builds work now.
-
-Upstream-Status: Pending
-
-Signed-off-by: André Draszik <git@andred.net>
----
- Makefile.in | 18 ++++++++++++------
- 1 file changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 6028513..dab88bb 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -13,11 +13,11 @@ distdir = $(PACKAGE)-$(VERSION)
- 
- SUBDIRS=libbridge brctl doc
- 
--all:
--	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x ; done
-+all: override ACTION=
-+all: $(SUBDIRS)
- 
--clean:
--	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x clean ; done
-+clean: override ACTION=clean
-+clean: $(SUBDIRS)
- 
- distclean:	clean
- 	rm -f config.log
-@@ -30,6 +30,12 @@ maintainer-clean: distclean
- 	rm -f libbridge/Makefile
- 	rm -f doc/Makefile
- 
--install:
--	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x install; done
-+install: override ACTION=install
-+install: $(SUBDIRS)
- 
-+
-+brctl: libbridge
-+$(SUBDIRS):
-+	$(MAKE) $(MFLAGS) -C $@ $(ACTION)
-+
-+.PHONY: $(SUBDIRS)
--- 
-2.8.1
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch
deleted file mode 100644
index 25d08ab..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 68fafc4ea10365ac2e74ab7c660d097696857677 Mon Sep 17 00:00:00 2001
-From: root <git@andred.net>
-Date: Wed, 20 Jul 2016 23:40:32 +0100
-Subject: [PATCH 2/5] libbridge: fix some build-time warnings (fcntl.h)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There are build-time warnings at the moment when building
-against musl, as the code here #include's the wrong file,
-sys/fcntl.h instead of fcntl.h
-
-In file included from libbridge_devif.c:26:0:
-<sysroot>/usr/include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Wcpp]
- #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
-  ^~~~~~~
-In file included from libbridge_if.c:23:0:
-<sysroot>/usr/include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Wcpp]
- #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
-  ^~~~~~~
-
-glibc headers silently redirect sys/fcntl.h to fcntl.h so the
-issue is not seen there.
-
-Let's fix the #include's to so as to use the correct ones
-and silence the compiler.
-
-Upstream-Status: Pending
-
-Signed-off-by: André Draszik <git@andred.net>
----
- libbridge/libbridge_devif.c | 2 +-
- libbridge/libbridge_if.c    | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c
-index 1e83925..2cf78f6 100644
---- a/libbridge/libbridge_devif.c
-+++ b/libbridge/libbridge_devif.c
-@@ -23,7 +23,7 @@
- #include <errno.h>
- #include <string.h>
- #include <dirent.h>
--#include <sys/fcntl.h>
-+#include <fcntl.h>
- 
- #include "libbridge.h"
- #include "libbridge_private.h"
-diff --git a/libbridge/libbridge_if.c b/libbridge/libbridge_if.c
-index 77d3f8a..9cf4bac 100644
---- a/libbridge/libbridge_if.c
-+++ b/libbridge/libbridge_if.c
-@@ -20,7 +20,7 @@
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
--#include <sys/fcntl.h>
-+#include <fcntl.h>
- #include <sys/ioctl.h>
- 
- #include "libbridge.h"
--- 
-2.8.1
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch
deleted file mode 100644
index 72f2a62..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 2b9dc245f93ab27d7da42a16ddbb9212888006e4 Mon Sep 17 00:00:00 2001
-From: root <git@andred.net>
-Date: Wed, 20 Jul 2016 23:40:33 +0100
-Subject: [PATCH 3/5] bridge: fix some build-time warnings (errno.h)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There is a build-time warning at the moment when building
-against musl, as the code here #include's the wrong file,
-sys/errno.h instead of errno.h
-
-In file included from brctl.c:22:0:
-<sysroot>/usr/include/sys/errno.h:1:2: warning: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Wcpp]
- #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
-  ^~~~~~~
-
-glibc headers silently redirect sys/errno.h to errno.h so the
-issue is not seen there.
-
-Let's fix the #include's to so as to use the correct ones
-and silence the compiler.
-
-Upstream-Status: Pending
-
-Signed-off-by: André Draszik <git@andred.net>
----
- brctl/brctl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/brctl/brctl.c b/brctl/brctl.c
-index 46ca352..8855234 100644
---- a/brctl/brctl.c
-+++ b/brctl/brctl.c
-@@ -19,7 +19,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <sys/errno.h>
-+#include <errno.h>
- #include <getopt.h>
- 
- #include "libbridge.h"
--- 
-2.8.1
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch
deleted file mode 100644
index 565186e..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From c45b73829a8b8c7924df528baa7e16498f917288 Mon Sep 17 00:00:00 2001
-From: root <git@andred.net>
-Date: Wed, 20 Jul 2016 23:40:33 +0100
-Subject: [PATCH 4/5] libbridge: add missing #include's (fix build against
- musl)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fixes error like:
-
-In file included from libbridge_devif.c:28:0:
-libbridge.h:45:17: error: field 'max_age' has incomplete type
-  struct timeval max_age;
-                 ^~~~~~~
-In file included from libbridge_devif.c:28:0:
-libbridge.h:51:2: error: unknown type name 'u_int16_t'
-  u_int16_t root_port;
-  ^~~~~~~~~
-
-These types are not standard C but rather Posix,
-for struct timeval see:
-http://pubs.opengroup.org/onlinepubs/7908799/xsh/systime.h.html
-
-Upstream-Status: Pending
-
-Signed-off-by: André Draszik <git@andred.net>
----
- libbridge/libbridge.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/libbridge/libbridge.h b/libbridge/libbridge.h
-index 53ec869..b0727c1 100644
---- a/libbridge/libbridge.h
-+++ b/libbridge/libbridge.h
-@@ -20,6 +20,8 @@
- #define _LIBBRIDGE_H
- 
- #include <sys/socket.h>
-+#include <sys/time.h>
-+#include <sys/types.h>
- #include <linux/in6.h>
- #include <linux/if.h>
- #include <linux/if_bridge.h>
--- 
-2.8.1
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch
index 9f2155e..0a72c6b 100644
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch
@@ -1,7 +1,7 @@
-From 7bc1932cabfafca8c68e18bd43e3d203c70d2dd8 Mon Sep 17 00:00:00 2001
-From: root <git@andred.net>
-Date: Wed, 20 Jul 2016 23:40:33 +0100
-Subject: [PATCH 5/5] build: don't ignore CFLAGS from environment
+From 9d63838d12c772dfe33371e2bb8b8191625539f2 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Mon, 30 Oct 2017 13:37:48 -0400
+Subject: [PATCH] build: don't ignore CFLAGS from environment
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
@@ -17,10 +17,10 @@ used during compilation must also always be used during linking!
 Upstream-Status: Pending
 
 Signed-off-by: André Draszik <git@andred.net>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
 ---
- brctl/Makefile.in     | 2 +-
- libbridge/Makefile.in | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ brctl/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/brctl/Makefile.in b/brctl/Makefile.in
 index e1956d6..eff260c 100644
@@ -35,19 +35,6 @@ index e1956d6..eff260c 100644
  
  %.o: %.c brctl.h
  	$(CC) $(CFLAGS) $(INCLUDE) -c $< 
-diff --git a/libbridge/Makefile.in b/libbridge/Makefile.in
-index 20512c4..4e1cddc 100644
---- a/libbridge/Makefile.in
-+++ b/libbridge/Makefile.in
-@@ -5,7 +5,7 @@ AR=ar
- RANLIB=@RANLIB@
- 
- CC=@CC@
--CFLAGS = -Wall -g $(KERNEL_HEADERS)
-+CFLAGS = -Wall -g $(KERNEL_HEADERS) @CFLAGS@
- 
- prefix=@prefix@
- exec_prefix=@exec_prefix@
 -- 
-2.8.1
+2.7.4
 
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
new file mode 100644
index 0000000..3f65761
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
@@ -0,0 +1,51 @@
+From c924f66743c054d7ebafef90ca1bbebc96732357 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Mon, 30 Oct 2017 13:48:33 -0400
+Subject: [PATCH] libbridge: Modifying the AR to cross toolchain
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Makefile uses the host “ar” tool when it should be using the ar from
+the target toolchain.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ configure.ac          | 1 +
+ libbridge/Makefile.in | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8b2e2ea..8426b7c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -12,6 +12,10 @@ dnl Checks for programs.
+ AC_PROG_CC
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
++AN_MAKEVAR([AR], [AC_PROG_AR])
++AN_PROGRAM([ar], [AC_PROG_AR])
++AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
++AC_PROG_AR
+ 
+ dnl Checks for header files.
+ AC_HEADER_STDC
+diff --git a/libbridge/Makefile.in b/libbridge/Makefile.in
+index 7932bfe..bd55e9b 100644
+--- a/libbridge/Makefile.in
++++ b/libbridge/Makefile.in
+@@ -1,7 +1,7 @@
+ 
+ KERNEL_HEADERS=-I@KERNEL_HEADERS@
+ 
+-AR=ar
++AR=@AR@
+ RANLIB=@RANLIB@
+ 
+ CC=@CC@
+-- 
+2.7.4
+
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
deleted file mode 100644
index d00af9c..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
-
-From bb9970a9df95837e39d680021b1f73d231e85406 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <shemminger@vyatta.com>
-Date: Tue, 3 May 2011 09:52:43 -0700
-Subject: [PATCH 3/3] Check error returns from write to sysfs
-
-Add helper function to check write to sysfs files.
-
-Signed-off-by: Petr Sabata <contyk@redhat.com>
----
- libbridge/libbridge_devif.c |   37 +++++++++++++++++++++++--------------
- 1 files changed, 23 insertions(+), 14 deletions(-)
-
-diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c
-index aa8bc36..1e83925 100644
---- a/libbridge/libbridge_devif.c
-+++ b/libbridge/libbridge_devif.c
-@@ -280,25 +280,38 @@ fallback:
- 	return old_get_port_info(brname, port, info);
- }
- 
-+static int set_sysfs(const char *path, unsigned long value)
-+{
-+	int fd, ret = 0, cc;
-+	char buf[32];
-+
-+	fd = open(path, O_WRONLY);
-+	if (fd < 0)
-+		return -1;
-+
-+	cc = snprintf(buf, sizeof(buf), "%lu\n", value);
-+	if (write(fd, buf, cc) < 0)
-+		ret = -1;
-+	close(fd);
-+
-+	return ret;
-+}
-+
- 
- static int br_set(const char *bridge, const char *name,
- 		  unsigned long value, unsigned long oldcode)
- {
- 	int ret;
- 	char path[SYSFS_PATH_MAX];
--	FILE *f;
- 
--	snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name);
-+	snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge/%s",
-+		 bridge, name);
- 
--	f = fopen(path, "w");
--	if (f) {
--		ret = fprintf(f, "%ld\n", value);
--		fclose(f);
--	} else {
-+	if ((ret = set_sysfs(path, value)) < 0) {
- 		/* fallback to old ioctl */
- 		struct ifreq ifr;
- 		unsigned long args[4] = { oldcode, value, 0, 0 };
--		
-+
- 		strncpy(ifr.ifr_name, bridge, IFNAMSIZ);
- 		ifr.ifr_data = (char *) &args;
- 		ret = ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr);
-@@ -348,14 +361,10 @@ static int port_set(const char *bridge, const char *ifname,
- {
- 	int ret;
- 	char path[SYSFS_PATH_MAX];
--	FILE *f;
- 
- 	snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/brport/%s", ifname, name);
--	f = fopen(path, "w");
--	if (f) {
--		ret = fprintf(f, "%ld\n", value);
--		fclose(f);
--	} else {
-+
-+	if ((ret = set_sysfs(path, value)) < 0) {
- 		int index = get_portno(bridge, ifname);
- 
- 		if (index < 0)
--- 
-1.7.5.2
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
deleted file mode 100644
index 2d0494e..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
-
-From c7ed0996ef58b497d3d30be802ab5ae6c37099b5 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <shemminger@vyatta.com>
-Date: Tue, 3 May 2011 09:49:57 -0700
-Subject: [PATCH 2/3] Fix error message for incorrect command
-
-Debian bug 406907
-Error message was refering to incorrect command argument.
-
-Signed-off-by: Petr Sabata <contyk@redhat.com>
----
- brctl/brctl.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/brctl/brctl.c b/brctl/brctl.c
-index 454b8dd..46ca352 100644
---- a/brctl/brctl.c
-+++ b/brctl/brctl.c
-@@ -69,7 +69,7 @@ int main(int argc, char *const* argv)
- 	argc -= optind;
- 	argv += optind;
- 	if ((cmd = command_lookup(*argv)) == NULL) {
--		fprintf(stderr, "never heard of command [%s]\n", argv[1]);
-+		fprintf(stderr, "never heard of command [%s]\n", *argv);
- 		goto help;
- 	}
- 	
--- 
-1.7.5.2
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
deleted file mode 100644
index 6f6d6d4..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-incorrect-command-in-manual.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
-
-From 8ef7b77562b636efcbd8b759eb324d6c069200f2 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <shemminger@vyatta.com>
-Date: Tue, 3 May 2011 09:48:40 -0700
-Subject: [PATCH 1/3] Fix incorrect command in manual
-
-Command is "setageing" not "setageingtime"; fix man page.
-Debian bug report.
-
-Signed-off-by: Petr Sabata <contyk@redhat.com>
----
- doc/brctl.8 |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/doc/brctl.8 b/doc/brctl.8
-index d904047..771f323 100644
---- a/doc/brctl.8
-+++ b/doc/brctl.8
-@@ -89,7 +89,7 @@ data. Machines can move to other ports, network cards can be replaced
- .B brctl showmacs <brname>
- shows a list of learned MAC addresses for this bridge.
- 
--.B brctl setageingtime <brname> <time>
-+.B brctl setageing <brname> <time>
- sets the ethernet (MAC) address ageing time, in seconds. After <time>
- seconds of not having seen a frame coming from a certain address, the
- bridge will time out (delete) that address from the Forwarding
--- 
-1.7.5.2
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch
index de36f05..8a23a30 100644
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch
@@ -1,22 +1,33 @@
-include missing kernel header
+From 824f838cc9c7b8a44174358446993d61be7bbb3f Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Mon, 30 Oct 2017 13:18:20 -0400
+Subject: [PATCH] include missing kernel header
 
 Fixes errors like
 
 | /b/kraj/jlinux-next/poky/build/tmp-eglibc/sysroots/re-64b/usr/include/linux/if_bridge.h:172:20: error: field 'ip6' has incomplete type
 | In file included from ../libbridge/libbridge.h:24:0,
 
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
 Upstream-Status: Pending
 
-Index: bridge-utils-1.5/libbridge/libbridge.h
-===================================================================
---- bridge-utils-1.5.orig/libbridge/libbridge.h	2011-03-28 17:52:54.000000000 -0700
-+++ bridge-utils-1.5/libbridge/libbridge.h	2013-03-04 21:16:25.781188309 -0800
-@@ -20,6 +20,7 @@
- #define _LIBBRIDGE_H
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ libbridge/libbridge.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libbridge/libbridge.h b/libbridge/libbridge.h
+index c038b92..fd09306 100644
+--- a/libbridge/libbridge.h
++++ b/libbridge/libbridge.h
+@@ -24,6 +24,7 @@
+ #include <sys/time.h>
+ #include <netinet/in.h>
  
- #include <sys/socket.h>
 +#include <linux/in6.h>
  #include <linux/if.h>
  #include <linux/if_bridge.h>
  
+-- 
+2.7.4
+
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
deleted file mode 100644
index 6032ab0..0000000
--- a/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-require bridge-utils.inc
-
-SRC_URI += "\
-    file://kernel-headers.patch \
-    file://0001-build-error-out-correctly-if-a-submake-fails.patch \
-    file://0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch \
-    file://0003-bridge-fix-some-build-time-warnings-errno.h.patch \
-    file://0004-libbridge-add-missing-include-s-fix-build-against-mu.patch \
-    file://0005-build-don-t-ignore-CFLAGS-from-environment.patch \
-"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37"
-
-SRC_URI[md5sum] = "ec7b381160b340648dede58c31bb2238"
-SRC_URI[sha256sum] = "42f9e5fb8f6c52e63a98a43b81bd281c227c529f194913e1c51ec48a393b6688"
-
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb
new file mode 100644
index 0000000..1c87c48
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Tools for ethernet bridging"
+HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge"
+SECTION = "net"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37"
+
+SRCREV = "42c1aefc303fdf891fbb099ea51f00dca83ab606"
+
+SRC_URI = "\
+    git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/bridge-utils.git \
+    file://kernel-headers.patch \
+    file://0005-build-don-t-ignore-CFLAGS-from-environment.patch \
+    file://0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch \
+"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "sysfsutils"
+
+inherit autotools-brokensep update-alternatives
+
+ALTERNATIVE_${PN} = "brctl"
+ALTERNATIVE_PRIORITY[brctl] = "100"
+ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl"
+
+EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}"
+
+do_install_append () {
+    install -d ${D}/${datadir}/bridge-utils
+    install -d ${D}/${sysconfdir}/network/if-pre-up.d
+    install -d ${D}/${sysconfdir}/network/if-post-down.d
+}
+
+RRECOMMENDS_${PN} = "kernel-module-bridge"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 1/6] ddclient: new package
  2017-10-30 18:11 ` [meta-networking][PATCH 1/6] ddclient: new package Joe MacDonald
@ 2017-10-30 23:14   ` Khem Raj
  2017-10-31 13:35     ` Joe MacDonald
  0 siblings, 1 reply; 16+ messages in thread
From: Khem Raj @ 2017-10-30 23:14 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: openembeded-devel

On Mon, Oct 30, 2017 at 11:11 AM, Joe MacDonald
<joe_macdonald@mentor.com> wrote:
> From: "Kinsella, Ray" <ray.kinsella@intel.com>
>
> Adding the package ddclient. DDClient updates Dynamic DNS servers with an IP address.
> Recipe is based on the original OE recipe found here.
>
> http://cgit.openembedded.org/openembedded/tree/recipes/ddclient/ddclient_3.6.3.bb
>
> with modifications based on the recipe at:
>
> https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb
>
> DDClient version has been updated to 3.8.3.
>
> Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> ---
>  .../recipes-daemons/ddclient/ddclient_3.8.3.bb     | 44 ++++++++++++++++++++++
>  .../recipes-daemons/ddclient/files/ip-up           |  4 ++
>  .../recipes-daemons/ddclient/files/persistent      |  1 +
>  3 files changed, 49 insertions(+)
>  create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
>  create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
>  create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent
>
> diff --git a/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb b/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
> new file mode 100644
> index 0000000..d83a4d4
> --- /dev/null
> +++ b/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
> @@ -0,0 +1,44 @@
> +SECTION = "net/misc"
> +DESCRIPTION = "Ddclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Services"
> +HOMEPAGE = "http://ddclient.sourceforge.net/"
> +LICENSE = "GPLv2"
> +
> +SRC_URI = "\
> +    ${SOURCEFORGE_MIRROR}/ddclient/ddclient-${PV}.tar.bz2 \
> +    file://ip-up"
> +
> +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
> +
> +RDEPENDS_${PN} = "\
> +    perl-module-getopt-long \
> +    perl-module-sys-hostname \
> +    perl-module-io-socket \
> +    perl-module-vars \
> +    perl-module-overload \
> +    perl-module-overloading \
> +    perl-module-config \
> +    perl-module-integer \
> +    perl-module-exporter-heavy \
> +    perl-module-symbol \
> +    perl-module-selectsaver \
> +    bash \
> +    perl \
> +    libio-socket-ssl-perl"
> +
> +do_install() {
> +    install -d ${D}${sbindir} ${D}${sysconfdir}/ddclient ${D}${sysconfdir}/init.d
> +    install -d ${D}${sysconfdir}/ppp/ip-up.d/ install -d ${D}${docdir}/ddclient
> +    install -m 755 ${S}/ddclient ${D}${sbindir}
> +    install ${S}/sample-etc_ddclient.conf ${D}${sysconfdir}/ddclient/ddclient.conf
> +    install -m 755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/ip-up.d/ddclient
> +    sed -e 's|/etc/ddclient.conf|/etc/ddclient/ddclient.conf|g' ${S}/sample-etc_rc.d_init.d_ddclient > ${S}/rc_init
> +    install -m 755 ${S}/rc_init ${D}${sysconfdir}/init.d/ddclient
> +    install ${S}/README* ${D}${docdir}/ddclient
> +    install ${S}/COPY* ${D}${docdir}/ddclient
> +    install ${S}/sample* ${D}${docdir}/ddclient
> +}
> +
> +CONFFILES_${PN} = "${sysconfdir}/ddclient/ddclient.conf"
> +
> +SRC_URI[md5sum] = "3b426ae52d509e463b42eeb08fb89e0b"
> +SRC_URI[sha256sum] = "d40e2f1fd3f4bff386d27bbdf4b8645199b1995d27605a886b8c71e44d819591"
> diff --git a/meta-networking/recipes-daemons/ddclient/files/ip-up b/meta-networking/recipes-daemons/ddclient/files/ip-up
> new file mode 100644
> index 0000000..4411db9
> --- /dev/null
> +++ b/meta-networking/recipes-daemons/ddclient/files/ip-up
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +
> +logger -t ddclient $PPP_IFACE $PPP_LOCAL
> +ddclient -daemon=0 -syslog -use=if -if=$PPP_IFACE >/dev/null 2>&1
> diff --git a/meta-networking/recipes-daemons/ddclient/files/persistent b/meta-networking/recipes-daemons/ddclient/files/persistent
> new file mode 100644
> index 0000000..b721272
> --- /dev/null
> +++ b/meta-networking/recipes-daemons/ddclient/files/persistent
> @@ -0,0 +1 @@
> +l root root 0644 /etc/ddclient.conf /var/persistent/etc/ddclient.conf

this file seems to be unused. Can we delete it if no needed.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist
  2017-10-30 18:11 ` [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist Joe MacDonald
@ 2017-10-30 23:21   ` Khem Raj
  2017-10-31 13:29     ` Joe MacDonald
  0 siblings, 1 reply; 16+ messages in thread
From: Khem Raj @ 2017-10-30 23:21 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: openembeded-devel

On Mon, Oct 30, 2017 at 11:11 AM, Joe MacDonald
<joe_macdonald@mentor.com> wrote:
> Switching lksctp-tools to build from the upstream git repository rather
> than a source tarball.  At the same time we'll un-blacklist it since it
> appears the gold-as-ld issue has been resolved underneath us, probably
> related to a Debian bug of the same form that was also resolved with a
> binutils update.
>
> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> ---
>  .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
> index 11c43ff..9166aa5 100644
> --- a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
> +++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
> @@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
>      file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
>  "
>
> -SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
> +SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
> +

perhaps we need to reflect it in PV as well.

PV .= "+git${SRCPV}"

> +SRC_URI = " \
> +    git://github.com/sctp/lksctp-tools.git \
>      file://run-ptest \
>      file://v4test.sh \
>      file://v6test.sh \
>  "
>
> -SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
> -SRC_URI[sha256sum] = "1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"
> -
> -#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o    -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2 -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1 -o .libs/libsctp.so.1.0.16
> -#| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version
> -#| collect2: error: ld returned 1 exit status
> -#| make[4]: *** [libsctp.la] Error 1
> -PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"
> -
> -S = "${WORKDIR}/${BP}"
> +S = "${WORKDIR}/git"
>
>  BBCLASSEXTEND = "native"
>
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 3/6] freediameter: add new recipe
  2017-10-30 18:11 ` [meta-networking][PATCH 3/6] freediameter: add new recipe Joe MacDonald
@ 2017-10-30 23:25   ` Khem Raj
  2017-10-31  0:47   ` akuster808
  1 sibling, 0 replies; 16+ messages in thread
From: Khem Raj @ 2017-10-30 23:25 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: openembeded-devel

On Mon, Oct 30, 2017 at 11:11 AM, Joe MacDonald
<joe_macdonald@mentor.com> wrote:
> From: Jackie Huang <jackie.huang@windriver.com>
>
> freeDiameter is an open source Diameter protocol
> implementation. It provides an extensible platform
> for deploying a Diameter network for your Authentication,
> Authorization and Accounting needs.
>
> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> ---
>  ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
>  .../freediameter/files/freediameter.init           |  72 +++++++
>  .../freediameter/files/freediameter.service        |  11 +
>  .../freediameter/files/install_test.patch          |  22 ++
>  .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
>  .../recipes-protocols/freediameter/files/run-ptest |  11 +
>  .../freediameter/freediameter.inc                  |  98 +++++++++
>  .../freediameter/freediameter_1.2.1.bb             |   7 +
>  8 files changed, 516 insertions(+)
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
>  create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
>  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
>  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
>
> diff --git a/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
> new file mode 100644
> index 0000000..71a5a1a
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
> @@ -0,0 +1,223 @@
> +Replace murmurhash algorithm with Robert Jenkin's hash algorithm
> +
> +Upstream-Status: Pending
> +
> +From test result, murmurhash algorithm does not work in big endian
> +processor, so replace it with Robert Jenkin's hash which has worked
> +in linux kernel for many years and has more adaptability.
> +
> +Signed-off-by: Roy.Li <rongqing.li@windriver.com>
> +---
> + libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
> + 1 file changed, 74 insertions(+), 118 deletions(-)
> +
> +diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
> +index 8f29b48..ce1f4dd 100644
> +--- a/libfdproto/ostr.c
> ++++ b/libfdproto/ostr.c
> +@@ -430,128 +430,84 @@ after_proto:
> +
> +
> + /********************************************************************************************************/
> +-/* Hash function -- credits to Austin Appleby, thank you ^^ */
> +-/* See http://murmurhash.googlepages.com for more information on this function */
> +-
> +-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
> +-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
> +-uint32_t fd_os_hash ( uint8_t * string, size_t len )
> ++/*
> ++ * Robert Jenkin's hash function.
> ++ * http://burtleburtle.net/bob/hash/evahash.html
> ++ * This is in the public domain.
> ++ */
> ++#define mix(a, b, c)                                          \
> ++      do {                                                    \
> ++              a = a - b;  a = a - c;  a = a ^ (c >> 13);      \
> ++              b = b - c;  b = b - a;  b = b ^ (a << 8);       \
> ++              c = c - a;  c = c - b;  c = c ^ (b >> 13);      \
> ++              a = a - b;  a = a - c;  a = a ^ (c >> 12);      \
> ++              b = b - c;  b = b - a;  b = b ^ (a << 16);      \
> ++              c = c - a;  c = c - b;  c = c ^ (b >> 5);       \
> ++              a = a - b;  a = a - c;  a = a ^ (c >> 3);       \
> ++              b = b - c;  b = b - a;  b = b ^ (a << 10);      \
> ++              c = c - a;  c = c - b;  c = c ^ (b >> 15);      \
> ++      } while (0)
> ++
> ++unsigned hash_rjenkins(const char *str, unsigned length)
> + {
> +-      uint32_t hash = len;
> +-      uint8_t * data = string;
> +-
> +-      const unsigned int m = 0x5bd1e995;
> +-      const int r = 24;
> +-      int align = (long)string & 3;
> +-
> +-      if (!align || (len < 4)) {
> +-              /* In case data is aligned, MurmurHash2 function */
> +-              while(len >= 4)
> +-              {
> +-                      /* Mix 4 bytes at a time into the hash */
> +-                      uint32_t k = *(uint32_t *)data; /* We don't care about the byte order */
> +-
> +-                      _HASH_MIX(hash, k, m);
> +-
> +-                      data += 4;
> +-                      len -= 4;
> +-              }
> +-
> +-              /* Handle the last few bytes of the input */
> +-              switch(len) {
> +-                      case 3: hash ^= data[2] << 16;
> +-                      case 2: hash ^= data[1] << 8;
> +-                      case 1: hash ^= data[0];
> +-                              hash *= m;
> +-              }
> +-
> +-      } else {
> +-              /* Unaligned data, use alignment-safe slower version */
> +-
> +-              /* Pre-load the temp registers */
> +-              uint32_t t = 0, d = 0;
> +-              switch(align)
> +-              {
> +-                      case 1: t |= data[2] << 16;
> +-                      case 2: t |= data[1] << 8;
> +-                      case 3: t |= data[0];
> +-              }
> +-              t <<= (8 * align);
> +-
> +-              data += 4-align;
> +-              len -= 4-align;
> +-
> +-              /* From this point, "data" can be read by chunks of 4 bytes */
> +-
> +-              int sl = 8 * (4-align);
> +-              int sr = 8 * align;
> +-
> +-              /* Mix */
> +-              while(len >= 4)
> +-              {
> +-                      uint32_t k;
> +-
> +-                      d = *(unsigned int *)data;
> +-                      k = (t >> sr) | (d << sl);
> +-
> +-                      _HASH_MIX(hash, k, m);
> +-
> +-                      t = d;
> +-
> +-                      data += 4;
> +-                      len -= 4;
> +-              }
> +-
> +-              /* Handle leftover data in temp registers */
> +-              d = 0;
> +-              if(len >= align)
> +-              {
> +-                      uint32_t k;
> +-
> +-                      switch(align)
> +-                      {
> +-                      case 3: d |= data[2] << 16;
> +-                      case 2: d |= data[1] << 8;
> +-                      case 1: d |= data[0];
> +-                      }
> +-
> +-                      k = (t >> sr) | (d << sl);
> +-                      _HASH_MIX(hash, k, m);
> +-
> +-                      data += align;
> +-                      len -= align;
> +-
> +-                      /* Handle tail bytes */
> +-
> +-                      switch(len)
> +-                      {
> +-                      case 3: hash ^= data[2] << 16;
> +-                      case 2: hash ^= data[1] << 8;
> +-                      case 1: hash ^= data[0];
> +-                                      hash *= m;
> +-                      };
> +-              }
> +-              else
> +-              {
> +-                      switch(len)
> +-                      {
> +-                      case 3: d |= data[2] << 16;
> +-                      case 2: d |= data[1] << 8;
> +-                      case 1: d |= data[0];
> +-                      case 0: hash ^= (t >> sr) | (d << sl);
> +-                                      hash *= m;
> +-                      }
> +-              }
> +-
> ++      const unsigned char *k = (const unsigned char *)str;
> ++      uint32_t a, b, c;  /* the internal state */
> ++      uint32_t len;      /* how many key bytes still need mixing */
> ++
> ++      /* Set up the internal state */
> ++      len = length;
> ++      a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
> ++      b = a;
> ++      c = 0;               /* variable initialization of internal state */
> ++
> ++      /* handle most of the key */
> ++      while (len >= 12) {
> ++              a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
> ++                       ((uint32_t)k[3] << 24));
> ++              b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
> ++                       ((uint32_t)k[7] << 24));
> ++              c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
> ++                       ((uint32_t)k[11] << 24));
> ++              mix(a, b, c);
> ++              k = k + 12;
> ++              len = len - 12;
> ++      }
> +
> ++      /* handle the last 11 bytes */
> ++      c = c + length;
> ++      switch (len) {            /* all the case statements fall through */
> ++      case 11:
> ++              c = c + ((uint32_t)k[10] << 24);
> ++      case 10:
> ++              c = c + ((uint32_t)k[9] << 16);
> ++      case 9:
> ++              c = c + ((uint32_t)k[8] << 8);
> ++              /* the first byte of c is reserved for the length */
> ++      case 8:
> ++              b = b + ((uint32_t)k[7] << 24);
> ++      case 7:
> ++              b = b + ((uint32_t)k[6] << 16);
> ++      case 6:
> ++              b = b + ((uint32_t)k[5] << 8);
> ++      case 5:
> ++              b = b + k[4];
> ++      case 4:
> ++              a = a + ((uint32_t)k[3] << 24);
> ++      case 3:
> ++              a = a + ((uint32_t)k[2] << 16);
> ++      case 2:
> ++              a = a + ((uint32_t)k[1] << 8);
> ++      case 1:
> ++              a = a + k[0];
> ++              /* case 0: nothing left to add */
> +       }
> ++      mix(a, b, c);
> +
> +-      /* Do a few final mixes of the hash to ensure the last few
> +-         bytes are well-incorporated. */
> +-      hash ^= hash >> 13;
> +-      hash *= m;
> +-      hash ^= hash >> 15;
> ++      return c;
> ++}
> +
> +-      return hash;
> ++uint32_t fd_os_hash ( uint8_t * string, size_t len )
> ++{
> ++      return hash_rjenkins(string, len);
> + }
> +
> +--
> +1.7.10.4
> +
> diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.init b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
> new file mode 100755
> index 0000000..e63a42a
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
> @@ -0,0 +1,72 @@
> +#!/bin/sh
> +#
> +### BEGIN INIT INFO
> +# Provides:          freediameter
> +# Default-Start:     2 3 4 5
> +# Default-Stop:      0 1 6
> +# Required-Start:    $remote_fs $syslog
> +# Required-Stop:     $remote_fs $syslog
> +# Short-Description: Start freeDiameter daemon at boot time
> +# Description:       Start the freeDiameter daemon at boot time.
> +#       freeDiameter is an extensible implementation of the Diameter protocol,
> +#       designed for Authentication, Authorization and Accounting. Diameter is
> +#       an evolution of the RADIUS protocol.
> +### END INIT INFO#
> +DAEMON=/usr/bin/freeDiameterd
> +CONF=/etc/freeDiameter/freeDiameter.conf
> +NAME=freediameter
> +DESC="freeDiameter daemon"
> +
> +. /etc/init.d/functions
> +start() {
> +       [ -x $DAEMON ] || exit 5
> +       echo -n $"Starting $DAEMON: "
> +       start-stop-daemon -S -b -x ${DAEMON} && success || failure
> +       retval=$?
> +       echo ""
> +       return $retval
> +}
> +
> +stop() {
> +       echo -n $"Stopping $prog: "
> +       start-stop-daemon -K -x $DAEMON
> +       retval=$?
> +       echo ""
> +       return $retval
> +}
> +
> +restart() {
> +       stop
> +       sleep 3
> +       start
> +}
> +
> +rh_status() {
> +       status $DAEMON
> +}
> +
> +rh_status_q() {
> +       rh_status > /dev/null 2>&1
> +}
> +
> +case "$1" in
> +  start)
> +       rh_status_q && exit 0
> +       start
> +       ;;
> +  stop)
> +       rh_status_q || exit 0
> +       stop
> +       ;;
> +  restart)
> +       restart
> +       ;;
> +  status)
> +       rh_status
> +       ;;
> +  *)
> +       echo $"Usage: $prog {start|stop|status|restart}"
> +       exit 2
> +esac
> +
> +exit $?
> diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
> new file mode 100644
> index 0000000..514481b
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
> @@ -0,0 +1,11 @@
> +[Unit]
> +Description=freediameter daemon
> +After=network.target
> +
> +[Service]
> +Type=simple
> +PIDFile=/var/run/freediameter.pid
> +ExecStart=@BINDIR@/freeDiameterd
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta-networking/recipes-protocols/freediameter/files/install_test.patch b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
> new file mode 100644
> index 0000000..151037d
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
> @@ -0,0 +1,22 @@
> +CMakeLists: add an option to install tests
> +
> +Upstream-Status: Inappropriate [OE ptest specific]
> +
> +Original author: Yao Zhao <yao.zhao@windriver.com>
> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> +
> +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> +index da8da1b..de04059 100644
> +--- a/tests/CMakeLists.txt
> ++++ b/tests/CMakeLists.txt
> +@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
> + ####
> + ## INSTALL section ##
> +
> +-# we do not install the tests
> ++# install the tests
> ++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
> ++
> ++INSTALL(TARGETS ${TEST_LIST}
> ++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
> ++        COMPONENT freeDiameter-common)
> diff --git a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
> new file mode 100644
> index 0000000..ea857af
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
> @@ -0,0 +1,72 @@
> +freediameter ptest cases testmesg_stress.c and testloadext.c need load
> +extensions both build time and runtime. Then they search extensions with
> +build directory that causes runtime failures.
> +
> +Pass an environment variable to define runtime extension path.
> +
> +Upstream-Status: Inappropriate [OE ptest specific]
> +
> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> +
> +diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
> +--- freeDiameter-1.2.0.orig/tests/testloadext.c        2014-02-19 17:33:24.785405032 +0800
> ++++ freeDiameter-1.2.0/tests/testloadext.c     2014-02-19 20:08:03.871403924 +0800
> +@@ -49,7 +49,7 @@
> + {
> +       DIR *dir;
> +       struct dirent *dp;
> +-      char fullname[512];
> ++      char fullname[1024];
> +       int pathlen;
> +
> +       /* First, initialize the daemon modules */
> +@@ -57,11 +57,16 @@
> +       CHECK( 0, fd_queues_init()  );
> +       CHECK( 0, fd_msg_init()  );
> +       CHECK( 0, fd_rtdisp_init()  );
> +-
> ++
> ++      char *ext_dir = getenv("EXTENSIONS_DIR");
> ++      if (ext_dir)
> ++              pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
> ++      else
> ++              pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++
> +       /* Find all extensions which have been compiled along the test */
> +-      TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
> +-      CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
> +-      pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++      TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
> ++      CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
> +
> +       while ((dp = readdir (dir)) != NULL) {
> +               char * dot = strrchr(dp->d_name, '.');
> +diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
> +--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c    2014-02-19 17:33:24.785405032 +0800
> ++++ freeDiameter-1.2.0/tests/testmesg_stress.c 2014-02-19 20:08:03.928403924 +0800
> +@@ -67,15 +67,20 @@
> + {
> +       DIR *dir;
> +       struct dirent *dp;
> +-      char fullname[512];
> ++      char fullname[1024];
> +       int pathlen;
> +       struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
> +       struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
> +
> ++      char *ext_dir = getenv("EXTENSIONS_DIR");
> ++      if (ext_dir)
> ++              pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
> ++      else
> ++              pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++
> +       /* Find all extensions which have been compiled along the test */
> +-      LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
> +-      CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
> +-      pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++      TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
> ++      CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
> +
> +       while ((dp = readdir (dir)) != NULL) {
> +               char * dot = strrchr(dp->d_name, '.');
> diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest
> new file mode 100644
> index 0000000..d0ca8d9
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
> +        echo "Couldn't load kernel module sctp."
> +        echo "Test cases testsctp and testcnx will fail."
> +        echo
> +fi
> +
> +export EXTENSIONS_DIR=$EXTENSIONS_DIR
> +cmake  -E cmake_echo_color --cyan "Running tests..."
> +ctest --force-new-ctest-process
> diff --git a/meta-networking/recipes-protocols/freediameter/freediameter.inc b/meta-networking/recipes-protocols/freediameter/freediameter.inc
> new file mode 100644
> index 0000000..6880d26
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/freediameter.inc
> @@ -0,0 +1,98 @@
> +SUMMARY = "An open source implementation of the diameter protocol"
> +DESCRIPTION = "\
> +freeDiameter is an open source Diameter protocol implementation. It \
> +provides an extensible platform for deploying a Diameter network for \
> +your Authentication, Authorization and Accounting needs."
> +
> +HOMEPAGE = "http://www.freediameter.net"
> +
> +DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
> +
> +pkgname = "freeDiameter"
> +
> +SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
> +           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
> +           file://freediameter.service \
> +           file://freediameter.init \
> +           \
> +           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
> +           'file://install_test.patch \
> +            file://run-ptest \
> +            file://pass-ptest-env.patch', '', d)} \
> +           "
> +
> +S = "${WORKDIR}/${pkgname}-${PV}"
> +
> +PTEST_PATH = "${libdir}/${pkgname}/ptest"
> +

pkgname is used elsewhere in global metadata like build history, may
be use something else so the changes of conflicts are less

> +inherit cmake update-rc.d ptest systemd
> +
> +EXTRA_OECMAKE = " \
> +    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
> +    -DBUILD_DBG_MONITOR:BOOL=ON  \
> +    -DBUILD_TEST_APP:BOOL=ON \
> +    -DBUILD_TESTING:BOOL=ON \
> +    -DBUILD_APP_RADGW:BOOL=ON \
> +    -DBUILD_APP_REDIRECT:BOOL=ON \
> +    -DBUILD_TEST_ACCT:BOOL=ON \
> +    -DBUILD_TEST_NETEMUL:BOOL=ON \
> +    -DBUILD_TEST_RT_ANY:BOOL=ON \
> +    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
> +    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
> +    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
> +    -DCMAKE_SKIP_RPATH:BOOL=ON \
> +"
> +# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
> +# specify it on cmd line will fix the SET bug in CMakeList.txt
> +
> +# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
> +
> +# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
> +# These need MySQL support
> +
> +# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
> +
> +# -DALL_EXTENSIONS=ON will enable all
> +
> +do_install_append() {
> +    # install the sample configuration file
> +    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
> +    for i in ${S}/doc/*.conf.sample; do
> +        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
> +    done
> +    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
> +      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
> +
> +    # install daemon init related files
> +    install -d -m 0755 ${D}${sysconfdir}/default
> +    install -d -m 0755 ${D}${sysconfdir}/init.d
> +    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
> +      ${D}${sysconfdir}/default/${BPN}
> +    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
> +
> +    # install for systemd
> +    install -d ${D}${systemd_system_unitdir}
> +    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
> +    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
> +}
> +
> +do_install_ptest() {
> +    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
> +    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
> +    rmdir ${D}${PTEST_PATH}-tests
> +    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
> +}
> +
> +FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
> +
> +# include the extensions in main package
> +FILES_${PN} += "${libdir}/${pkgname}/*"
> +
> +RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
> +RDEPENDS_${PN}-ptest = "cmake"
> +
> +INITSCRIPT_NAME = "${BPN}"
> +INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
> +
> +SYSTEMD_SERVICE_${PN} = "freediameter.service"
> +SYSTEMD_AUTO_ENABLE = "disable"
> diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
> new file mode 100644
> index 0000000..3fb929a
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
> @@ -0,0 +1,7 @@
> +include freediameter.inc
> +
> +LICENSE = "BSD"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
> +
> +SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
> +SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 3/6] freediameter: add new recipe
  2017-10-30 18:11 ` [meta-networking][PATCH 3/6] freediameter: add new recipe Joe MacDonald
  2017-10-30 23:25   ` Khem Raj
@ 2017-10-31  0:47   ` akuster808
  2017-10-31 13:21     ` Joe MacDonald
  1 sibling, 1 reply; 16+ messages in thread
From: akuster808 @ 2017-10-31  0:47 UTC (permalink / raw)
  To: Joe MacDonald, openembedded-devel



On 10/30/2017 11:11 AM, Joe MacDonald wrote:
> From: Jackie Huang <jackie.huang@windriver.com>
>
> freeDiameter is an open source Diameter protocol
> implementation. It provides an extensible platform
> for deploying a Diameter network for your Authentication,
> Authorization and Accounting needs.
>
> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
If you want this in meta-networking, please send a patch to remove it
from meta-security.

- armin
> ---
>  ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
>  .../freediameter/files/freediameter.init           |  72 +++++++
>  .../freediameter/files/freediameter.service        |  11 +
>  .../freediameter/files/install_test.patch          |  22 ++
>  .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
>  .../recipes-protocols/freediameter/files/run-ptest |  11 +
>  .../freediameter/freediameter.inc                  |  98 +++++++++
>  .../freediameter/freediameter_1.2.1.bb             |   7 +
>  8 files changed, 516 insertions(+)
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
>  create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
>  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
>  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
>
> diff --git a/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
> new file mode 100644
> index 0000000..71a5a1a
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
> @@ -0,0 +1,223 @@
> +Replace murmurhash algorithm with Robert Jenkin's hash algorithm
> +
> +Upstream-Status: Pending
> +
> +From test result, murmurhash algorithm does not work in big endian
> +processor, so replace it with Robert Jenkin's hash which has worked
> +in linux kernel for many years and has more adaptability.
> +
> +Signed-off-by: Roy.Li <rongqing.li@windriver.com>
> +---
> + libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
> + 1 file changed, 74 insertions(+), 118 deletions(-)
> +
> +diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
> +index 8f29b48..ce1f4dd 100644
> +--- a/libfdproto/ostr.c
> ++++ b/libfdproto/ostr.c
> +@@ -430,128 +430,84 @@ after_proto:
> + 
> + 
> + /********************************************************************************************************/
> +-/* Hash function -- credits to Austin Appleby, thank you ^^ */
> +-/* See http://murmurhash.googlepages.com for more information on this function */
> +-
> +-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
> +-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
> +-uint32_t fd_os_hash ( uint8_t * string, size_t len )
> ++/*
> ++ * Robert Jenkin's hash function.
> ++ * http://burtleburtle.net/bob/hash/evahash.html
> ++ * This is in the public domain.
> ++ */
> ++#define mix(a, b, c)						\
> ++	do {							\
> ++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
> ++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
> ++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
> ++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
> ++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
> ++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
> ++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
> ++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
> ++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
> ++	} while (0)
> ++
> ++unsigned hash_rjenkins(const char *str, unsigned length)
> + {
> +-	uint32_t hash = len;
> +-	uint8_t * data = string;
> +-	
> +-	const unsigned int m = 0x5bd1e995;
> +-	const int r = 24;
> +-	int align = (long)string & 3;
> +-	
> +-	if (!align || (len < 4)) {
> +-		/* In case data is aligned, MurmurHash2 function */
> +-		while(len >= 4)
> +-		{
> +-			/* Mix 4 bytes at a time into the hash */
> +-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
> +-
> +-			_HASH_MIX(hash, k, m);
> +-
> +-			data += 4;
> +-			len -= 4;
> +-		}
> +-
> +-		/* Handle the last few bytes of the input */
> +-		switch(len) {
> +-			case 3: hash ^= data[2] << 16;
> +-			case 2: hash ^= data[1] << 8;
> +-			case 1: hash ^= data[0];
> +-	        		hash *= m;
> +-		}
> +-		
> +-	} else {
> +-		/* Unaligned data, use alignment-safe slower version */
> +-		
> +-		/* Pre-load the temp registers */
> +-		uint32_t t = 0, d = 0;
> +-		switch(align)
> +-		{
> +-			case 1: t |= data[2] << 16;
> +-			case 2: t |= data[1] << 8;
> +-			case 3: t |= data[0];
> +-		}
> +-		t <<= (8 * align);
> +-
> +-		data += 4-align;
> +-		len -= 4-align;
> +-		
> +-		/* From this point, "data" can be read by chunks of 4 bytes */
> +-		
> +-		int sl = 8 * (4-align);
> +-		int sr = 8 * align;
> +-
> +-		/* Mix */
> +-		while(len >= 4)
> +-		{
> +-			uint32_t k;
> +-			
> +-			d = *(unsigned int *)data;
> +-			k = (t >> sr) | (d << sl);
> +-
> +-			_HASH_MIX(hash, k, m);
> +-
> +-			t = d;
> +-
> +-			data += 4;
> +-			len -= 4;
> +-		}
> +-
> +-		/* Handle leftover data in temp registers */
> +-		d = 0;
> +-		if(len >= align)
> +-		{
> +-			uint32_t k;
> +-			
> +-			switch(align)
> +-			{
> +-			case 3: d |= data[2] << 16;
> +-			case 2: d |= data[1] << 8;
> +-			case 1: d |= data[0];
> +-			}
> +-
> +-			k = (t >> sr) | (d << sl);
> +-			_HASH_MIX(hash, k, m);
> +-
> +-			data += align;
> +-			len -= align;
> +-
> +-			/* Handle tail bytes */
> +-
> +-			switch(len)
> +-			{
> +-			case 3: hash ^= data[2] << 16;
> +-			case 2: hash ^= data[1] << 8;
> +-			case 1: hash ^= data[0];
> +-					hash *= m;
> +-			};
> +-		}
> +-		else
> +-		{
> +-			switch(len)
> +-			{
> +-			case 3: d |= data[2] << 16;
> +-			case 2: d |= data[1] << 8;
> +-			case 1: d |= data[0];
> +-			case 0: hash ^= (t >> sr) | (d << sl);
> +-					hash *= m;
> +-			}
> +-		}
> +-
> ++	const unsigned char *k = (const unsigned char *)str;
> ++	uint32_t a, b, c;  /* the internal state */
> ++	uint32_t len;      /* how many key bytes still need mixing */
> ++
> ++	/* Set up the internal state */
> ++	len = length;
> ++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
> ++	b = a;
> ++	c = 0;               /* variable initialization of internal state */
> ++
> ++	/* handle most of the key */
> ++	while (len >= 12) {
> ++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
> ++			 ((uint32_t)k[3] << 24));
> ++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
> ++			 ((uint32_t)k[7] << 24));
> ++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
> ++			 ((uint32_t)k[11] << 24));
> ++		mix(a, b, c);
> ++		k = k + 12;
> ++		len = len - 12;
> ++	}
> + 
> ++	/* handle the last 11 bytes */
> ++	c = c + length;
> ++	switch (len) {            /* all the case statements fall through */
> ++	case 11:
> ++		c = c + ((uint32_t)k[10] << 24);
> ++	case 10:
> ++		c = c + ((uint32_t)k[9] << 16);
> ++	case 9:
> ++		c = c + ((uint32_t)k[8] << 8);
> ++		/* the first byte of c is reserved for the length */
> ++	case 8:
> ++		b = b + ((uint32_t)k[7] << 24);
> ++	case 7:
> ++		b = b + ((uint32_t)k[6] << 16);
> ++	case 6:
> ++		b = b + ((uint32_t)k[5] << 8);
> ++	case 5:
> ++		b = b + k[4];
> ++	case 4:
> ++		a = a + ((uint32_t)k[3] << 24);
> ++	case 3:
> ++		a = a + ((uint32_t)k[2] << 16);
> ++	case 2:
> ++		a = a + ((uint32_t)k[1] << 8);
> ++	case 1:
> ++		a = a + k[0];
> ++		/* case 0: nothing left to add */
> + 	}
> ++	mix(a, b, c);
> + 
> +-	/* Do a few final mixes of the hash to ensure the last few
> +-	   bytes are well-incorporated. */
> +-	hash ^= hash >> 13;
> +-	hash *= m;
> +-	hash ^= hash >> 15;
> ++	return c;
> ++}
> + 
> +-	return hash;
> ++uint32_t fd_os_hash ( uint8_t * string, size_t len )
> ++{
> ++	return hash_rjenkins(string, len); 
> + } 
> + 
> +-- 
> +1.7.10.4
> +
> diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.init b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
> new file mode 100755
> index 0000000..e63a42a
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
> @@ -0,0 +1,72 @@
> +#!/bin/sh
> +#
> +### BEGIN INIT INFO
> +# Provides:          freediameter
> +# Default-Start:     2 3 4 5
> +# Default-Stop:      0 1 6
> +# Required-Start:    $remote_fs $syslog
> +# Required-Stop:     $remote_fs $syslog
> +# Short-Description: Start freeDiameter daemon at boot time
> +# Description:       Start the freeDiameter daemon at boot time.
> +#       freeDiameter is an extensible implementation of the Diameter protocol,
> +#       designed for Authentication, Authorization and Accounting. Diameter is
> +#       an evolution of the RADIUS protocol.
> +### END INIT INFO#
> +DAEMON=/usr/bin/freeDiameterd
> +CONF=/etc/freeDiameter/freeDiameter.conf
> +NAME=freediameter
> +DESC="freeDiameter daemon"
> +
> +. /etc/init.d/functions
> +start() {
> +	[ -x $DAEMON ] || exit 5
> +	echo -n $"Starting $DAEMON: "
> +	start-stop-daemon -S -b -x ${DAEMON} && success || failure
> +	retval=$?
> +	echo ""
> +	return $retval
> +}
> +
> +stop() {
> +	echo -n $"Stopping $prog: "
> +	start-stop-daemon -K -x $DAEMON
> +	retval=$?
> +	echo ""
> +	return $retval
> +}
> +
> +restart() {
> +	stop
> +	sleep 3
> +	start
> +}
> +
> +rh_status() {
> +	status $DAEMON
> +}
> +
> +rh_status_q() {
> +	rh_status > /dev/null 2>&1
> +}
> +
> +case "$1" in
> +  start)
> +	rh_status_q && exit 0
> +	start
> +	;;
> +  stop)
> +	rh_status_q || exit 0
> +	stop
> +	;;
> +  restart)
> +	restart
> +	;;
> +  status)
> +	rh_status
> +	;;
> +  *)
> +	echo $"Usage: $prog {start|stop|status|restart}"
> +	exit 2
> +esac
> +
> +exit $?
> diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
> new file mode 100644
> index 0000000..514481b
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
> @@ -0,0 +1,11 @@
> +[Unit]
> +Description=freediameter daemon
> +After=network.target
> +
> +[Service]
> +Type=simple
> +PIDFile=/var/run/freediameter.pid
> +ExecStart=@BINDIR@/freeDiameterd
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta-networking/recipes-protocols/freediameter/files/install_test.patch b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
> new file mode 100644
> index 0000000..151037d
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
> @@ -0,0 +1,22 @@
> +CMakeLists: add an option to install tests
> +
> +Upstream-Status: Inappropriate [OE ptest specific]
> +
> +Original author: Yao Zhao <yao.zhao@windriver.com>
> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> +
> +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> +index da8da1b..de04059 100644
> +--- a/tests/CMakeLists.txt
> ++++ b/tests/CMakeLists.txt
> +@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
> + ####
> + ## INSTALL section ##
> + 
> +-# we do not install the tests
> ++# install the tests
> ++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
> ++
> ++INSTALL(TARGETS ${TEST_LIST}
> ++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
> ++        COMPONENT freeDiameter-common)
> diff --git a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
> new file mode 100644
> index 0000000..ea857af
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
> @@ -0,0 +1,72 @@
> +freediameter ptest cases testmesg_stress.c and testloadext.c need load
> +extensions both build time and runtime. Then they search extensions with
> +build directory that causes runtime failures.
> +
> +Pass an environment variable to define runtime extension path.
> +
> +Upstream-Status: Inappropriate [OE ptest specific]
> +
> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> +
> +diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
> +--- freeDiameter-1.2.0.orig/tests/testloadext.c	2014-02-19 17:33:24.785405032 +0800
> ++++ freeDiameter-1.2.0/tests/testloadext.c	2014-02-19 20:08:03.871403924 +0800
> +@@ -49,7 +49,7 @@
> + {
> + 	DIR *dir;
> + 	struct dirent *dp;
> +-	char fullname[512];
> ++	char fullname[1024];
> + 	int pathlen;
> + 
> + 	/* First, initialize the daemon modules */
> +@@ -57,11 +57,16 @@
> + 	CHECK( 0, fd_queues_init()  );
> + 	CHECK( 0, fd_msg_init()  );
> + 	CHECK( 0, fd_rtdisp_init()  );
> +-	
> ++
> ++	char *ext_dir = getenv("EXTENSIONS_DIR");
> ++	if (ext_dir)
> ++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
> ++	else
> ++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++
> + 	/* Find all extensions which have been compiled along the test */
> +-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
> +-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
> +-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
> ++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
> + 	
> + 	while ((dp = readdir (dir)) != NULL) {
> + 		char * dot = strrchr(dp->d_name, '.');
> +diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
> +--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c	2014-02-19 17:33:24.785405032 +0800
> ++++ freeDiameter-1.2.0/tests/testmesg_stress.c	2014-02-19 20:08:03.928403924 +0800
> +@@ -67,15 +67,20 @@
> + {
> + 	DIR *dir;
> + 	struct dirent *dp;
> +-	char fullname[512];
> ++	char fullname[1024];
> + 	int pathlen;
> + 	struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
> + 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
> + 
> ++	char *ext_dir = getenv("EXTENSIONS_DIR");
> ++	if (ext_dir)
> ++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
> ++	else
> ++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++
> + 	/* Find all extensions which have been compiled along the test */
> +-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
> +-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
> +-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> ++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
> ++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
> + 	
> + 	while ((dp = readdir (dir)) != NULL) {
> + 		char * dot = strrchr(dp->d_name, '.');
> diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest
> new file mode 100644
> index 0000000..d0ca8d9
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
> +        echo "Couldn't load kernel module sctp."
> +        echo "Test cases testsctp and testcnx will fail."
> +        echo
> +fi
> +
> +export EXTENSIONS_DIR=$EXTENSIONS_DIR
> +cmake  -E cmake_echo_color --cyan "Running tests..."
> +ctest --force-new-ctest-process
> diff --git a/meta-networking/recipes-protocols/freediameter/freediameter.inc b/meta-networking/recipes-protocols/freediameter/freediameter.inc
> new file mode 100644
> index 0000000..6880d26
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/freediameter.inc
> @@ -0,0 +1,98 @@
> +SUMMARY = "An open source implementation of the diameter protocol"
> +DESCRIPTION = "\
> +freeDiameter is an open source Diameter protocol implementation. It \
> +provides an extensible platform for deploying a Diameter network for \
> +your Authentication, Authorization and Accounting needs."
> +
> +HOMEPAGE = "http://www.freediameter.net"
> +
> +DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
> +
> +pkgname = "freeDiameter"
> +
> +SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
> +           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
> +           file://freediameter.service \
> +           file://freediameter.init \
> +           \
> +           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
> +           'file://install_test.patch \
> +            file://run-ptest \
> +            file://pass-ptest-env.patch', '', d)} \
> +           "
> +
> +S = "${WORKDIR}/${pkgname}-${PV}"
> +
> +PTEST_PATH = "${libdir}/${pkgname}/ptest"
> +
> +inherit cmake update-rc.d ptest systemd
> +
> +EXTRA_OECMAKE = " \
> +    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
> +    -DBUILD_DBG_MONITOR:BOOL=ON  \
> +    -DBUILD_TEST_APP:BOOL=ON \
> +    -DBUILD_TESTING:BOOL=ON \
> +    -DBUILD_APP_RADGW:BOOL=ON \
> +    -DBUILD_APP_REDIRECT:BOOL=ON \
> +    -DBUILD_TEST_ACCT:BOOL=ON \
> +    -DBUILD_TEST_NETEMUL:BOOL=ON \
> +    -DBUILD_TEST_RT_ANY:BOOL=ON \
> +    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
> +    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
> +    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
> +    -DCMAKE_SKIP_RPATH:BOOL=ON \
> +"
> +# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
> +# specify it on cmd line will fix the SET bug in CMakeList.txt
> +
> +# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
> +
> +# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
> +# These need MySQL support
> +
> +# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
> +
> +# -DALL_EXTENSIONS=ON will enable all
> +
> +do_install_append() {
> +    # install the sample configuration file
> +    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
> +    for i in ${S}/doc/*.conf.sample; do
> +        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
> +    done
> +    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
> +      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
> +
> +    # install daemon init related files
> +    install -d -m 0755 ${D}${sysconfdir}/default
> +    install -d -m 0755 ${D}${sysconfdir}/init.d
> +    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
> +      ${D}${sysconfdir}/default/${BPN}
> +    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
> +
> +    # install for systemd
> +    install -d ${D}${systemd_system_unitdir}
> +    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
> +    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
> +}
> +
> +do_install_ptest() {
> +    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
> +    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
> +    rmdir ${D}${PTEST_PATH}-tests
> +    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
> +}
> +
> +FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
> +
> +# include the extensions in main package
> +FILES_${PN} += "${libdir}/${pkgname}/*"
> +
> +RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
> +RDEPENDS_${PN}-ptest = "cmake"
> +
> +INITSCRIPT_NAME = "${BPN}"
> +INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
> +
> +SYSTEMD_SERVICE_${PN} = "freediameter.service"
> +SYSTEMD_AUTO_ENABLE = "disable"
> diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
> new file mode 100644
> index 0000000..3fb929a
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
> @@ -0,0 +1,7 @@
> +include freediameter.inc
> +
> +LICENSE = "BSD"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
> +
> +SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
> +SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 3/6] freediameter: add new recipe
  2017-10-31  0:47   ` akuster808
@ 2017-10-31 13:21     ` Joe MacDonald
  2017-10-31 15:46       ` akuster808
  0 siblings, 1 reply; 16+ messages in thread
From: Joe MacDonald @ 2017-10-31 13:21 UTC (permalink / raw)
  To: akuster808; +Cc: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 23396 bytes --]

[Re: [oe] [meta-networking][PATCH 3/6] freediameter: add new recipe] On 17.10.30 (Mon 17:47) akuster808 wrote:

> 
> 
> On 10/30/2017 11:11 AM, Joe MacDonald wrote:
> > From: Jackie Huang <jackie.huang@windriver.com>
> >
> > freeDiameter is an open source Diameter protocol
> > implementation. It provides an extensible platform
> > for deploying a Diameter network for your Authentication,
> > Authorization and Accounting needs.
> >
> > Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> > Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> If you want this in meta-networking, please send a patch to remove it
> from meta-security.

I never even thought of looking for it in meta-security.  Since I've
always encountered it in the CGL space it just never occurred, and since
the patch was still apparently active in patchwork, I just assumed it'd
been lost.

Do you (or anyone else using the layers) have a preference for what we
do with the recipe?  Unfortunately at a glance they look at least a bit
different from each other, so if I'm going to include it in
meta-networking I'll want to review what's in meta-security first to
determine what changes are appropriate to the meta-networking version.

-J.

> 
> - armin
> > ---
> >  ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
> >  .../freediameter/files/freediameter.init           |  72 +++++++
> >  .../freediameter/files/freediameter.service        |  11 +
> >  .../freediameter/files/install_test.patch          |  22 ++
> >  .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
> >  .../recipes-protocols/freediameter/files/run-ptest |  11 +
> >  .../freediameter/freediameter.inc                  |  98 +++++++++
> >  .../freediameter/freediameter_1.2.1.bb             |   7 +
> >  8 files changed, 516 insertions(+)
> >  create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
> >  create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
> >  create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
> >  create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
> >  create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
> >  create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
> >  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
> >  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
> >
> > diff --git a/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
> > new file mode 100644
> > index 0000000..71a5a1a
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
> > @@ -0,0 +1,223 @@
> > +Replace murmurhash algorithm with Robert Jenkin's hash algorithm
> > +
> > +Upstream-Status: Pending
> > +
> > +From test result, murmurhash algorithm does not work in big endian
> > +processor, so replace it with Robert Jenkin's hash which has worked
> > +in linux kernel for many years and has more adaptability.
> > +
> > +Signed-off-by: Roy.Li <rongqing.li@windriver.com>
> > +---
> > + libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
> > + 1 file changed, 74 insertions(+), 118 deletions(-)
> > +
> > +diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
> > +index 8f29b48..ce1f4dd 100644
> > +--- a/libfdproto/ostr.c
> > ++++ b/libfdproto/ostr.c
> > +@@ -430,128 +430,84 @@ after_proto:
> > + 
> > + 
> > + /********************************************************************************************************/
> > +-/* Hash function -- credits to Austin Appleby, thank you ^^ */
> > +-/* See http://murmurhash.googlepages.com for more information on this function */
> > +-
> > +-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
> > +-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
> > +-uint32_t fd_os_hash ( uint8_t * string, size_t len )
> > ++/*
> > ++ * Robert Jenkin's hash function.
> > ++ * http://burtleburtle.net/bob/hash/evahash.html
> > ++ * This is in the public domain.
> > ++ */
> > ++#define mix(a, b, c)						\
> > ++	do {							\
> > ++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
> > ++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
> > ++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
> > ++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
> > ++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
> > ++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
> > ++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
> > ++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
> > ++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
> > ++	} while (0)
> > ++
> > ++unsigned hash_rjenkins(const char *str, unsigned length)
> > + {
> > +-	uint32_t hash = len;
> > +-	uint8_t * data = string;
> > +-	
> > +-	const unsigned int m = 0x5bd1e995;
> > +-	const int r = 24;
> > +-	int align = (long)string & 3;
> > +-	
> > +-	if (!align || (len < 4)) {
> > +-		/* In case data is aligned, MurmurHash2 function */
> > +-		while(len >= 4)
> > +-		{
> > +-			/* Mix 4 bytes at a time into the hash */
> > +-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
> > +-
> > +-			_HASH_MIX(hash, k, m);
> > +-
> > +-			data += 4;
> > +-			len -= 4;
> > +-		}
> > +-
> > +-		/* Handle the last few bytes of the input */
> > +-		switch(len) {
> > +-			case 3: hash ^= data[2] << 16;
> > +-			case 2: hash ^= data[1] << 8;
> > +-			case 1: hash ^= data[0];
> > +-	        		hash *= m;
> > +-		}
> > +-		
> > +-	} else {
> > +-		/* Unaligned data, use alignment-safe slower version */
> > +-		
> > +-		/* Pre-load the temp registers */
> > +-		uint32_t t = 0, d = 0;
> > +-		switch(align)
> > +-		{
> > +-			case 1: t |= data[2] << 16;
> > +-			case 2: t |= data[1] << 8;
> > +-			case 3: t |= data[0];
> > +-		}
> > +-		t <<= (8 * align);
> > +-
> > +-		data += 4-align;
> > +-		len -= 4-align;
> > +-		
> > +-		/* From this point, "data" can be read by chunks of 4 bytes */
> > +-		
> > +-		int sl = 8 * (4-align);
> > +-		int sr = 8 * align;
> > +-
> > +-		/* Mix */
> > +-		while(len >= 4)
> > +-		{
> > +-			uint32_t k;
> > +-			
> > +-			d = *(unsigned int *)data;
> > +-			k = (t >> sr) | (d << sl);
> > +-
> > +-			_HASH_MIX(hash, k, m);
> > +-
> > +-			t = d;
> > +-
> > +-			data += 4;
> > +-			len -= 4;
> > +-		}
> > +-
> > +-		/* Handle leftover data in temp registers */
> > +-		d = 0;
> > +-		if(len >= align)
> > +-		{
> > +-			uint32_t k;
> > +-			
> > +-			switch(align)
> > +-			{
> > +-			case 3: d |= data[2] << 16;
> > +-			case 2: d |= data[1] << 8;
> > +-			case 1: d |= data[0];
> > +-			}
> > +-
> > +-			k = (t >> sr) | (d << sl);
> > +-			_HASH_MIX(hash, k, m);
> > +-
> > +-			data += align;
> > +-			len -= align;
> > +-
> > +-			/* Handle tail bytes */
> > +-
> > +-			switch(len)
> > +-			{
> > +-			case 3: hash ^= data[2] << 16;
> > +-			case 2: hash ^= data[1] << 8;
> > +-			case 1: hash ^= data[0];
> > +-					hash *= m;
> > +-			};
> > +-		}
> > +-		else
> > +-		{
> > +-			switch(len)
> > +-			{
> > +-			case 3: d |= data[2] << 16;
> > +-			case 2: d |= data[1] << 8;
> > +-			case 1: d |= data[0];
> > +-			case 0: hash ^= (t >> sr) | (d << sl);
> > +-					hash *= m;
> > +-			}
> > +-		}
> > +-
> > ++	const unsigned char *k = (const unsigned char *)str;
> > ++	uint32_t a, b, c;  /* the internal state */
> > ++	uint32_t len;      /* how many key bytes still need mixing */
> > ++
> > ++	/* Set up the internal state */
> > ++	len = length;
> > ++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
> > ++	b = a;
> > ++	c = 0;               /* variable initialization of internal state */
> > ++
> > ++	/* handle most of the key */
> > ++	while (len >= 12) {
> > ++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
> > ++			 ((uint32_t)k[3] << 24));
> > ++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
> > ++			 ((uint32_t)k[7] << 24));
> > ++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
> > ++			 ((uint32_t)k[11] << 24));
> > ++		mix(a, b, c);
> > ++		k = k + 12;
> > ++		len = len - 12;
> > ++	}
> > + 
> > ++	/* handle the last 11 bytes */
> > ++	c = c + length;
> > ++	switch (len) {            /* all the case statements fall through */
> > ++	case 11:
> > ++		c = c + ((uint32_t)k[10] << 24);
> > ++	case 10:
> > ++		c = c + ((uint32_t)k[9] << 16);
> > ++	case 9:
> > ++		c = c + ((uint32_t)k[8] << 8);
> > ++		/* the first byte of c is reserved for the length */
> > ++	case 8:
> > ++		b = b + ((uint32_t)k[7] << 24);
> > ++	case 7:
> > ++		b = b + ((uint32_t)k[6] << 16);
> > ++	case 6:
> > ++		b = b + ((uint32_t)k[5] << 8);
> > ++	case 5:
> > ++		b = b + k[4];
> > ++	case 4:
> > ++		a = a + ((uint32_t)k[3] << 24);
> > ++	case 3:
> > ++		a = a + ((uint32_t)k[2] << 16);
> > ++	case 2:
> > ++		a = a + ((uint32_t)k[1] << 8);
> > ++	case 1:
> > ++		a = a + k[0];
> > ++		/* case 0: nothing left to add */
> > + 	}
> > ++	mix(a, b, c);
> > + 
> > +-	/* Do a few final mixes of the hash to ensure the last few
> > +-	   bytes are well-incorporated. */
> > +-	hash ^= hash >> 13;
> > +-	hash *= m;
> > +-	hash ^= hash >> 15;
> > ++	return c;
> > ++}
> > + 
> > +-	return hash;
> > ++uint32_t fd_os_hash ( uint8_t * string, size_t len )
> > ++{
> > ++	return hash_rjenkins(string, len); 
> > + } 
> > + 
> > +-- 
> > +1.7.10.4
> > +
> > diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.init b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
> > new file mode 100755
> > index 0000000..e63a42a
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
> > @@ -0,0 +1,72 @@
> > +#!/bin/sh
> > +#
> > +### BEGIN INIT INFO
> > +# Provides:          freediameter
> > +# Default-Start:     2 3 4 5
> > +# Default-Stop:      0 1 6
> > +# Required-Start:    $remote_fs $syslog
> > +# Required-Stop:     $remote_fs $syslog
> > +# Short-Description: Start freeDiameter daemon at boot time
> > +# Description:       Start the freeDiameter daemon at boot time.
> > +#       freeDiameter is an extensible implementation of the Diameter protocol,
> > +#       designed for Authentication, Authorization and Accounting. Diameter is
> > +#       an evolution of the RADIUS protocol.
> > +### END INIT INFO#
> > +DAEMON=/usr/bin/freeDiameterd
> > +CONF=/etc/freeDiameter/freeDiameter.conf
> > +NAME=freediameter
> > +DESC="freeDiameter daemon"
> > +
> > +. /etc/init.d/functions
> > +start() {
> > +	[ -x $DAEMON ] || exit 5
> > +	echo -n $"Starting $DAEMON: "
> > +	start-stop-daemon -S -b -x ${DAEMON} && success || failure
> > +	retval=$?
> > +	echo ""
> > +	return $retval
> > +}
> > +
> > +stop() {
> > +	echo -n $"Stopping $prog: "
> > +	start-stop-daemon -K -x $DAEMON
> > +	retval=$?
> > +	echo ""
> > +	return $retval
> > +}
> > +
> > +restart() {
> > +	stop
> > +	sleep 3
> > +	start
> > +}
> > +
> > +rh_status() {
> > +	status $DAEMON
> > +}
> > +
> > +rh_status_q() {
> > +	rh_status > /dev/null 2>&1
> > +}
> > +
> > +case "$1" in
> > +  start)
> > +	rh_status_q && exit 0
> > +	start
> > +	;;
> > +  stop)
> > +	rh_status_q || exit 0
> > +	stop
> > +	;;
> > +  restart)
> > +	restart
> > +	;;
> > +  status)
> > +	rh_status
> > +	;;
> > +  *)
> > +	echo $"Usage: $prog {start|stop|status|restart}"
> > +	exit 2
> > +esac
> > +
> > +exit $?
> > diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
> > new file mode 100644
> > index 0000000..514481b
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
> > @@ -0,0 +1,11 @@
> > +[Unit]
> > +Description=freediameter daemon
> > +After=network.target
> > +
> > +[Service]
> > +Type=simple
> > +PIDFile=/var/run/freediameter.pid
> > +ExecStart=@BINDIR@/freeDiameterd
> > +
> > +[Install]
> > +WantedBy=multi-user.target
> > diff --git a/meta-networking/recipes-protocols/freediameter/files/install_test.patch b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
> > new file mode 100644
> > index 0000000..151037d
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
> > @@ -0,0 +1,22 @@
> > +CMakeLists: add an option to install tests
> > +
> > +Upstream-Status: Inappropriate [OE ptest specific]
> > +
> > +Original author: Yao Zhao <yao.zhao@windriver.com>
> > +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> > +
> > +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> > +index da8da1b..de04059 100644
> > +--- a/tests/CMakeLists.txt
> > ++++ b/tests/CMakeLists.txt
> > +@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
> > + ####
> > + ## INSTALL section ##
> > + 
> > +-# we do not install the tests
> > ++# install the tests
> > ++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
> > ++
> > ++INSTALL(TARGETS ${TEST_LIST}
> > ++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
> > ++        COMPONENT freeDiameter-common)
> > diff --git a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
> > new file mode 100644
> > index 0000000..ea857af
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
> > @@ -0,0 +1,72 @@
> > +freediameter ptest cases testmesg_stress.c and testloadext.c need load
> > +extensions both build time and runtime. Then they search extensions with
> > +build directory that causes runtime failures.
> > +
> > +Pass an environment variable to define runtime extension path.
> > +
> > +Upstream-Status: Inappropriate [OE ptest specific]
> > +
> > +Signed-off-by: Kai Kang <kai.kang@windriver.com>
> > +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> > +
> > +diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
> > +--- freeDiameter-1.2.0.orig/tests/testloadext.c	2014-02-19 17:33:24.785405032 +0800
> > ++++ freeDiameter-1.2.0/tests/testloadext.c	2014-02-19 20:08:03.871403924 +0800
> > +@@ -49,7 +49,7 @@
> > + {
> > + 	DIR *dir;
> > + 	struct dirent *dp;
> > +-	char fullname[512];
> > ++	char fullname[1024];
> > + 	int pathlen;
> > + 
> > + 	/* First, initialize the daemon modules */
> > +@@ -57,11 +57,16 @@
> > + 	CHECK( 0, fd_queues_init()  );
> > + 	CHECK( 0, fd_msg_init()  );
> > + 	CHECK( 0, fd_rtdisp_init()  );
> > +-	
> > ++
> > ++	char *ext_dir = getenv("EXTENSIONS_DIR");
> > ++	if (ext_dir)
> > ++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
> > ++	else
> > ++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> > ++
> > + 	/* Find all extensions which have been compiled along the test */
> > +-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
> > +-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
> > +-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> > ++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
> > ++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
> > + 	
> > + 	while ((dp = readdir (dir)) != NULL) {
> > + 		char * dot = strrchr(dp->d_name, '.');
> > +diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
> > +--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c	2014-02-19 17:33:24.785405032 +0800
> > ++++ freeDiameter-1.2.0/tests/testmesg_stress.c	2014-02-19 20:08:03.928403924 +0800
> > +@@ -67,15 +67,20 @@
> > + {
> > + 	DIR *dir;
> > + 	struct dirent *dp;
> > +-	char fullname[512];
> > ++	char fullname[1024];
> > + 	int pathlen;
> > + 	struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
> > + 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
> > + 
> > ++	char *ext_dir = getenv("EXTENSIONS_DIR");
> > ++	if (ext_dir)
> > ++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
> > ++	else
> > ++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> > ++
> > + 	/* Find all extensions which have been compiled along the test */
> > +-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
> > +-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
> > +-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
> > ++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
> > ++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
> > + 	
> > + 	while ((dp = readdir (dir)) != NULL) {
> > + 		char * dot = strrchr(dp->d_name, '.');
> > diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest
> > new file mode 100644
> > index 0000000..d0ca8d9
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest
> > @@ -0,0 +1,11 @@
> > +#!/bin/sh
> > +
> > +if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
> > +        echo "Couldn't load kernel module sctp."
> > +        echo "Test cases testsctp and testcnx will fail."
> > +        echo
> > +fi
> > +
> > +export EXTENSIONS_DIR=$EXTENSIONS_DIR
> > +cmake  -E cmake_echo_color --cyan "Running tests..."
> > +ctest --force-new-ctest-process
> > diff --git a/meta-networking/recipes-protocols/freediameter/freediameter.inc b/meta-networking/recipes-protocols/freediameter/freediameter.inc
> > new file mode 100644
> > index 0000000..6880d26
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/freediameter.inc
> > @@ -0,0 +1,98 @@
> > +SUMMARY = "An open source implementation of the diameter protocol"
> > +DESCRIPTION = "\
> > +freeDiameter is an open source Diameter protocol implementation. It \
> > +provides an extensible platform for deploying a Diameter network for \
> > +your Authentication, Authorization and Accounting needs."
> > +
> > +HOMEPAGE = "http://www.freediameter.net"
> > +
> > +DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
> > +
> > +pkgname = "freeDiameter"
> > +
> > +SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
> > +           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
> > +           file://freediameter.service \
> > +           file://freediameter.init \
> > +           \
> > +           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
> > +           'file://install_test.patch \
> > +            file://run-ptest \
> > +            file://pass-ptest-env.patch', '', d)} \
> > +           "
> > +
> > +S = "${WORKDIR}/${pkgname}-${PV}"
> > +
> > +PTEST_PATH = "${libdir}/${pkgname}/ptest"
> > +
> > +inherit cmake update-rc.d ptest systemd
> > +
> > +EXTRA_OECMAKE = " \
> > +    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
> > +    -DBUILD_DBG_MONITOR:BOOL=ON  \
> > +    -DBUILD_TEST_APP:BOOL=ON \
> > +    -DBUILD_TESTING:BOOL=ON \
> > +    -DBUILD_APP_RADGW:BOOL=ON \
> > +    -DBUILD_APP_REDIRECT:BOOL=ON \
> > +    -DBUILD_TEST_ACCT:BOOL=ON \
> > +    -DBUILD_TEST_NETEMUL:BOOL=ON \
> > +    -DBUILD_TEST_RT_ANY:BOOL=ON \
> > +    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
> > +    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
> > +    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
> > +    -DCMAKE_SKIP_RPATH:BOOL=ON \
> > +"
> > +# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
> > +# specify it on cmd line will fix the SET bug in CMakeList.txt
> > +
> > +# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
> > +
> > +# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
> > +# These need MySQL support
> > +
> > +# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
> > +
> > +# -DALL_EXTENSIONS=ON will enable all
> > +
> > +do_install_append() {
> > +    # install the sample configuration file
> > +    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
> > +    for i in ${S}/doc/*.conf.sample; do
> > +        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
> > +    done
> > +    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
> > +      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
> > +
> > +    # install daemon init related files
> > +    install -d -m 0755 ${D}${sysconfdir}/default
> > +    install -d -m 0755 ${D}${sysconfdir}/init.d
> > +    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
> > +      ${D}${sysconfdir}/default/${BPN}
> > +    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
> > +
> > +    # install for systemd
> > +    install -d ${D}${systemd_system_unitdir}
> > +    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
> > +    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
> > +}
> > +
> > +do_install_ptest() {
> > +    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
> > +    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
> > +    rmdir ${D}${PTEST_PATH}-tests
> > +    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
> > +}
> > +
> > +FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
> > +
> > +# include the extensions in main package
> > +FILES_${PN} += "${libdir}/${pkgname}/*"
> > +
> > +RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
> > +RDEPENDS_${PN}-ptest = "cmake"
> > +
> > +INITSCRIPT_NAME = "${BPN}"
> > +INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
> > +
> > +SYSTEMD_SERVICE_${PN} = "freediameter.service"
> > +SYSTEMD_AUTO_ENABLE = "disable"
> > diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
> > new file mode 100644
> > index 0000000..3fb929a
> > --- /dev/null
> > +++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
> > @@ -0,0 +1,7 @@
> > +include freediameter.inc
> > +
> > +LICENSE = "BSD"
> > +LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
> > +
> > +SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
> > +SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
> 

-- 
-Joe MacDonald.
:wq

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist
  2017-10-30 23:21   ` Khem Raj
@ 2017-10-31 13:29     ` Joe MacDonald
  2017-10-31 19:10       ` Khem Raj
  0 siblings, 1 reply; 16+ messages in thread
From: Joe MacDonald @ 2017-10-31 13:29 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

[-- Attachment #1: Type: text/plain, Size: 3505 bytes --]

[Re: [oe] [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist] On 17.10.30 (Mon 16:21) Khem Raj wrote:

> On Mon, Oct 30, 2017 at 11:11 AM, Joe MacDonald
> <joe_macdonald@mentor.com> wrote:
> > Switching lksctp-tools to build from the upstream git repository rather
> > than a source tarball.  At the same time we'll un-blacklist it since it
> > appears the gold-as-ld issue has been resolved underneath us, probably
> > related to a Debian bug of the same form that was also resolved with a
> > binutils update.
> >
> > Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> > ---
> >  .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16 +++++-----------
> >  1 file changed, 5 insertions(+), 11 deletions(-)
> >
> > diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
> > index 11c43ff..9166aa5 100644
> > --- a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
> > +++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
> > @@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
> >      file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
> >  "
> >
> > -SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
> > +SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
> > +
> 
> perhaps we need to reflect it in PV as well.
> 
> PV .= "+git${SRCPV}"

I was less inclined to decorate the PV with the git hash since the
SRCREV points at the release tag for 1.0.17, but I suppose if upstream
chose to move the tag then this would be out of sync, so it's worth it.

-J.

> 
> > +SRC_URI = " \
> > +    git://github.com/sctp/lksctp-tools.git \
> >      file://run-ptest \
> >      file://v4test.sh \
> >      file://v6test.sh \
> >  "
> >
> > -SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
> > -SRC_URI[sha256sum] = "1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"
> > -
> > -#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o    -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2 -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1 -o .libs/libsctp.so.1.0.16
> > -#| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version
> > -#| collect2: error: ld returned 1 exit status
> > -#| make[4]: *** [libsctp.la] Error 1
> > -PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"
> > -
> > -S = "${WORKDIR}/${BP}"
> > +S = "${WORKDIR}/git"
> >
> >  BBCLASSEXTEND = "native"
> >
> > --
> > 2.7.4
> >
> > --
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
-Joe MacDonald.
:wq

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 1/6] ddclient: new package
  2017-10-30 23:14   ` Khem Raj
@ 2017-10-31 13:35     ` Joe MacDonald
  0 siblings, 0 replies; 16+ messages in thread
From: Joe MacDonald @ 2017-10-31 13:35 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

[-- Attachment #1: Type: text/plain, Size: 4718 bytes --]

[Re: [oe] [meta-networking][PATCH 1/6] ddclient: new package] On 17.10.30 (Mon 16:14) Khem Raj wrote:

> On Mon, Oct 30, 2017 at 11:11 AM, Joe MacDonald
> <joe_macdonald@mentor.com> wrote:
> > From: "Kinsella, Ray" <ray.kinsella@intel.com>
> >
> > Adding the package ddclient. DDClient updates Dynamic DNS servers with an IP address.
> > Recipe is based on the original OE recipe found here.
> >
> > http://cgit.openembedded.org/openembedded/tree/recipes/ddclient/ddclient_3.6.3.bb
> >
> > with modifications based on the recipe at:
> >
> > https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb
> >
> > DDClient version has been updated to 3.8.3.
> >
> > Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
> > Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> > ---
> >  .../recipes-daemons/ddclient/ddclient_3.8.3.bb     | 44 ++++++++++++++++++++++
> >  .../recipes-daemons/ddclient/files/ip-up           |  4 ++
> >  .../recipes-daemons/ddclient/files/persistent      |  1 +
> >  3 files changed, 49 insertions(+)
> >  create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
> >  create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
> >  create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent
> >
> > diff --git a/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb b/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
> > new file mode 100644
> > index 0000000..d83a4d4
> > --- /dev/null
> > +++ b/meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
> > @@ -0,0 +1,44 @@
> > +SECTION = "net/misc"
> > +DESCRIPTION = "Ddclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Services"
> > +HOMEPAGE = "http://ddclient.sourceforge.net/"
> > +LICENSE = "GPLv2"
> > +
> > +SRC_URI = "\
> > +    ${SOURCEFORGE_MIRROR}/ddclient/ddclient-${PV}.tar.bz2 \
> > +    file://ip-up"
> > +
> > +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
> > +
> > +RDEPENDS_${PN} = "\
> > +    perl-module-getopt-long \
> > +    perl-module-sys-hostname \
> > +    perl-module-io-socket \
> > +    perl-module-vars \
> > +    perl-module-overload \
> > +    perl-module-overloading \
> > +    perl-module-config \
> > +    perl-module-integer \
> > +    perl-module-exporter-heavy \
> > +    perl-module-symbol \
> > +    perl-module-selectsaver \
> > +    bash \
> > +    perl \
> > +    libio-socket-ssl-perl"
> > +
> > +do_install() {
> > +    install -d ${D}${sbindir} ${D}${sysconfdir}/ddclient ${D}${sysconfdir}/init.d
> > +    install -d ${D}${sysconfdir}/ppp/ip-up.d/ install -d ${D}${docdir}/ddclient
> > +    install -m 755 ${S}/ddclient ${D}${sbindir}
> > +    install ${S}/sample-etc_ddclient.conf ${D}${sysconfdir}/ddclient/ddclient.conf
> > +    install -m 755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/ip-up.d/ddclient
> > +    sed -e 's|/etc/ddclient.conf|/etc/ddclient/ddclient.conf|g' ${S}/sample-etc_rc.d_init.d_ddclient > ${S}/rc_init
> > +    install -m 755 ${S}/rc_init ${D}${sysconfdir}/init.d/ddclient
> > +    install ${S}/README* ${D}${docdir}/ddclient
> > +    install ${S}/COPY* ${D}${docdir}/ddclient
> > +    install ${S}/sample* ${D}${docdir}/ddclient
> > +}
> > +
> > +CONFFILES_${PN} = "${sysconfdir}/ddclient/ddclient.conf"
> > +
> > +SRC_URI[md5sum] = "3b426ae52d509e463b42eeb08fb89e0b"
> > +SRC_URI[sha256sum] = "d40e2f1fd3f4bff386d27bbdf4b8645199b1995d27605a886b8c71e44d819591"
> > diff --git a/meta-networking/recipes-daemons/ddclient/files/ip-up b/meta-networking/recipes-daemons/ddclient/files/ip-up
> > new file mode 100644
> > index 0000000..4411db9
> > --- /dev/null
> > +++ b/meta-networking/recipes-daemons/ddclient/files/ip-up
> > @@ -0,0 +1,4 @@
> > +#!/bin/sh
> > +
> > +logger -t ddclient $PPP_IFACE $PPP_LOCAL
> > +ddclient -daemon=0 -syslog -use=if -if=$PPP_IFACE >/dev/null 2>&1
> > diff --git a/meta-networking/recipes-daemons/ddclient/files/persistent b/meta-networking/recipes-daemons/ddclient/files/persistent
> > new file mode 100644
> > index 0000000..b721272
> > --- /dev/null
> > +++ b/meta-networking/recipes-daemons/ddclient/files/persistent
> > @@ -0,0 +1 @@
> > +l root root 0644 /etc/ddclient.conf /var/persistent/etc/ddclient.conf
> 
> this file seems to be unused. Can we delete it if no needed.

Actually, that appears to be an oversight, it was supposed to be
installed in this style:

   https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb#L31

Corrected in the next version.

-- 
-Joe MacDonald.
:wq

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 3/6] freediameter: add new recipe
  2017-10-31 13:21     ` Joe MacDonald
@ 2017-10-31 15:46       ` akuster808
  0 siblings, 0 replies; 16+ messages in thread
From: akuster808 @ 2017-10-31 15:46 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: openembedded-devel



On 10/31/2017 06:21 AM, Joe MacDonald wrote:
> [Re: [oe] [meta-networking][PATCH 3/6] freediameter: add new recipe] On 17.10.30 (Mon 17:47) akuster808 wrote:
>
>>
>> On 10/30/2017 11:11 AM, Joe MacDonald wrote:
>>> From: Jackie Huang <jackie.huang@windriver.com>
>>>
>>> freeDiameter is an open source Diameter protocol
>>> implementation. It provides an extensible platform
>>> for deploying a Diameter network for your Authentication,
>>> Authorization and Accounting needs.
>>>
>>> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
>>> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
>> If you want this in meta-networking, please send a patch to remove it
>> from meta-security.
> I never even thought of looking for it in meta-security.  Since I've
> always encountered it in the CGL space it just never occurred, and since
> the patch was still apparently active in patchwork, I just assumed it'd
> been lost.
>
> Do you (or anyone else using the layers) have a preference for what we
> do with the recipe? 
Meta-networking is fine by me.

-Armin
>  Unfortunately at a glance they look at least a bit
> different from each other, so if I'm going to include it in
> meta-networking I'll want to review what's in meta-security first to
> determine what changes are appropriate to the meta-networking version.
>
> -J.
>
>> - armin
>>> ---
>>>  ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
>>>  .../freediameter/files/freediameter.init           |  72 +++++++
>>>  .../freediameter/files/freediameter.service        |  11 +
>>>  .../freediameter/files/install_test.patch          |  22 ++
>>>  .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
>>>  .../recipes-protocols/freediameter/files/run-ptest |  11 +
>>>  .../freediameter/freediameter.inc                  |  98 +++++++++
>>>  .../freediameter/freediameter_1.2.1.bb             |   7 +
>>>  8 files changed, 516 insertions(+)
>>>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
>>>  create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
>>>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
>>>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
>>>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
>>>  create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
>>>  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
>>>  create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
>>>
>>> diff --git a/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
>>> new file mode 100644
>>> index 0000000..71a5a1a
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
>>> @@ -0,0 +1,223 @@
>>> +Replace murmurhash algorithm with Robert Jenkin's hash algorithm
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +From test result, murmurhash algorithm does not work in big endian
>>> +processor, so replace it with Robert Jenkin's hash which has worked
>>> +in linux kernel for many years and has more adaptability.
>>> +
>>> +Signed-off-by: Roy.Li <rongqing.li@windriver.com>
>>> +---
>>> + libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
>>> + 1 file changed, 74 insertions(+), 118 deletions(-)
>>> +
>>> +diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
>>> +index 8f29b48..ce1f4dd 100644
>>> +--- a/libfdproto/ostr.c
>>> ++++ b/libfdproto/ostr.c
>>> +@@ -430,128 +430,84 @@ after_proto:
>>> + 
>>> + 
>>> + /********************************************************************************************************/
>>> +-/* Hash function -- credits to Austin Appleby, thank you ^^ */
>>> +-/* See http://murmurhash.googlepages.com for more information on this function */
>>> +-
>>> +-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
>>> +-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
>>> +-uint32_t fd_os_hash ( uint8_t * string, size_t len )
>>> ++/*
>>> ++ * Robert Jenkin's hash function.
>>> ++ * http://burtleburtle.net/bob/hash/evahash.html
>>> ++ * This is in the public domain.
>>> ++ */
>>> ++#define mix(a, b, c)						\
>>> ++	do {							\
>>> ++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
>>> ++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
>>> ++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
>>> ++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
>>> ++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
>>> ++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
>>> ++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
>>> ++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
>>> ++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
>>> ++	} while (0)
>>> ++
>>> ++unsigned hash_rjenkins(const char *str, unsigned length)
>>> + {
>>> +-	uint32_t hash = len;
>>> +-	uint8_t * data = string;
>>> +-	
>>> +-	const unsigned int m = 0x5bd1e995;
>>> +-	const int r = 24;
>>> +-	int align = (long)string & 3;
>>> +-	
>>> +-	if (!align || (len < 4)) {
>>> +-		/* In case data is aligned, MurmurHash2 function */
>>> +-		while(len >= 4)
>>> +-		{
>>> +-			/* Mix 4 bytes at a time into the hash */
>>> +-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
>>> +-
>>> +-			_HASH_MIX(hash, k, m);
>>> +-
>>> +-			data += 4;
>>> +-			len -= 4;
>>> +-		}
>>> +-
>>> +-		/* Handle the last few bytes of the input */
>>> +-		switch(len) {
>>> +-			case 3: hash ^= data[2] << 16;
>>> +-			case 2: hash ^= data[1] << 8;
>>> +-			case 1: hash ^= data[0];
>>> +-	        		hash *= m;
>>> +-		}
>>> +-		
>>> +-	} else {
>>> +-		/* Unaligned data, use alignment-safe slower version */
>>> +-		
>>> +-		/* Pre-load the temp registers */
>>> +-		uint32_t t = 0, d = 0;
>>> +-		switch(align)
>>> +-		{
>>> +-			case 1: t |= data[2] << 16;
>>> +-			case 2: t |= data[1] << 8;
>>> +-			case 3: t |= data[0];
>>> +-		}
>>> +-		t <<= (8 * align);
>>> +-
>>> +-		data += 4-align;
>>> +-		len -= 4-align;
>>> +-		
>>> +-		/* From this point, "data" can be read by chunks of 4 bytes */
>>> +-		
>>> +-		int sl = 8 * (4-align);
>>> +-		int sr = 8 * align;
>>> +-
>>> +-		/* Mix */
>>> +-		while(len >= 4)
>>> +-		{
>>> +-			uint32_t k;
>>> +-			
>>> +-			d = *(unsigned int *)data;
>>> +-			k = (t >> sr) | (d << sl);
>>> +-
>>> +-			_HASH_MIX(hash, k, m);
>>> +-
>>> +-			t = d;
>>> +-
>>> +-			data += 4;
>>> +-			len -= 4;
>>> +-		}
>>> +-
>>> +-		/* Handle leftover data in temp registers */
>>> +-		d = 0;
>>> +-		if(len >= align)
>>> +-		{
>>> +-			uint32_t k;
>>> +-			
>>> +-			switch(align)
>>> +-			{
>>> +-			case 3: d |= data[2] << 16;
>>> +-			case 2: d |= data[1] << 8;
>>> +-			case 1: d |= data[0];
>>> +-			}
>>> +-
>>> +-			k = (t >> sr) | (d << sl);
>>> +-			_HASH_MIX(hash, k, m);
>>> +-
>>> +-			data += align;
>>> +-			len -= align;
>>> +-
>>> +-			/* Handle tail bytes */
>>> +-
>>> +-			switch(len)
>>> +-			{
>>> +-			case 3: hash ^= data[2] << 16;
>>> +-			case 2: hash ^= data[1] << 8;
>>> +-			case 1: hash ^= data[0];
>>> +-					hash *= m;
>>> +-			};
>>> +-		}
>>> +-		else
>>> +-		{
>>> +-			switch(len)
>>> +-			{
>>> +-			case 3: d |= data[2] << 16;
>>> +-			case 2: d |= data[1] << 8;
>>> +-			case 1: d |= data[0];
>>> +-			case 0: hash ^= (t >> sr) | (d << sl);
>>> +-					hash *= m;
>>> +-			}
>>> +-		}
>>> +-
>>> ++	const unsigned char *k = (const unsigned char *)str;
>>> ++	uint32_t a, b, c;  /* the internal state */
>>> ++	uint32_t len;      /* how many key bytes still need mixing */
>>> ++
>>> ++	/* Set up the internal state */
>>> ++	len = length;
>>> ++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
>>> ++	b = a;
>>> ++	c = 0;               /* variable initialization of internal state */
>>> ++
>>> ++	/* handle most of the key */
>>> ++	while (len >= 12) {
>>> ++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
>>> ++			 ((uint32_t)k[3] << 24));
>>> ++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
>>> ++			 ((uint32_t)k[7] << 24));
>>> ++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
>>> ++			 ((uint32_t)k[11] << 24));
>>> ++		mix(a, b, c);
>>> ++		k = k + 12;
>>> ++		len = len - 12;
>>> ++	}
>>> + 
>>> ++	/* handle the last 11 bytes */
>>> ++	c = c + length;
>>> ++	switch (len) {            /* all the case statements fall through */
>>> ++	case 11:
>>> ++		c = c + ((uint32_t)k[10] << 24);
>>> ++	case 10:
>>> ++		c = c + ((uint32_t)k[9] << 16);
>>> ++	case 9:
>>> ++		c = c + ((uint32_t)k[8] << 8);
>>> ++		/* the first byte of c is reserved for the length */
>>> ++	case 8:
>>> ++		b = b + ((uint32_t)k[7] << 24);
>>> ++	case 7:
>>> ++		b = b + ((uint32_t)k[6] << 16);
>>> ++	case 6:
>>> ++		b = b + ((uint32_t)k[5] << 8);
>>> ++	case 5:
>>> ++		b = b + k[4];
>>> ++	case 4:
>>> ++		a = a + ((uint32_t)k[3] << 24);
>>> ++	case 3:
>>> ++		a = a + ((uint32_t)k[2] << 16);
>>> ++	case 2:
>>> ++		a = a + ((uint32_t)k[1] << 8);
>>> ++	case 1:
>>> ++		a = a + k[0];
>>> ++		/* case 0: nothing left to add */
>>> + 	}
>>> ++	mix(a, b, c);
>>> + 
>>> +-	/* Do a few final mixes of the hash to ensure the last few
>>> +-	   bytes are well-incorporated. */
>>> +-	hash ^= hash >> 13;
>>> +-	hash *= m;
>>> +-	hash ^= hash >> 15;
>>> ++	return c;
>>> ++}
>>> + 
>>> +-	return hash;
>>> ++uint32_t fd_os_hash ( uint8_t * string, size_t len )
>>> ++{
>>> ++	return hash_rjenkins(string, len); 
>>> + } 
>>> + 
>>> +-- 
>>> +1.7.10.4
>>> +
>>> diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.init b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
>>> new file mode 100755
>>> index 0000000..e63a42a
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.init
>>> @@ -0,0 +1,72 @@
>>> +#!/bin/sh
>>> +#
>>> +### BEGIN INIT INFO
>>> +# Provides:          freediameter
>>> +# Default-Start:     2 3 4 5
>>> +# Default-Stop:      0 1 6
>>> +# Required-Start:    $remote_fs $syslog
>>> +# Required-Stop:     $remote_fs $syslog
>>> +# Short-Description: Start freeDiameter daemon at boot time
>>> +# Description:       Start the freeDiameter daemon at boot time.
>>> +#       freeDiameter is an extensible implementation of the Diameter protocol,
>>> +#       designed for Authentication, Authorization and Accounting. Diameter is
>>> +#       an evolution of the RADIUS protocol.
>>> +### END INIT INFO#
>>> +DAEMON=/usr/bin/freeDiameterd
>>> +CONF=/etc/freeDiameter/freeDiameter.conf
>>> +NAME=freediameter
>>> +DESC="freeDiameter daemon"
>>> +
>>> +. /etc/init.d/functions
>>> +start() {
>>> +	[ -x $DAEMON ] || exit 5
>>> +	echo -n $"Starting $DAEMON: "
>>> +	start-stop-daemon -S -b -x ${DAEMON} && success || failure
>>> +	retval=$?
>>> +	echo ""
>>> +	return $retval
>>> +}
>>> +
>>> +stop() {
>>> +	echo -n $"Stopping $prog: "
>>> +	start-stop-daemon -K -x $DAEMON
>>> +	retval=$?
>>> +	echo ""
>>> +	return $retval
>>> +}
>>> +
>>> +restart() {
>>> +	stop
>>> +	sleep 3
>>> +	start
>>> +}
>>> +
>>> +rh_status() {
>>> +	status $DAEMON
>>> +}
>>> +
>>> +rh_status_q() {
>>> +	rh_status > /dev/null 2>&1
>>> +}
>>> +
>>> +case "$1" in
>>> +  start)
>>> +	rh_status_q && exit 0
>>> +	start
>>> +	;;
>>> +  stop)
>>> +	rh_status_q || exit 0
>>> +	stop
>>> +	;;
>>> +  restart)
>>> +	restart
>>> +	;;
>>> +  status)
>>> +	rh_status
>>> +	;;
>>> +  *)
>>> +	echo $"Usage: $prog {start|stop|status|restart}"
>>> +	exit 2
>>> +esac
>>> +
>>> +exit $?
>>> diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
>>> new file mode 100644
>>> index 0000000..514481b
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.service
>>> @@ -0,0 +1,11 @@
>>> +[Unit]
>>> +Description=freediameter daemon
>>> +After=network.target
>>> +
>>> +[Service]
>>> +Type=simple
>>> +PIDFile=/var/run/freediameter.pid
>>> +ExecStart=@BINDIR@/freeDiameterd
>>> +
>>> +[Install]
>>> +WantedBy=multi-user.target
>>> diff --git a/meta-networking/recipes-protocols/freediameter/files/install_test.patch b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
>>> new file mode 100644
>>> index 0000000..151037d
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/files/install_test.patch
>>> @@ -0,0 +1,22 @@
>>> +CMakeLists: add an option to install tests
>>> +
>>> +Upstream-Status: Inappropriate [OE ptest specific]
>>> +
>>> +Original author: Yao Zhao <yao.zhao@windriver.com>
>>> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
>>> +
>>> +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
>>> +index da8da1b..de04059 100644
>>> +--- a/tests/CMakeLists.txt
>>> ++++ b/tests/CMakeLists.txt
>>> +@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
>>> + ####
>>> + ## INSTALL section ##
>>> + 
>>> +-# we do not install the tests
>>> ++# install the tests
>>> ++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
>>> ++
>>> ++INSTALL(TARGETS ${TEST_LIST}
>>> ++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
>>> ++        COMPONENT freeDiameter-common)
>>> diff --git a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
>>> new file mode 100644
>>> index 0000000..ea857af
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
>>> @@ -0,0 +1,72 @@
>>> +freediameter ptest cases testmesg_stress.c and testloadext.c need load
>>> +extensions both build time and runtime. Then they search extensions with
>>> +build directory that causes runtime failures.
>>> +
>>> +Pass an environment variable to define runtime extension path.
>>> +
>>> +Upstream-Status: Inappropriate [OE ptest specific]
>>> +
>>> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
>>> +
>>> +diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
>>> +--- freeDiameter-1.2.0.orig/tests/testloadext.c	2014-02-19 17:33:24.785405032 +0800
>>> ++++ freeDiameter-1.2.0/tests/testloadext.c	2014-02-19 20:08:03.871403924 +0800
>>> +@@ -49,7 +49,7 @@
>>> + {
>>> + 	DIR *dir;
>>> + 	struct dirent *dp;
>>> +-	char fullname[512];
>>> ++	char fullname[1024];
>>> + 	int pathlen;
>>> + 
>>> + 	/* First, initialize the daemon modules */
>>> +@@ -57,11 +57,16 @@
>>> + 	CHECK( 0, fd_queues_init()  );
>>> + 	CHECK( 0, fd_msg_init()  );
>>> + 	CHECK( 0, fd_rtdisp_init()  );
>>> +-	
>>> ++
>>> ++	char *ext_dir = getenv("EXTENSIONS_DIR");
>>> ++	if (ext_dir)
>>> ++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
>>> ++	else
>>> ++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
>>> ++
>>> + 	/* Find all extensions which have been compiled along the test */
>>> +-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
>>> +-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
>>> +-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
>>> ++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
>>> ++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
>>> + 	
>>> + 	while ((dp = readdir (dir)) != NULL) {
>>> + 		char * dot = strrchr(dp->d_name, '.');
>>> +diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
>>> +--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c	2014-02-19 17:33:24.785405032 +0800
>>> ++++ freeDiameter-1.2.0/tests/testmesg_stress.c	2014-02-19 20:08:03.928403924 +0800
>>> +@@ -67,15 +67,20 @@
>>> + {
>>> + 	DIR *dir;
>>> + 	struct dirent *dp;
>>> +-	char fullname[512];
>>> ++	char fullname[1024];
>>> + 	int pathlen;
>>> + 	struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
>>> + 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
>>> + 
>>> ++	char *ext_dir = getenv("EXTENSIONS_DIR");
>>> ++	if (ext_dir)
>>> ++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
>>> ++	else
>>> ++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
>>> ++
>>> + 	/* Find all extensions which have been compiled along the test */
>>> +-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
>>> +-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
>>> +-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
>>> ++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
>>> ++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
>>> + 	
>>> + 	while ((dp = readdir (dir)) != NULL) {
>>> + 		char * dot = strrchr(dp->d_name, '.');
>>> diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest
>>> new file mode 100644
>>> index 0000000..d0ca8d9
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest
>>> @@ -0,0 +1,11 @@
>>> +#!/bin/sh
>>> +
>>> +if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
>>> +        echo "Couldn't load kernel module sctp."
>>> +        echo "Test cases testsctp and testcnx will fail."
>>> +        echo
>>> +fi
>>> +
>>> +export EXTENSIONS_DIR=$EXTENSIONS_DIR
>>> +cmake  -E cmake_echo_color --cyan "Running tests..."
>>> +ctest --force-new-ctest-process
>>> diff --git a/meta-networking/recipes-protocols/freediameter/freediameter.inc b/meta-networking/recipes-protocols/freediameter/freediameter.inc
>>> new file mode 100644
>>> index 0000000..6880d26
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/freediameter.inc
>>> @@ -0,0 +1,98 @@
>>> +SUMMARY = "An open source implementation of the diameter protocol"
>>> +DESCRIPTION = "\
>>> +freeDiameter is an open source Diameter protocol implementation. It \
>>> +provides an extensible platform for deploying a Diameter network for \
>>> +your Authentication, Authorization and Accounting needs."
>>> +
>>> +HOMEPAGE = "http://www.freediameter.net"
>>> +
>>> +DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
>>> +
>>> +pkgname = "freeDiameter"
>>> +
>>> +SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
>>> +           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
>>> +           file://freediameter.service \
>>> +           file://freediameter.init \
>>> +           \
>>> +           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
>>> +           'file://install_test.patch \
>>> +            file://run-ptest \
>>> +            file://pass-ptest-env.patch', '', d)} \
>>> +           "
>>> +
>>> +S = "${WORKDIR}/${pkgname}-${PV}"
>>> +
>>> +PTEST_PATH = "${libdir}/${pkgname}/ptest"
>>> +
>>> +inherit cmake update-rc.d ptest systemd
>>> +
>>> +EXTRA_OECMAKE = " \
>>> +    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
>>> +    -DBUILD_DBG_MONITOR:BOOL=ON  \
>>> +    -DBUILD_TEST_APP:BOOL=ON \
>>> +    -DBUILD_TESTING:BOOL=ON \
>>> +    -DBUILD_APP_RADGW:BOOL=ON \
>>> +    -DBUILD_APP_REDIRECT:BOOL=ON \
>>> +    -DBUILD_TEST_ACCT:BOOL=ON \
>>> +    -DBUILD_TEST_NETEMUL:BOOL=ON \
>>> +    -DBUILD_TEST_RT_ANY:BOOL=ON \
>>> +    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
>>> +    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
>>> +    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
>>> +    -DCMAKE_SKIP_RPATH:BOOL=ON \
>>> +"
>>> +# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
>>> +# specify it on cmd line will fix the SET bug in CMakeList.txt
>>> +
>>> +# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
>>> +
>>> +# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
>>> +# These need MySQL support
>>> +
>>> +# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
>>> +
>>> +# -DALL_EXTENSIONS=ON will enable all
>>> +
>>> +do_install_append() {
>>> +    # install the sample configuration file
>>> +    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
>>> +    for i in ${S}/doc/*.conf.sample; do
>>> +        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
>>> +    done
>>> +    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
>>> +      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
>>> +
>>> +    # install daemon init related files
>>> +    install -d -m 0755 ${D}${sysconfdir}/default
>>> +    install -d -m 0755 ${D}${sysconfdir}/init.d
>>> +    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
>>> +      ${D}${sysconfdir}/default/${BPN}
>>> +    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
>>> +
>>> +    # install for systemd
>>> +    install -d ${D}${systemd_system_unitdir}
>>> +    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
>>> +    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
>>> +}
>>> +
>>> +do_install_ptest() {
>>> +    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
>>> +    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
>>> +    rmdir ${D}${PTEST_PATH}-tests
>>> +    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
>>> +}
>>> +
>>> +FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
>>> +
>>> +# include the extensions in main package
>>> +FILES_${PN} += "${libdir}/${pkgname}/*"
>>> +
>>> +RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
>>> +RDEPENDS_${PN}-ptest = "cmake"
>>> +
>>> +INITSCRIPT_NAME = "${BPN}"
>>> +INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
>>> +
>>> +SYSTEMD_SERVICE_${PN} = "freediameter.service"
>>> +SYSTEMD_AUTO_ENABLE = "disable"
>>> diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
>>> new file mode 100644
>>> index 0000000..3fb929a
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
>>> @@ -0,0 +1,7 @@
>>> +include freediameter.inc
>>> +
>>> +LICENSE = "BSD"
>>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
>>> +
>>> +SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
>>> +SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist
  2017-10-31 13:29     ` Joe MacDonald
@ 2017-10-31 19:10       ` Khem Raj
  0 siblings, 0 replies; 16+ messages in thread
From: Khem Raj @ 2017-10-31 19:10 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: openembeded-devel

On Tue, Oct 31, 2017 at 6:29 AM Joe MacDonald <Joe_MacDonald@mentor.com>
wrote:

> [Re: [oe] [meta-networking][PATCH 2/6] lksctp-tools: update and remove
> from blacklist] On 17.10.30 (Mon 16:21) Khem Raj wrote:
>
> > On Mon, Oct 30, 2017 at 11:11 AM, Joe MacDonald
> > <joe_macdonald@mentor.com> wrote:
> > > Switching lksctp-tools to build from the upstream git repository rather
> > > than a source tarball.  At the same time we'll un-blacklist it since it
> > > appears the gold-as-ld issue has been resolved underneath us, probably
> > > related to a Debian bug of the same form that was also resolved with a
> > > binutils update.
> > >
> > > Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> > > ---
> > >  .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16
> +++++-----------
> > >  1 file changed, 5 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/meta-networking/recipes-support/lksctp-tools/
> lksctp-tools_1.0.17.bb b/meta-networking/recipes-support/lksctp-tools/
> lksctp-tools_1.0.17.bb
> > > index 11c43ff..9166aa5 100644
> > > --- a/meta-networking/recipes-support/lksctp-tools/
> lksctp-tools_1.0.17.bb
> > > +++ b/meta-networking/recipes-support/lksctp-tools/
> lksctp-tools_1.0.17.bb
> > > @@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
> > >      file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
> > >  "
> > >
> > > -SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
> > > +SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
> > > +
> >
> > perhaps we need to reflect it in PV as well.
> >
> > PV .= "+git${SRCPV}"
>
> I was less inclined to decorate the PV with the git hash since the
> SRCREV points at the release tag for 1.0.17, but I suppose if upstream
> chose to move the tag then this would be out of sync, so it's worth it.
>

I know they don’t look pretty but the information is useful

>
> -J.
>
> >
> > > +SRC_URI = " \
> > > +    git://github.com/sctp/lksctp-tools.git \
> > >      file://run-ptest \
> > >      file://v4test.sh \
> > >      file://v6test.sh \
> > >  "
> > >
> > > -SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
> > > -SRC_URI[sha256sum] =
> "1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"
> > > -
> > > -#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc
> -march=armv5te -marm -mthumb-interwork
> --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm
> -shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o
> .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o
> -march=armv5te -marm -mthumb-interwork
> --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2
> -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map
> -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1
> -o .libs/libsctp.so.1.0.16
> > > -#|
> /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld:
> error: symbol sctp_connectx has undefined version
> > > -#| collect2: error: ld returned 1 exit status
> > > -#| make[4]: *** [libsctp.la] Error 1
> > > -PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES',
> 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"
> > > -
> > > -S = "${WORKDIR}/${BP}"
> > > +S = "${WORKDIR}/git"
> > >
> > >  BBCLASSEXTEND = "native"
> > >
> > > --
> > > 2.7.4
> > >
> > > --
> > > _______________________________________________
> > > Openembedded-devel mailing list
> > > Openembedded-devel@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
> --
> -Joe MacDonald.
> :wq
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-10-31 19:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 18:11 [meta-networking][PATCH 0/6] meta-networking patchwork cleanup Joe MacDonald
2017-10-30 18:11 ` [meta-networking][PATCH 1/6] ddclient: new package Joe MacDonald
2017-10-30 23:14   ` Khem Raj
2017-10-31 13:35     ` Joe MacDonald
2017-10-30 18:11 ` [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist Joe MacDonald
2017-10-30 23:21   ` Khem Raj
2017-10-31 13:29     ` Joe MacDonald
2017-10-31 19:10       ` Khem Raj
2017-10-30 18:11 ` [meta-networking][PATCH 3/6] freediameter: add new recipe Joe MacDonald
2017-10-30 23:25   ` Khem Raj
2017-10-31  0:47   ` akuster808
2017-10-31 13:21     ` Joe MacDonald
2017-10-31 15:46       ` akuster808
2017-10-30 18:11 ` [meta-networking][PATCH 4/6] net-snmp: support openssl without 3des Joe MacDonald
2017-10-30 18:11 ` [meta-networking][PATCH 5/6] stunnel: fix compile error when openssl disable des support Joe MacDonald
2017-10-30 18:11 ` [meta-networking][PATCH 6/6] bridge-utils: update to v1.6 Joe MacDonald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.