summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2017-06-27 08:26:39 +0800
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-06-27 13:24:12 -0400
commite30aaeec269fa1b1b14898e7069c9b717b8c0458 (patch)
tree995184b41fed34f93926d6356a28db77dcd0839e
parent95013501dc2c78a8157912cebcd6fce0a8a0cc90 (diff)
downloadmeta-virtualization-e30aaeec269fa1b1b14898e7069c9b717b8c0458.tar.gz
diod: add new recipe
diod is a multi-threaded, user space file server that speaks 9P2000.L protocol. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-extended/diod/diod_1.0.24.bb32
-rw-r--r--recipes-extended/diod/files/0001-build-allow-builds-to-work-with-separate-build-dir.patch126
-rw-r--r--recipes-extended/diod/files/0002-auto.diod.in-remove-bashisms.patch47
-rw-r--r--recipes-extended/diod/files/diod75
-rw-r--r--recipes-extended/diod/files/diod.conf15
5 files changed, 295 insertions, 0 deletions
diff --git a/recipes-extended/diod/diod_1.0.24.bb b/recipes-extended/diod/diod_1.0.24.bb
new file mode 100644
index 00000000..a4d159ab
--- /dev/null
+++ b/recipes-extended/diod/diod_1.0.24.bb
@@ -0,0 +1,32 @@
1SUMMARY = "Diod is a user space server for the kernel v9fs client."
2DESCRIPTION = "\
3Diod is a user space server for the kernel v9fs client (9p.ko, 9pnet.ko). \
4Although the kernel client supports several 9P variants, diod only supports \
59P2000.L, and only in its feature-complete form, as it appeared in 2.6.38."
6SECTION = "console/network"
7
8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
10
11PV = "1.0.24+git${SRCPV}"
12SRCREV = "0ea3fe3d829b5085307cd27a512708d99ef48199"
13SRC_URI = "git://github.com/chaos/diod.git;protocol=git \
14 file://diod \
15 file://diod.conf \
16 file://0001-build-allow-builds-to-work-with-separate-build-dir.patch \
17 file://0002-auto.diod.in-remove-bashisms.patch \
18 "
19DEPENDS = "libcap ncurses tcp-wrappers lua"
20
21S = "${WORKDIR}/git"
22
23inherit autotools systemd
24
25do_install_append () {
26 # install our init based on start-stop-daemon
27 install -D -m 0755 ${WORKDIR}/diod ${D}${sysconfdir}/init.d/diod
28 # install a real(not commented) configuration file for diod
29 install -m 0644 ${WORKDIR}/diod.conf ${D}${sysconfdir}/diod.conf
30}
31
32FILES_${PN} += "${systemd_unitdir}"
diff --git a/recipes-extended/diod/files/0001-build-allow-builds-to-work-with-separate-build-dir.patch b/recipes-extended/diod/files/0001-build-allow-builds-to-work-with-separate-build-dir.patch
new file mode 100644
index 00000000..f40e0eb5
--- /dev/null
+++ b/recipes-extended/diod/files/0001-build-allow-builds-to-work-with-separate-build-dir.patch
@@ -0,0 +1,126 @@
1From 43403468298ef4167baa5d84de2ee2eaf7f4007a Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Fri, 9 Jan 2015 18:34:04 +0000
4Subject: [PATCH 1/2] build: allow builds to work with separate build dir
5
6Remove assumptions in include paths that assume the build
7is happening in the source directories.
8
9Upstream-Status: Inappropriate [embedded specific]
10
11Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
12---
13 diod/Makefile.am | 2 +-
14 libdiod/Makefile.am | 2 +-
15 liblsd/Makefile.am | 2 +-
16 libnpclient/Makefile.am | 2 +-
17 scripts/Makefile.am | 6 +++---
18 tests/kern/dbench/Makefile.am | 4 ++--
19 utils/Makefile.am | 2 +-
20 7 files changed, 10 insertions(+), 10 deletions(-)
21
22diff --git a/diod/Makefile.am b/diod/Makefile.am
23index 7644be7..fdaf130 100644
24--- a/diod/Makefile.am
25+++ b/diod/Makefile.am
26@@ -1,7 +1,7 @@
27 AM_CFLAGS = @GCCWARN@
28
29 AM_CPPFLAGS = \
30- -I../libnpfs -I../liblsd -I../libdiod
31+ -I$(srcdir)/../libnpfs -I$(srcdir)/../liblsd -I$(srcdir)/../libdiod
32
33 sbin_PROGRAMS = diod
34
35diff --git a/libdiod/Makefile.am b/libdiod/Makefile.am
36index 4810e14..6905cdd 100644
37--- a/libdiod/Makefile.am
38+++ b/libdiod/Makefile.am
39@@ -1,7 +1,7 @@
40 AM_CFLAGS = @GCCWARN@
41
42 AM_CPPFLAGS = \
43- -I../libnpfs -I../libnpclient -I../liblsd
44+ -I$(srcdir)/../libnpfs -I$(srcdir)/../libnpclient -I$(srcdir)/../liblsd
45
46 noinst_LIBRARIES = libdiod.a
47
48diff --git a/liblsd/Makefile.am b/liblsd/Makefile.am
49index c3e5658..7e18bf8 100644
50--- a/liblsd/Makefile.am
51+++ b/liblsd/Makefile.am
52@@ -1,6 +1,6 @@
53 AM_CFLAGS = @GCCWARN@
54
55-AM_CPPFLAGS = -I../libdiod
56+AM_CPPFLAGS = -I$(srcdir)/../libdiod
57
58 noinst_LIBRARIES = liblsd.a
59
60diff --git a/libnpclient/Makefile.am b/libnpclient/Makefile.am
61index 5305df9..cbaf266 100644
62--- a/libnpclient/Makefile.am
63+++ b/libnpclient/Makefile.am
64@@ -1,7 +1,7 @@
65 AM_CFLAGS = @GCCWARN@
66
67 AM_CPPFLAGS = \
68- -I../libnpfs
69+ -I$(srcdir)/../libnpfs
70
71 noinst_LIBRARIES = libnpclient.a
72
73diff --git a/scripts/Makefile.am b/scripts/Makefile.am
74index 51c24a3..2aba728 100644
75--- a/scripts/Makefile.am
76+++ b/scripts/Makefile.am
77@@ -1,9 +1,9 @@
78-systemddir=$(sysconfdir)/systemd/system
79+systemddir=/lib/systemd/system
80
81 install-data-local:
82- $(top_srcdir)/config/install-sh -m 755 $(srcdir)/auto.diod \
83+ $(top_srcdir)/config/install-sh -m 755 ./auto.diod \
84 $(DESTDIR)$(sysconfdir)/auto.diod
85- $(top_srcdir)/config/install-sh -m 755 $(srcdir)/diod.service \
86+ $(top_srcdir)/config/install-sh -m 644 ./diod.service \
87 $(DESTDIR)$(systemddir)/diod.service
88
89 uninstall-local:
90diff --git a/tests/kern/dbench/Makefile.am b/tests/kern/dbench/Makefile.am
91index e0cdefa..1704f9f 100644
92--- a/tests/kern/dbench/Makefile.am
93+++ b/tests/kern/dbench/Makefile.am
94@@ -2,7 +2,7 @@ AM_CFLAGS = -w
95
96 # VERSION=4.00
97
98-AM_CPPFLAGS = -DDATADIR=\"$(X_DATADIR)\"
99+AM_CPPFLAGS = -I. -DDATADIR=\"$(X_DATADIR)\"
100
101 LDADD = $(LIBPOPT)
102
103@@ -25,6 +25,6 @@ BUILT_SOURCES = proto.h
104 CLEANFILES = proto.h
105
106 proto.h: $(dbench_SOURCES) mkproto.pl
107- perl mkproto.pl $(dbench_SOURCES) > proto.h
108+ $(srcdir)/mkproto.pl $(patsubst %,$(srcdir),$(dbench_SOURCES)) > proto.h
109
110 EXTRA_DIST = mkproto.pl
111diff --git a/utils/Makefile.am b/utils/Makefile.am
112index 169b6c4..91d571d 100644
113--- a/utils/Makefile.am
114+++ b/utils/Makefile.am
115@@ -1,7 +1,7 @@
116 AM_CFLAGS = @GCCWARN@
117
118 AM_CPPFLAGS = \
119- -I../libnpfs -I../liblsd -I../libdiod -I../libnpclient
120+ -I$(srcdir)/../libnpfs -I$(srcdir)/../liblsd -I$(srcdir)/../libdiod -I$(srcdir)/../libnpclient
121
122 sbin_PROGRAMS = diodmount diodcat dtop diodload diodls diodshowmount dioddate
123
124--
1252.11.0
126
diff --git a/recipes-extended/diod/files/0002-auto.diod.in-remove-bashisms.patch b/recipes-extended/diod/files/0002-auto.diod.in-remove-bashisms.patch
new file mode 100644
index 00000000..65d6ff6b
--- /dev/null
+++ b/recipes-extended/diod/files/0002-auto.diod.in-remove-bashisms.patch
@@ -0,0 +1,47 @@
1From 5a9e09dc5de833db11607530351cd87cecbfd17e Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Thu, 22 Jun 2017 06:32:30 +0000
4Subject: [PATCH 2/2] auto.diod.in: remove bashisms
5
6Upstream-Status: Pending
7
8Signed-off-by: Roy Li <rongqing.li@windriver.com>
9---
10 scripts/auto.diod.in | 14 +++++++-------
11 1 file changed, 7 insertions(+), 7 deletions(-)
12
13diff --git a/scripts/auto.diod.in b/scripts/auto.diod.in
14index f63e004..4d5fc3a 100755
15--- a/scripts/auto.diod.in
16+++ b/scripts/auto.diod.in
17@@ -1,4 +1,4 @@
18-#!/bin/bash
19+#!/bin/sh
20 #
21 # auto.diod - executable automounter map for diod file systems
22 #
23@@ -41,15 +41,15 @@ dcatopts="${DIOD_TIMEOUT:+-t $DIOD_TIMEOUT}"
24 for server in $DIOD_SERVERS; do
25 $DIOD_DIODCAT -s $server $dcatopts exports | awk '{print $1}' |\
26 while read path; do
27- if [ "$path" == "/" ]; then
28- if [ "$key" == "ROOT" ]; then
29+ if [ "$path" = "/" ]; then
30+ if [ "$key" = "ROOT" ]; then
31 echo "$prefix $server:$path"
32 exit 0
33 fi
34- elif [ "$key" == "$(echo $path|sed -e's/^\///' -e's/\//./g')" ] \
35- || [ "$key" == "$(echo $path|sed -e's/^\///' -e's/\//_/g')" ] \
36- || [ "$key" == "$(echo $path|sed -e's/^\///' -e's/\//-/g')" ] \
37- || [ "$key" == "$(basename $path)" ]; then
38+ elif [ "$key" = "$(echo $path|sed -e's/^\///' -e's/\//./g')" ] \
39+ || [ "$key" = "$(echo $path|sed -e's/^\///' -e's/\//_/g')" ] \
40+ || [ "$key" = "$(echo $path|sed -e's/^\///' -e's/\//-/g')" ] \
41+ || [ "$key" = "$(basename $path)" ]; then
42 echo "$prefix $server:$path"
43 exit 0
44 fi
45--
462.11.0
47
diff --git a/recipes-extended/diod/files/diod b/recipes-extended/diod/files/diod
new file mode 100644
index 00000000..cd0bf987
--- /dev/null
+++ b/recipes-extended/diod/files/diod
@@ -0,0 +1,75 @@
1#!/bin/sh
2#
3# chkconfig: 35 20 80
4# description: Distributed Input Output Daemon
5#
6
7# Get function from functions library
8. /etc/init.d/functions
9
10BASE=diod
11PIDFILE=/var/run/$BASE.pid
12PID=`test -f $PIDFILE && cat $PIDFILE`
13DIOD_BIN=/usr/sbin/$BASE
14DIOD_CONF=/etc/$BASE.conf
15DIOD_OPTS="-c $DIOD_CONF"
16DIOD="$DIOD_BIN $DIOD_OPTS"
17RETVAL=0
18
19# Start the service $BASE
20start()
21{
22 # Force creation of the log directory even on a tmpfs /var/log.
23 mkdir -p /var/log/diod
24
25 start-stop-daemon --stop --test --quiet --pidfile $PIDFILE
26 status=$?
27 if [ $status -eq 0 ]; then
28 echo "diod service is already running with pid $PID"
29 exit 1
30 else
31 echo -n "Starting $BASE:"
32 start-stop-daemon --start --pidfile $PIDFILE \
33 --exec $DIOD_BIN -- $DIOD_OPTS
34 RETVAL=$?
35 echo
36 [ $RETVAL -ne 0 ] && exit $RETVAL
37 fi
38}
39
40# Stop the service $BASE
41stop()
42{
43 echo -n "Stopping $BASE:"
44 start-stop-daemon --stop --test --quiet --pidfile $PIDFILE
45 status=$?
46 if [ $status -eq 0 ]; then
47 start-stop-daemon --stop --quiet --pidfile $PIDFILE
48 [ -w $PIDFILE ] && rm -f $PIDFILE
49 else
50 start-stop-daemon --stop --quiet --name $BASE
51 fi
52}
53
54
55### service arguments ###
56case $1 in
57 start)
58 start
59 ;;
60 stop)
61 stop
62 ;;
63 status)
64 status $BASE
65 ;;
66 restart | force-reload)
67 $0 stop
68 $0 start
69 ;;
70 *)
71 echo "Usage: $0 {start|stop|status|restart}."
72 exit 1
73esac
74
75exit 0
diff --git a/recipes-extended/diod/files/diod.conf b/recipes-extended/diod/files/diod.conf
new file mode 100644
index 00000000..e97743a0
--- /dev/null
+++ b/recipes-extended/diod/files/diod.conf
@@ -0,0 +1,15 @@
1--
2-- /etc/diod.conf - config file for diod distributed I/O daemon
3--
4-- NOTE: This config file is a lua script that diod runs, then extracts
5-- the value of certain globally defined variables. See diod.conf(5).
6
7listen = { "0.0.0.0:564" }
8nwthreads = 16
9auth_required = 1
10logdest = "syslog:daemon:err"
11
12exports = { "/g/g0", "/g/g10" }
13
14allsquash = 0
15squashuser = "nobody"