ofono: Enabling with systemd
PATCH 1/1 ofono: Enabling with systemd
From: Muhammad Shakeel <[email protected]>
- Remove dependency on systemd layer
- Install 'sysv' related files only if distro has this feature
Signed-off-by Muhammad Shakeel <[email protected]>
--- meta/recipes-connectivity/ofono/ofono.inc | 15 ++++++++++++--- meta/recipes-connectivity/ofono/ofono_1.12.bb | 1 + meta/recipes-connectivity/ofono/ofono_git.bb | 1 + 3 files changed, 14 insertions(+), 3 deletions(-)
meta/recipes-connectivity/ofono/ofono.inc +12 -3
@@ -5,16 +5,25 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \ file://src/ofono.h;beginline=1;endline=20;md5=3ce17d5978ef3445def265b98899c2ee" -inherit autotools pkgconfig update-rc.d +inherit autotools pkgconfig update-rc.d systemd DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info ${@base_contains('DISTRO_FEATURES', 'bluetooth','bluez4', '', d)}" INITSCRIPT_NAME = "ofono" INITSCRIPT_PARAMS = "defaults 22" +SYSTEMD_SERVICE_${PN} = "ofono.service" +SYSTEMD_AUTO_ENABLE = "enable" + do_install_append() { - install -d ${D}${sysconfdir}/init.d/ - install -m 0755 ${WORKDIR}/ofono ${D}${sysconfdir}/init.d/ofono + if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then + install -d ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/ofono ${D}${sysconfdir}/init.d/ofono + fi + + if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then + sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${systemd_unitdir}/system/ofono.service + fi } PACKAGES =+ "${PN}-tests"
meta/recipes-connectivity/ofono/ofono_1.12.bb +1 -0
@@ -15,5 +15,6 @@ SRC_URI[sha256sum] = "733b75bfd1b2a1925b6de532989c496b8ae17a746691120ef64cceb00b EXTRA_OECONF += "\ --enable-test \ ${@base_contains('DISTRO_FEATURES', 'bluetooth','--enable-bluetooth', '--disable-bluetooth', d)} \ + ${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdunitdir=${systemd_unitdir}/system/', '--with-systemdunitdir=', d)} \ " CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
meta/recipes-connectivity/ofono/ofono_git.bb +1 -0
@@ -10,6 +10,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/network/ofono/ofono.git;protocol=git \ EXTRA_OECONF += "\ ${@base_contains('DISTRO_FEATURES', 'bluetooth','--enable-bluetooth', '--disable-bluetooth', d)} \ + ${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdunitdir=${systemd_unitdir}/system/', '--with-systemdunitdir=', d)} \ " do_configure_prepend () {
Signature · 1 line
1.7.9.5