Skip to contentSkip to conversation

Clean up connman-conf

PATCH Superseded Joshua Lock 2 participants 6 messages Dec 2, 2015 – Dec 3, 2015

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Clean up connman-conf

s 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.

Since the initial RFC submission I've:
* rebased on master
* changed connman-conf to be an allarch recipe
* updated to use the new systemd_system_unitdir variable

Regards,

Joshua

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

The following changes since commit 03f15e51998a3ef65a5b68cb7cbf724f4388c289:

sstate: Ensure siginfo and sig files are also touched (2015-11-25 08:09:00 +0000)

are available in the git repository at:

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

Joshua Lock (3):
connman-conf: convert to systemd oneshot
connman-conf: mark as allarch and not requiring default deps
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           |  3 +--
 4 files changed, 22 insertions(+), 9 deletions(-)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service

--
2.4.3

#1 lore raw

PATCH 1/3 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              |  9 ++++++++-
 .../connman/connman-conf/qemuall/wired-connection.service      | 10 ++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
meta/recipes-connectivity/connman/connman-conf.bb +8 -1
index 9254ed7..bef9237 100644
@@ -4,8 +4,11 @@ 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"
 
@@ -17,10 +20,14 @@ FILES_${PN} = "${localstatedir}/* ${datadir}/*"
 
 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}${datadir}/connman
         install -m 0755 ${WORKDIR}/wired-setup ${D}${datadir}/connman
+        install -d ${D}${systemd_system_unitdir}
+        install -m 0644 ${WORKDIR}/wired-connection.service ${D}${systemd_system_unitdir}
     fi
 }
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.4.3
#2 lore raw

PATCH 2/3 connman-conf: mark as allarch and not requiring default deps

In reply to Joshua Lock

This recipe just installs some data files and thus is architecture independent and doesn't require a compiler and libc in its DEPENDS.

---
 meta/recipes-connectivity/connman/connman-conf.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman-conf.bb +3 -1
index bef9237..1e119ad 100644
@@ -4,7 +4,9 @@ network interface for a qemu machine."
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
-inherit systemd
+inherit systemd allarch
+
+INHIBIT_DEFAULT_DEPS = "1"
 
 SRC_URI_append_qemuall = " file://wired.config \
                            file://wired-setup \
Signature · 1 line
2.4.3
#3 lore raw

Re: [PATCH 2/3] connman-conf: mark as allarch and not requiring default deps

Quoted 2 lines · Joshua Lock

This recipe just installs some data files and thus is architecture independent and doesn't require a compiler and libc in its DEPENDS.

allarch.bbclass already sets INHIBIT_DEFAULT_DEPS

Quoted 28 lines
---
 meta/recipes-connectivity/connman/connman-conf.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman-conf.bb +3 -1
index bef9237..1e119ad 100644
@@ -4,7 +4,9 @@ network interface for a qemu machine."
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
-inherit systemd
+inherit systemd allarch
+
+INHIBIT_DEFAULT_DEPS = "1"
 
 SRC_URI_append_qemuall = " file://wired.config \
                            file://wired-setup \
Signature · 7 lines
2.4.3

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#4 lore raw

Re: [PATCH 2/3] connman-conf: mark as allarch and not requiring default deps

Quoted 5 lines · Martin Jansa
Quoted 2 lines · Joshua Lock

This recipe just installs some data files and thus is architecture independent and doesn't require a compiler and libc in its DEPENDS.

allarch.bbclass already sets INHIBIT_DEFAULT_DEPS

Indeed it does, thanks — I'll send a v2.

Regards,

Joshua

Quoted 30 lines
Quoted 29 lines
---
  meta/recipes-connectivity/connman/connman-conf.bb | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-connectivity/connman/connman-conf.bb +3 -2
index bef9237..1e119ad 100644
@@ -4,7 +4,9 @@ network interface for a qemu machine."
  LICENSE = "GPLv2"
  LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
-inherit systemd
+inherit systemd allarch
+
+INHIBIT_DEFAULT_DEPS = "1"
 
  SRC_URI_append_qemuall = " file://wired.config \
                             file://wired-setup \
--

2.4.3

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#5 lore raw

PATCH 3/3 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.

Note: this doesn't affect sysvinit where we provide the ConnMan init script which checks for the presence of the wired-networking script and if it exists executes it as part of the connman init.

[YOCTO #8399]

---
 meta/recipes-connectivity/connman/connman.inc     | 5 -----
 meta/recipes-connectivity/connman/connman_1.30.bb | 3 +--
 2 files changed, 1 insertion(+), 7 deletions(-)
meta/recipes-connectivity/connman/connman.inc +0 -5
index 6324d7a..40880ad 100644
@@ -68,11 +68,6 @@ python __anonymous () {
 
 SYSTEMD_SERVICE_${PN} = "connman.service"
 SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
-SYSTEMD_WIRED_SETUP = "ExecStartPre=-${datadir}/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 -2
index 7d65ac9..7f7f5c3 100644
@@ -10,5 +10,4 @@ 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.4.3