summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-oe/recipes-connectivity/umip
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-connectivity/umip')
-rw-r--r--meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-Add-format-string-to-fprintf-call.patch26
-rw-r--r--meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch49
-rw-r--r--meta-openembedded/meta-oe/recipes-connectivity/umip/files/0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch143
-rw-r--r--meta-openembedded/meta-oe/recipes-connectivity/umip/files/add-dependency-to-support-parallel-compilation.patch23
-rwxr-xr-xmeta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d112
-rw-r--r--meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d.service10
-rw-r--r--meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb42
7 files changed, 405 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-Add-format-string-to-fprintf-call.patch b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-Add-format-string-to-fprintf-call.patch
new file mode 100644
index 000000000..8e5f4da36
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-Add-format-string-to-fprintf-call.patch
@@ -0,0 +1,26 @@
+From a0ad5128d14b022239445e251cf4a9826e86aa96 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 07:48:31 -0700
+Subject: [PATCH] Add format string to fprintf() call
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/vt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/vt.c b/src/vt.c
+index 795d393..a533d3d 100644
+--- a/src/vt.c
++++ b/src/vt.c
+@@ -499,7 +499,7 @@ static int vt_cmd_dump_candidates(const struct vt_handle *vh,
+ }
+ llen += cmdlen;
+
+- ret = fprintf(vh->vh_stream, e->cmd);
++ ret = fprintf(vh->vh_stream, "%s", e->cmd);
+ if (ret < 0)
+ return ret;
+
+--
+2.13.2
+
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch
new file mode 100644
index 000000000..8192056d1
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch
@@ -0,0 +1,49 @@
+From f567740cf64978ac9db014c786b6d0267b244f33 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 4 Mar 2018 22:30:30 -0800
+Subject: [PATCH 1/2] replace SIGCLD with SIGCHLD and include sys/types.h
+
+Fixes
+main.c:129:10: error: 'SIGCLD' undeclared (first use in this function); did you mean 'SIGCHLD'?
+ signal(SIGCLD, sig_child);
+ ^~~~~~
+ SIGCHLD
+
+main.c:125:2: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration]
+ umask(0);
+ ^~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/main.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index 3cf4072..cd34196 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -31,6 +31,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/wait.h>
+ #include <sys/param.h>
++#include <sys/types.h>
+ #include <pthread.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -126,9 +127,9 @@ static void daemon_start(int ignsigcld)
+
+ if (ignsigcld) {
+ #ifdef SIGTSTP
+- signal(SIGCLD, sig_child);
++ signal(SIGCHLD, sig_child);
+ #else
+- signal(SIGCLD, SIG_IGN);
++ signal(SIGCHLD, SIG_IGN);
+ #endif
+ }
+ }
+--
+2.16.2
+
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch
new file mode 100644
index 000000000..90d12da14
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch
@@ -0,0 +1,143 @@
+From 19b6cf8099e1974b5fc39086fc54103b0cbc2658 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 4 Mar 2018 23:01:25 -0800
+Subject: [PATCH 2/2] replace PTHREAD_MUTEX_FAST_NP with PTHREAD_MUTEX_NORMAL
+
+PTHREAD_MUTEX_FAST_NP is not available on non-posix systems
+e.g. musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/ha.c | 2 +-
+ src/icmp6.c | 2 +-
+ src/mh.c | 2 +-
+ src/mn.c | 2 +-
+ src/movement.c | 2 +-
+ src/mpdisc_ha.c | 2 +-
+ src/mpdisc_mn.c | 2 +-
+ src/tqueue.c | 2 +-
+ src/tunnelctl.c | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/ha.c b/src/ha.c
+index fbdcff0..b2f811e 100644
+--- a/src/ha.c
++++ b/src/ha.c
+@@ -1246,7 +1246,7 @@ int ha_init(void)
+ {
+ pthread_mutexattr_t mattrs;
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&bu_worker_mutex, &mattrs) ||
+ pthread_cond_init(&cond, NULL))
+ return -1;
+diff --git a/src/icmp6.c b/src/icmp6.c
+index 3695135..6460634 100644
+--- a/src/icmp6.c
++++ b/src/icmp6.c
+@@ -243,7 +243,7 @@ int icmp6_init(void)
+ return -1;
+ /* create ICMP listener thread */
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&icmp6_sock.send_mutex, &mattrs) ||
+ pthread_rwlock_init(&handler_lock, NULL) ||
+ pthread_create(&icmp6_listener, NULL, icmp6_listen, NULL))
+diff --git a/src/mh.c b/src/mh.c
+index 60e345e..7928f4c 100644
+--- a/src/mh.c
++++ b/src/mh.c
+@@ -204,7 +204,7 @@ int mh_init(void)
+ return -1;
+
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&mh_sock.send_mutex, &mattrs) ||
+ pthread_rwlock_init(&handler_lock, NULL) ||
+ pthread_create(&mh_listener, NULL, mh_listen, NULL))
+diff --git a/src/mn.c b/src/mn.c
+index 092cfcb..8f7f448 100644
+--- a/src/mn.c
++++ b/src/mn.c
+@@ -1478,7 +1478,7 @@ static struct home_addr_info *hai_copy(struct home_addr_info *conf_hai)
+ if (hai != NULL) {
+ pthread_mutexattr_t mattrs;
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+
+ memcpy(hai, conf_hai, sizeof(struct home_addr_info));
+
+diff --git a/src/movement.c b/src/movement.c
+index d985937..6400448 100644
+--- a/src/movement.c
++++ b/src/movement.c
+@@ -2013,7 +2013,7 @@ int md_init(void)
+ int val;
+
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&iface_lock, &mattrs))
+ return -1;
+
+diff --git a/src/mpdisc_ha.c b/src/mpdisc_ha.c
+index 40ba05f..fd7a90d 100644
+--- a/src/mpdisc_ha.c
++++ b/src/mpdisc_ha.c
+@@ -559,7 +559,7 @@ int mpd_ha_init(void)
+ {
+ pthread_mutexattr_t mattrs;
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&mpa_lock, &mattrs) ||
+ pthread_rwlock_init(&prefix_lock, NULL) ||
+ hash_init(&mpa_hash, DOUBLE_ADDR, MPA_BUCKETS) < 0)
+diff --git a/src/mpdisc_mn.c b/src/mpdisc_mn.c
+index 4873bd6..ada02bd 100644
+--- a/src/mpdisc_mn.c
++++ b/src/mpdisc_mn.c
+@@ -267,7 +267,7 @@ int mpd_mn_init(void)
+ {
+ pthread_mutexattr_t mattrs;
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&mps_lock, &mattrs))
+ return -1;
+ if (hash_init(&mps_hash, DOUBLE_ADDR, MPS_BUCKETS) < 0)
+diff --git a/src/tqueue.c b/src/tqueue.c
+index 2f7aa0b..9c185b8 100644
+--- a/src/tqueue.c
++++ b/src/tqueue.c
+@@ -65,7 +65,7 @@ int taskqueue_init(void)
+ {
+ pthread_mutexattr_t mattrs;
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&mutex, &mattrs) ||
+ pthread_cond_init(&cond, NULL) ||
+ pthread_create(&tq_runner, NULL, runner, NULL))
+diff --git a/src/tunnelctl.c b/src/tunnelctl.c
+index 23fc20b..813b8ec 100644
+--- a/src/tunnelctl.c
++++ b/src/tunnelctl.c
+@@ -433,7 +433,7 @@ int tunnelctl_init(void)
+ return -1;
+
+ pthread_mutexattr_init(&mattrs);
+- pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP);
++ pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL);
+ if (pthread_mutex_init(&tnl_lock, &mattrs))
+ return -1;
+
+--
+2.16.2
+
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/umip/files/add-dependency-to-support-parallel-compilation.patch b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/add-dependency-to-support-parallel-compilation.patch
new file mode 100644
index 000000000..dbf008264
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/add-dependency-to-support-parallel-compilation.patch
@@ -0,0 +1,23 @@
+When "make -j10", the compilation will fail,
+because scan.c has included gram.h, but gram.h was produced
+after scan.c was compiled
+
+So add this dependency to ensure that gram.h is produced
+before scan.c is produced.
+
+Upstream-Status: Inappropriate [upstream is not active]
+
+Signed-off-by: Roy.Li <RongQing.Li@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -81,3 +81,5 @@ CLEANFILES = gram.c gram.h \
+
+ DISTCLEANFILES = $(BUILT_SOURCES)
+ MAINTAINERCLEANFILES = Makefile.in
++
++scan.c: gram.h
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d
new file mode 100755
index 000000000..ebd70a6cc
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# mip6d Start script for the Mobile IPv6 daemon
+#
+# chkconfig: - 55 25
+# description: The mobile IPv6 daemon allows nodes to remain \
+# reachable while moving around in the IPv6 Internet.
+# processname: mip6d
+# config: /etc/mip6d.conf
+# config: /etc/sysconfig/mip6d
+#
+### BEGIN INIT INFO
+# Provides: mipv6-daemon
+# Required-Start: $local_fs $remote_fs $network $named
+# Required-Stop: $local_fs $remote_fs $network
+# Should-Start: $syslog
+# Should-Stop: $network $syslog
+# Default-Start:
+# Default-Stop: 0 1 6
+# Short-Description: Start and stop Mobile IPV6 daemon
+# Description: The mobile IPv6 daemon allows nodes to remain
+# reachable while moving around in the IPv6 Internet.
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+if [ -f /etc/sysconfig/mip6d ]; then
+ . /etc/sysconfig/mip6d
+fi
+
+mip6d=/usr/sbin/mip6d
+prog="mip6d"
+lockfile=/var/lock/subsys/$prog
+
+start() {
+ [ -x $mip6d ] || exit 5
+ echo -n $"Starting $prog: "
+ start-stop-daemon -S -x ${mip6d} && success || failure
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch ${lockfile}
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ start-stop-daemon -K -x $mip6d
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f ${lockfile}
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+reload()
+{
+ echo -n $"Reloading $prog configuration: "
+ killproc $mip6d -HUP
+ retval=$?
+ echo
+ return $retval
+}
+
+force_reload() {
+ restart
+}
+
+rh_status() {
+ status $prog
+}
+
+rh_status_q() {
+ rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ $1
+ ;;
+ stop)
+ rh_status_q || exit 0
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ reload)
+ rh_status_q || exit 7
+ $1
+ ;;
+ force-reload)
+ force_reload
+ ;;
+ status)
+ rh_status
+ ;;
+ condrestart|try-restart)
+ rh_status_q || exit 0
+ restart
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ exit 2
+esac
+
+exit $?
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d.service b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d.service
new file mode 100644
index 000000000..2b5a5b9f1
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=MIPL Mobile IPv6
+After=network.target
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/mip6d
+ExecStart=@SBINDIR@/mip6d $ARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb b/meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb
new file mode 100644
index 000000000..0c120bfd8
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Mobile IPv6 and NEMO for Linux"
+DESCRIPTION = "UMIP is an open source implementation of Mobile IPv6 and NEMO \
+Basic Support for Linux. It is released under the GPLv2 license. It supports \
+the following IETF RFC: RFC6275 (Mobile IPv6), RFC3963 (NEMO), RFC3776 and \
+RFC4877 (IPsec and IKEv2)."
+HOMEPAGE = "http://umip.org/"
+SECTION = "System Environment/Base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=073dc31ccb2ebed70db54f1e8aeb4c33"
+DEPENDS = "rpm indent-native"
+
+SRC_URI = "git://github.com/jlanza/umip \
+ file://add-dependency-to-support-parallel-compilation.patch \
+ file://mip6d \
+ file://mip6d.service \
+ file://0001-Add-format-string-to-fprintf-call.patch \
+ file://0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch \
+ file://0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch \
+ "
+SRCREV = "7d67209cd1bba2dd0e183a0fa07eeef07964dd14"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--enable-vt"
+
+inherit autotools-brokensep systemd update-rc.d
+
+INITSCRIPT_NAME = "mip6d"
+INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "mip6d.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append() {
+ install -D -m 0755 ${WORKDIR}/mip6d ${D}${sysconfdir}/init.d/mip6d
+ install -D -m 0644 ${WORKDIR}/mip6d.service ${D}${systemd_system_unitdir}/mip6d.service
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_system_unitdir}/mip6d.service
+}
+
+RRECOMMENDS_${PN} = "kernel-module-mip6 kernel-module-ipv6"
OpenPOWER on IntegriCloud