Patchwork [1/3] ofono: Add systemd support

login
register
mail settings
Submitter Jukka Rissanen
Date July 26, 2013, 12:35 p.m.
Message ID <1374842117-24504-2-git-send-email-jukka.rissanen@linux.intel.com>
Download mbox | patch
Permalink /patch/54593/
State New
Headers show

Comments

Jukka Rissanen - July 26, 2013, 12:35 p.m.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
---
 meta/recipes-connectivity/ofono/ofono.inc | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Shakeel, Muhammad - July 29, 2013, 9:43 a.m.
On 07/26/2013 05:35 PM, Jukka Rissanen wrote:
>   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
>   }
>   
>   PACKAGES =+ "${PN}-tests"
We won't need above 'sysvinit' check as we are trying to implement this 
for all packages through systemd class. Please see this: 
http://patches.openembedded.org/patch/54671/

Regards,
Shakeel
Jukka Rissanen - July 30, 2013, 10:30 a.m.
On 29.07.2013 12:43, Muhammad Shakeel wrote:
> On 07/26/2013 05:35 PM, Jukka Rissanen wrote:
>>   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
>>   }
>>   PACKAGES =+ "${PN}-tests"
> We won't need above 'sysvinit' check as we are trying to implement this
> for all packages through systemd class. Please see this:
> http://patches.openembedded.org/patch/54671/

There is an issue here as I am using ofono.inc in separate ofono recipe 
where I do not have ofono init script.
In that case I need to move the do_install_append() from ofono.inc to 
ofono_1.12.bb file in order to reuse the ofono.inc.

I will send v2 after your patchset is committed.


Cheers,
Jukka
Saul Wold - July 30, 2013, 2:37 p.m.
On 07/30/2013 03:30 AM, Jukka Rissanen wrote:
> On 29.07.2013 12:43, Muhammad Shakeel wrote:
>> On 07/26/2013 05:35 PM, Jukka Rissanen wrote:
>>>   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
>>>   }
>>>   PACKAGES =+ "${PN}-tests"
>> We won't need above 'sysvinit' check as we are trying to implement this
>> for all packages through systemd class. Please see this:
>> http://patches.openembedded.org/patch/54671/
>
> There is an issue here as I am using ofono.inc in separate ofono recipe
> where I do not have ofono init script.
> In that case I need to move the do_install_append() from ofono.inc to
> ofono_1.12.bb file in order to reuse the ofono.inc.
>
> I will send v2 after your patchset is committed.
>
This patchset is not getting committed as is, it's pending your address 
this issue and fixing the commit message of the 2nd patch enabling 
bluetooth, which was mentioned elsewhere.

The commit is wrong, it's not enabling bluetooth automatically, it's 
moving the code from .bb to .inc.

Thanks
	Sau!

>
> Cheers,
> Jukka
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>

Patch

diff --git a/meta/recipes-connectivity/ofono/ofono.inc b/meta/recipes-connectivity/ofono/ofono.inc
index 21e564c..7852337 100644
--- a/meta/recipes-connectivity/ofono/ofono.inc
+++ b/meta/recipes-connectivity/ofono/ofono.inc
@@ -5,16 +5,23 @@  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"
 
+EXTRA_OECONF += "\
+    ${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdunitdir=${systemd_unitdir}/system/', '--with-systemdunitdir=', d)} \
+"
+SYSTEMD_SERVICE_${PN} = "ofono.service"
+
 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
 }
 
 PACKAGES =+ "${PN}-tests"