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.

(From OE-Core rev: 530c4525f278bff72d8184035d00020c10b8f8b4)

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Lock
2016-01-27 11:23:59 +00:00
committed by Richard Purdie
parent 5c35883efc
commit 79f4495244
2 changed files with 21 additions and 1 deletions

View File

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

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Setup a wired interface
Before=connman.service
[Service]
Type=oneshot
ExecStart=@SCRIPTDIR@/wired-setup
[Install]
WantedBy=network.target