summaryrefslogtreecommitdiffstats
path: root/meta-iot/recipes-connectivity/avahi
diff options
context:
space:
mode:
Diffstat (limited to 'meta-iot/recipes-connectivity/avahi')
-rw-r--r--meta-iot/recipes-connectivity/avahi/avahi-daemon-init.bb31
-rw-r--r--meta-iot/recipes-connectivity/avahi/avahi-daemon-init/LICENSE.avahi-daemon-init9
-rwxr-xr-xmeta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh20
-rw-r--r--meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init.service12
-rw-r--r--meta-iot/recipes-connectivity/avahi/avahi_0.6.31.bbappend10
5 files changed, 82 insertions, 0 deletions
diff --git a/meta-iot/recipes-connectivity/avahi/avahi-daemon-init.bb b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init.bb
new file mode 100644
index 0000000..767ba18
--- /dev/null
+++ b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init.bb
@@ -0,0 +1,31 @@
1SUMMARY = "Initialization service for Avahi daemon"
2DESCRIPTION = "Initializes Avahi daemon service."
3
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE.avahi-daemon-init;md5=2fe93140f8c4e56b56fbcd64730767a4"
6
7FILESEXTRAPATHS := "${THISDIR}/${PN}"
8SRC_URI = "\
9 file://avahi-daemon-init-settings.sh \
10 file://avahi-daemon-init.service \
11 file://LICENSE.avahi-daemon-init \
12"
13
14S = "${WORKDIR}"
15PR = "r2"
16
17inherit systemd
18SYSTEMD_PACKAGES = "${PN}"
19SYSTEMD_SERVICE_${PN} = " avahi-daemon-init.service"
20
21FILES_${PN} = "\
22 avahi-daemon-init.service \
23 ${bindir}/avahi-daemon-init-settings.sh \
24"
25
26do_install() {
27 install -d ${D}${bindir}
28 install -d ${D}${systemd_unitdir}/system
29 install -m 0755 ${WORKDIR}/avahi-daemon-init-settings.sh ${D}${bindir}/
30 install -m 0755 ${WORKDIR}/avahi-daemon-init.service ${D}${systemd_unitdir}/system
31}
diff --git a/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/LICENSE.avahi-daemon-init b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/LICENSE.avahi-daemon-init
new file mode 100644
index 0000000..0388698
--- /dev/null
+++ b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/LICENSE.avahi-daemon-init
@@ -0,0 +1,9 @@
1# LICENSE
2
3[MIT](http://en.wikipedia.org/wiki/MIT_License) license. Freely have you received, freely give.
4
5Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
7The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
9THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh
new file mode 100755
index 0000000..3a12e9c
--- /dev/null
+++ b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3KERNEL_VERSION=`uname -r | cut -d . -f 1-2`
4MAJOR=`echo $KERNEL_VERSION | cut -d . -f 1`
5MINOR=`echo $KERNEL_VERSION | cut -d . -f 2`
6
7if [ "${MAJOR}.`printf '%02d' $MINOR`" \< "3.09" ]; then
8 # avahi might not start because SO_REUSEPORT might be missing during
9 # runtime. The symbol is only available from kernel 3.9 onwards.
10 AVAHI_CONF=/etc/avahi/avahi-daemon.conf
11 if [ -f $AVAHI_CONF ]; then
12 sed -i -e "s|^#disallow-other-stacks=.*|disallow-other-stacks=yes|" $AVAHI_CONF
13 else
14 echo "[server]" > $AVAHI_CONF
15 echo "disallow-other-stacks=yes" >> $AVAHI_CONF
16 fi
17fi
18
19exit 0
20
diff --git a/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init.service b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init.service
new file mode 100644
index 0000000..78b3ab3
--- /dev/null
+++ b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=Initialize avahi-daemon settings
3After=syslog.target
4Before=avahi-daemon.service
5
6[Service]
7Type=oneshot
8ExecStart=-/usr/bin/avahi-daemon-init-settings.sh
9StandardOutput=null
10
11[Install]
12WantedBy=steward.service
diff --git a/meta-iot/recipes-connectivity/avahi/avahi_0.6.31.bbappend b/meta-iot/recipes-connectivity/avahi/avahi_0.6.31.bbappend
new file mode 100644
index 0000000..bff31b6
--- /dev/null
+++ b/meta-iot/recipes-connectivity/avahi/avahi_0.6.31.bbappend
@@ -0,0 +1,10 @@
1# TheThingSystem steward needs avahi compat headers
2EXTRA_OECONF += "\
3 --enable-compat-libdns_sd \
4"
5
6# node.js npm needs dns_sd.h but it's components do not search
7# the header from correct place
8do_install_append() {
9 cp ${D}/usr/include/avahi-compat-libdns_sd/dns_sd.h ${D}/usr/include/dns_sd.h
10}