Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Clean up connman-conf
@ 2015-12-03  9:23 Joshua Lock
  2015-12-03  9:23 ` [PATCH v2 1/3] connman-conf: convert to systemd oneshot Joshua Lock
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Joshua Lock @ 2015-12-03  9:23 UTC (permalink / raw)
  To: openembedded-core

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.

Changes since v1:
  * don't explicitly set INHIBIT_DEFAULT_DEPS, allarch.bbclass does that for us

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

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
  connman: tidy up connman-conf usage

 meta/recipes-connectivity/connman/connman-conf.bb              |  9 ++++++++-
 .../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, 19 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service

--
2.4.3


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

* [PATCH v2 1/3] connman-conf: convert to systemd oneshot
  2015-12-03  9:23 [PATCH v2 0/3] Clean up connman-conf Joshua Lock
@ 2015-12-03  9:23 ` Joshua Lock
  2015-12-03  9:23 ` [PATCH v2 2/3] connman-conf: mark as allarch Joshua Lock
  2015-12-03  9:23 ` [PATCH v2 3/3] connman: tidy up connman-conf usage Joshua Lock
  2 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2015-12-03  9:23 UTC (permalink / raw)
  To: openembedded-core

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

diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
index 9254ed7..bef9237 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,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
 }
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..f66d158a
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
@@ -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
-- 
2.4.3



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

* [PATCH v2 2/3] connman-conf: mark as allarch
  2015-12-03  9:23 [PATCH v2 0/3] Clean up connman-conf Joshua Lock
  2015-12-03  9:23 ` [PATCH v2 1/3] connman-conf: convert to systemd oneshot Joshua Lock
@ 2015-12-03  9:23 ` Joshua Lock
  2015-12-03 10:03   ` Martin Jansa
  2015-12-03  9:23 ` [PATCH v2 3/3] connman: tidy up connman-conf usage Joshua Lock
  2 siblings, 1 reply; 5+ messages in thread
From: Joshua Lock @ 2015-12-03  9:23 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
---
 meta/recipes-connectivity/connman/connman-conf.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
index bef9237..4c6a2d2 100644
--- a/meta/recipes-connectivity/connman/connman-conf.bb
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -4,7 +4,7 @@ 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
 
 SRC_URI_append_qemuall = " file://wired.config \
                            file://wired-setup \
-- 
2.4.3



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

* [PATCH v2 3/3] connman: tidy up connman-conf usage
  2015-12-03  9:23 [PATCH v2 0/3] Clean up connman-conf Joshua Lock
  2015-12-03  9:23 ` [PATCH v2 1/3] connman-conf: convert to systemd oneshot Joshua Lock
  2015-12-03  9:23 ` [PATCH v2 2/3] connman-conf: mark as allarch Joshua Lock
@ 2015-12-03  9:23 ` Joshua Lock
  2 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2015-12-03  9:23 UTC (permalink / raw)
  To: openembedded-core

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]

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
---
 meta/recipes-connectivity/connman/connman.inc     | 5 -----
 meta/recipes-connectivity/connman/connman_1.30.bb | 3 +--
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index 6324d7a..40880ad 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -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
diff --git a/meta/recipes-connectivity/connman/connman_1.30.bb b/meta/recipes-connectivity/connman/connman_1.30.bb
index 7d65ac9..7f7f5c3 100644
--- a/meta/recipes-connectivity/connman/connman_1.30.bb
+++ b/meta/recipes-connectivity/connman/connman_1.30.bb
@@ -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"
-- 
2.4.3



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

* Re: [PATCH v2 2/3] connman-conf: mark as allarch
  2015-12-03  9:23 ` [PATCH v2 2/3] connman-conf: mark as allarch Joshua Lock
@ 2015-12-03 10:03   ` Martin Jansa
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2015-12-03 10:03 UTC (permalink / raw)
  To: Joshua Lock; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]

On Thu, Dec 03, 2015 at 09:23:47AM +0000, Joshua Lock wrote:
> This recipe just installs some data files and thus is architecture
> independent and doesn't require a compiler and libc in its DEPENDS.

Sorry I didn't notice it before, but this recipe is meant to provide
MACHINE specific configuration, like the qemuall overrides does few
lines below, so this cannot be allarch.

> 
> Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
> ---
>  meta/recipes-connectivity/connman/connman-conf.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
> index bef9237..4c6a2d2 100644
> --- a/meta/recipes-connectivity/connman/connman-conf.bb
> +++ b/meta/recipes-connectivity/connman/connman-conf.bb
> @@ -4,7 +4,7 @@ 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
>  
>  SRC_URI_append_qemuall = " file://wired.config \
>                             file://wired-setup \
> -- 
> 2.4.3
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

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

end of thread, other threads:[~2015-12-03 10:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-03  9:23 [PATCH v2 0/3] Clean up connman-conf Joshua Lock
2015-12-03  9:23 ` [PATCH v2 1/3] connman-conf: convert to systemd oneshot Joshua Lock
2015-12-03  9:23 ` [PATCH v2 2/3] connman-conf: mark as allarch Joshua Lock
2015-12-03 10:03   ` Martin Jansa
2015-12-03  9:23 ` [PATCH v2 3/3] connman: tidy up connman-conf usage Joshua Lock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox