Skip to contentSkip to conversation

Clean up connman-conf

RFC PATCH New Joshua Lock 1 participant 3 messages Oct 14, 2015

lore
Share & tools
lore
#0 lore raw

cover Clean up connman-conf

As reported in YP#8399[1] we currently hack the connman service to try and execute a script which is only installed on qemu targets. This pair of patches changes the connman-conf recipe to install a oneshot systemd unit that is called before ConnMan, removes the ExecStartPre and adds an override to the RRECOMMENDS so that the connman-conf is only installed by default for qemu machines and images for other machines are left with an error in the journal about failing to start a service.

Please review the following changes for suitability for inclusion. If you have any objections or suggestions for improvement, please respond to the patches. If you agree with the changes, please provide your Acked-by.

Regards,

Joshua

1. https://bugzilla.yoctoproject.org/show_bug.cgi?id=8399

The following changes since commit e42d8eff9eed7d1454b4f331d96dcee6dea232df:

bash: Disable custom memory allocator (2015-10-12 14:35:42 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib joshuagl/connman
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=joshuagl/connman

Joshua Lock (2):
connman-conf: convert to systemd oneshot
connman: tidy up connman-conf usage

 meta/recipes-connectivity/connman/connman-conf.bb           | 13 +++++++++++--
 .../connman/connman-conf/qemuall/wired-connection.service   | 10 ++++++++++
 meta/recipes-connectivity/connman/connman.inc               |  5 -----
 meta/recipes-connectivity/connman/connman_1.30.bb           |  2 +-
 4 files changed, 22 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
Signature · 1 line
2.1.4
#1 lore raw

RFC PATCH 1/2 connman-conf: convert to systemd oneshot

Install a oneshot unit file that is started before ConnMan to configure a wired network inteface with the wired-setup script rather than requiring this script to be manually run some how.

---
 meta/recipes-connectivity/connman/connman-conf.bb           | 13 +++++++++++--
 .../connman/connman-conf/qemuall/wired-connection.service   | 10 ++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
meta/recipes-connectivity/connman/connman-conf.bb +11 -2
index bd4c28d..5e3aac5 100644
@@ -4,9 +4,12 @@ network interface for a qemu machine."
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
+inherit systemd
+
 SRC_URI_append_qemuall = " file://wired.config \
                            file://wired-setup \
-"
+                           file://wired-connection.service \
+                         "
 PR = "r2"
 
 S = "${WORKDIR}"
@@ -17,10 +20,16 @@ FILES_${PN} = "${localstatedir}/* ${libdir}/*"
 
 do_install() {
     #Configure Wired network interface in case of qemu* machines
-    if test -e ${WORKDIR}/wired.config && test -e ${WORKDIR}/wired-setup; then
+    if test -e ${WORKDIR}/wired.config &&
+       test -e ${WORKDIR}/wired-setup &&
+       test -e ${WORKDIR}/wired-connection.service; then
         install -d ${D}${localstatedir}/lib/connman
         install -m 0644 ${WORKDIR}/wired.config ${D}${localstatedir}/lib/connman
         install -d ${D}${libdir}/connman
         install -m 0755 ${WORKDIR}/wired-setup ${D}${libdir}/connman
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0755 ${WORKDIR}/wired-connection.service ${D}${systemd_unitdir}/system
     fi
 }
+
+SYSTEMD_SERVICE_${PN} = "wired-connection.service"
meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service new file +10 -0
new file mode 100644
index 0000000..f66d158a
@@ -0,0 +1,10 @@
+[Unit]
+Description=Setup wired interface on qemu machines
+Before=connman.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/connman/wired-setup
+
+[Install]
+WantedBy=network.target
Signature · 1 line
2.1.4
#2 lore raw

RFC PATCH 2/2 connman: tidy up connman-conf usage

In reply to Joshua Lock

connman-conf is now a systemd oneshot so need not be sed'ed in to the ConnMan service file.

Furthermore add connman-conf as RRECCOMENDS only for qemu machines.

This cleans up connman-conf so that it is not automatically installed and unconditionally calling a script that doesn't exist for most machines.

[YOCTO #8399]

---
 meta/recipes-connectivity/connman/connman.inc     | 5 -----
 meta/recipes-connectivity/connman/connman_1.30.bb | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)
meta/recipes-connectivity/connman/connman.inc +0 -5
index ab7f86d..c5b58ac 100644
@@ -68,11 +68,6 @@ python __anonymous () {
 
 SYSTEMD_SERVICE_${PN} = "connman.service"
 SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
-SYSTEMD_WIRED_SETUP = "ExecStartPre=-${libdir}/connman/wired-setup"
-
-do_compile_append() {
-	sed -i "s#ExecStart=#${SYSTEMD_WIRED_SETUP}\nExecStart=#" ${B}/src/connman.service
-}
 
 do_install_append() {
 	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
meta/recipes-connectivity/connman/connman_1.30.bb +1 -1
index 7d65ac9..87cf213 100644
@@ -10,5 +10,5 @@ SRC_URI  = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
 SRC_URI[md5sum] = "4a3efdbd6796922db9c6f66da57887fa"
 SRC_URI[sha256sum] = "5c5e464bacc9c27ed4e7269fb9b5059f07947f5be26433b59212133663ffa991"
 
-RRECOMMENDS_${PN} = "connman-conf"
+RRECOMMENDS_${PN}_qemuall = "connman-conf"
 
Signature · 1 line
2.1.4