All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Clean up connman-conf on systemd systems
@ 2016-01-27 11:23 Joshua Lock
  2016-01-27 11:23 ` [PATCH v5 1/2] connman-conf: convert to systemd oneshot Joshua Lock
  2016-01-27 11:24 ` [PATCH v5 2/2] connman: tidy up connman-conf usage Joshua Lock
  0 siblings, 2 replies; 3+ messages in thread
From: Joshua Lock @ 2016-01-27 11:23 UTC (permalink / raw)
  To: openembedded-core

As reported in YP#8399 we currently hack the connman service to try and
execute a script which is only installed on qemu targets, its absence on
non-qemu machines results in an error in the journal:
  connman.service: Failed at step EXEC spawning /usr/lib/connman/wired-setup: No such file or directory

This pair of patches changes the connman-conf recipe to install a oneshot
systemd unit that is called before ConnMan and removes the ExecStartPre.

SysV init based images are unaffected by this change, the existing
mechanisms to check for the presence of the wired-setup script from the
init script remain in place.

Since v4 I've rebased on master and updated the unit file to have the path
to the script sed'ed in, as the script location has changed since the
original submission.

Tested by 1) booting a qemux86 and validating the network was brought up
per the wired.config settings 2) booting a genericx86 image and checking
that the wired-connection.service isn't installed.

Regards,

Joshua

The following changes since commit 2a6e061712cfe9cb4738806a0c351a64e0d30144:

  cmake: update to 3.4.2 (2016-01-26 22:48:57 +0000)

are available in the git repository at:

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

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

 meta/recipes-connectivity/connman/connman-conf.bb            | 12 +++++++++++-
 .../connman/connman-conf/qemuall/wired-connection.service    | 10 ++++++++++
 meta/recipes-connectivity/connman/connman.inc                |  5 -----
 3 files changed, 21 insertions(+), 6 deletions(-)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service

--
2.5.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v5 1/2] connman-conf: convert to systemd oneshot
  2016-01-27 11:23 [PATCH v5 0/2] Clean up connman-conf on systemd systems Joshua Lock
@ 2016-01-27 11:23 ` Joshua Lock
  2016-01-27 11:24 ` [PATCH v5 2/2] connman: tidy up connman-conf usage Joshua Lock
  1 sibling, 0 replies; 3+ messages in thread
From: Joshua Lock @ 2016-01-27 11:23 UTC (permalink / raw)
  To: openembedded-core

From: Joshua Lock <joshua.lock@collabora.co.uk>

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.

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
---
 meta/recipes-connectivity/connman/connman-conf.bb            | 12 +++++++++++-
 .../connman/connman-conf/qemuall/wired-connection.service    | 10 ++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service

diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
index 9254ed7..9a519ec 100644
--- a/meta/recipes-connectivity/connman/connman-conf.bb
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -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,17 @@ 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}
+        sed -i -e 's|@SCRIPTDIR@|${datadir}/connman|g' ${D}${systemd_system_unitdir}/wired-connection.service
     fi
 }
+
+SYSTEMD_SERVICE_${PN}_qemuall = "wired-connection.service"
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
new file mode 100644
index 0000000..48adfc0
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Setup a wired interface
+Before=connman.service
+
+[Service]
+Type=oneshot
+ExecStart=@SCRIPTDIR@/wired-setup
+
+[Install]
+WantedBy=network.target
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v5 2/2] connman: tidy up connman-conf usage
  2016-01-27 11:23 [PATCH v5 0/2] Clean up connman-conf on systemd systems Joshua Lock
  2016-01-27 11:23 ` [PATCH v5 1/2] connman-conf: convert to systemd oneshot Joshua Lock
@ 2016-01-27 11:24 ` Joshua Lock
  1 sibling, 0 replies; 3+ messages in thread
From: Joshua Lock @ 2016-01-27 11:24 UTC (permalink / raw)
  To: openembedded-core

From: Joshua Lock <joshua.lock@collabora.co.uk>

connman-conf is now a systemd oneshot and therefore doesn't need to
be sed'ed in to the ConnMan service file.

Note: this doesn't affect sysvinit where we provide a 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]

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
---
 meta/recipes-connectivity/connman/connman.inc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index 856ba44..c375251 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -69,11 +69,6 @@ python __anonymous () {
 SYSTEMD_SERVICE_${PN} = "connman.service"
 SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
 SYSTEMD_SERVICE_${PN}-wait-online = "connman-wait-online.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
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-27 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-27 11:23 [PATCH v5 0/2] Clean up connman-conf on systemd systems Joshua Lock
2016-01-27 11:23 ` [PATCH v5 1/2] connman-conf: convert to systemd oneshot Joshua Lock
2016-01-27 11:24 ` [PATCH v5 2/2] connman: tidy up connman-conf usage Joshua Lock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.