Skip to contentSkip to conversation

avahi: reorder codes and fix error

PATCH New Chen Qi 1 participant 3 messages Jun 21, 2018

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover avahi: reorder codes and fix error

The following changes since commit 53dfa673d78216f852a47bdb48392ee213e3e1cd:

musl: Upgrade to latest (2018-06-18 11:07:58 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/avahi-fix
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/avahi-fix

Chen Qi (2):
avahi: reorganize codes
avahi: fix error at boot time for avahi-daemon.service

 meta/recipes-connectivity/avahi/avahi-ui_0.7.bb    | 16 +----
 meta/recipes-connectivity/avahi/avahi.inc          | 84 +++-------------------
 meta/recipes-connectivity/avahi/avahi_0.7.bb       | 84 ++++++++++++++++++----
 .../0001-Fix-opening-etc-resolv.conf-error.patch   | 40 +++++++++++
 4 files changed, 124 insertions(+), 100 deletions(-)
 create mode 100644 meta/recipes-connectivity/avahi/files/0001-Fix-opening-etc-resolv.conf-error.patch
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/2 avahi: reorganize codes

This patch does nothing but reorganizing codes.

avahi.inc is shared by avahi and avahi-ui recipes. Move common things into it, and move uncommon things out of it.

---
 meta/recipes-connectivity/avahi/avahi-ui_0.7.bb | 16 +----
 meta/recipes-connectivity/avahi/avahi.inc       | 84 ++++---------------------
 meta/recipes-connectivity/avahi/avahi_0.7.bb    | 83 ++++++++++++++++++++----
 3 files changed, 83 insertions(+), 100 deletions(-)
meta/recipes-connectivity/avahi/avahi-ui_0.7.bb +1 -15
index 5648e38..a77653b 100644
@@ -1,31 +1,18 @@
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
-                    file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
-                    file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
-                    file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
-                    file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
-
 require avahi.inc
 
 inherit distro_features_check
 ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
 
-SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6"
-SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804"
-
 DEPENDS += "avahi"
 
 AVAHI_GTK = "gtk3"
 
 S = "${WORKDIR}/avahi-${PV}"
 
-PACKAGES = "${PN} ${PN}-utils ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc avahi-discover"
+PACKAGES += "${PN}-utils avahi-discover"
 
 FILES_${PN} = "${libdir}/libavahi-ui*.so.*"
-FILES_${PN}-dev += "${libdir}/libavahi-ui${SOLIBSDEV}"
-FILES_${PN}-staticdev += "${libdir}/libavahi-ui.a"
-
 FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*"
-
 FILES_avahi-discover = "${datadir}/applications/avahi-discover.desktop \
                         ${datadir}/avahi/interfaces/avahi-discover.ui \
                         ${bindir}/avahi-discover-standalone \
@@ -59,4 +46,3 @@ do_install_append () {
         rm ${D}${libdir}/girepository-1.0/ -rf
         rm ${D}${datadir}/gir-1.0/ -rf
 }
-
meta/recipes-connectivity/avahi/avahi.inc +11 -73

111 lines not on this page · raw message

meta/recipes-connectivity/avahi/avahi_0.7.bb +71 -12

91 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 2/2 avahi: fix error at boot time for avahi-daemon.service

In reply to Chen Qi

The following error messages appear now and then at boot time.

avahi-daemon/chroot.c: open() failed: No such file or directory Failed to open /etc/resolv.conf: Invalid argument

The problem is about /etc/resolv.conf. In Yocto's systemd based systems, it's a symlink to /etc/resolv-conf.systemd which in turn is a symlink to /run/systemd/resolve/resolv.conf. The systemd-resolved service handles creation of /run/systemd/resolve/resolv.conf file.

So if avahi-daemon is started before systemd-resolved, the error messages appear.

Fix this problem by making avahi-daemon start after systemd-resolved.

---
 meta/recipes-connectivity/avahi/avahi_0.7.bb       |  1 +
 .../0001-Fix-opening-etc-resolv.conf-error.patch   | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-connectivity/avahi/files/0001-Fix-opening-etc-resolv.conf-error.patch
meta/recipes-connectivity/avahi/avahi_0.7.bb +1 -0
index b695be9..3d5f334 100644
@@ -3,6 +3,7 @@ require avahi.inc
 SRC_URI += "file://00avahi-autoipd \
            file://99avahi-autoipd \
            file://initscript.patch \
+           file://0001-Fix-opening-etc-resolv.conf-error.patch \
            "
 
 inherit update-rc.d systemd useradd
meta/recipes-connectivity/avahi/files/0001-Fix-opening-etc-resolv.conf-error.patch new file +40 -0
new file mode 100644
index 0000000..11e7e8a
@@ -0,0 +1,40 @@
+From 78967814f5c37ed67f4cf64d70c9f76a03ee89bc Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Wed, 20 Jun 2018 13:57:35 +0800
+Subject: [PATCH] Fix opening /etc/resolv.conf error
+
+Fix to start avahi-daemon after systemd-resolved.service. This is because
+/etc/resolv.conf is a link to /etc/resolv-conf.systemd which in turn is
+a symlink to /run/systemd/resolve/resolv.conf. And /run/systemd/resolve/resolv.conf
+is created by systemd-resolved.service by default in current OE's systemd
+based systems.
+
+This fixes errro like below.
+
+  Failed to open /etc/resolv.conf: Invalid argument
+
+In fact, handling of /etc/resolv.conf is quite distro specific. So this patch
+is marked as OE specific.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ avahi-daemon/avahi-daemon.service.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/avahi-daemon/avahi-daemon.service.in b/avahi-daemon/avahi-daemon.service.in
+index 548c834..63e28e4 100644
+--- a/avahi-daemon/avahi-daemon.service.in
++++ b/avahi-daemon/avahi-daemon.service.in
+@@ -18,6 +18,7 @@
+ [Unit]
+ Description=Avahi mDNS/DNS-SD Stack
+ Requires=avahi-daemon.socket
++After=systemd-resolved.service
+ 
+ [Service]
+ Type=dbus
+-- 
+2.11.0
+
Signature · 1 line
1.9.1