diff mbox series

build: obexd: Add system bus support for obexd

Message ID 20240723075455.2934376-1-quic_dgangire@quicinc.com
State New
Headers show
Series build: obexd: Add system bus support for obexd | expand

Commit Message

Damodar Reddy GangiReddy July 23, 2024, 7:54 a.m. UTC
From: Damodar Reddy GangiReddy <quic_dgangire@quicinc.com>

Currently obexd uses session bus.
Distros  where session bus is not supported and still obex profiles
are required in that case use system bus instead of session bus
which can be configured with new optional feature

Additional optional feature has been added to achieve this
with name --enable-use-systembus-for-obexd

steps to configure system bus
./configure --enable-use-systembus-for-obexd

If this optional option is approved  will add other patches
on how to use system bus based on this option

---
 Makefile.obexd | 14 ++++++++++++++
 configure.ac   |  9 +++++++++
 2 files changed, 23 insertions(+)

Comments

Damodar Reddy GangiReddy Aug. 16, 2024, 7:46 a.m. UTC | #1
Hi Paul,

Can you please provide your inputs/comments on the whole patch.
https://patchwork.kernel.org/project/bluetooth/list/?series=873224

On 7/23/2024 5:19 PM, Damodar Reddy GangiReddy wrote:
> 
> 
> On 7/23/2024 4:10 PM, Paul Menzel wrote:
>> Dear Damodar,
>>
>>
>> Thank you for your patch.
>>
>> Am 23.07.24 um 09:54 schrieb quic_dgangire@quicinc.com:
>>> From: Damodar Reddy GangiReddy <quic_dgangire@quicinc.com>
>>
>> Is your last named spelled in camel case?
>>
> yes
>>> Currently obexd uses session bus.
>>> Distros  where session bus is not supported and still obex profiles
>>> are required in that case use system bus instead of session bus
>>> which can be configured with new optional feature
>>>
>>> Additional optional feature has been added to achieve this
>>> with name --enable-use-systembus-for-obexd
>>>
>>> steps to configure system bus
>>> ./configure --enable-use-systembus-for-obexd
>>>
>>> If this optional option is approved  will add other patches
>>> on how to use system bus based on this option
>>
>> This paragraph does not belong into the commit message.
>>
> yes, so removing it and will share the whole patch
>>> ---
>>>   Makefile.obexd | 14 ++++++++++++++
>>>   configure.ac   |  9 +++++++++
>>>   2 files changed, 23 insertions(+)
>>>
>>> diff --git a/Makefile.obexd b/Makefile.obexd
>>> index b7e9f2d33..87432cc37 100644
>>> --- a/Makefile.obexd
>>> +++ b/Makefile.obexd
>>> @@ -2,6 +2,19 @@
>>>   if OBEX
>>>     if SYSTEMD
>>> +
>>> +if USE_SYSTEMBUS_FOR_OBEXD
>>> +
>>> +systemdsystemunit_DATA += obexd/src/obex.service
>>> +dbussystembus_DATA += obexd/src/org.bluez.obex.service
>>> +
>>> +obexd-add-service-symlink:
>>> +    $(LN_S) -f obex.service $(DESTDIR)$(SYSTEMD_SYSTEMUNITDIR)/dbus-org.bluez.obex.service
>>> +
>>> +obexd-remove-service-symlink:
>>> +    rm -f $(DESTDIR)$(SYSTEMD_SYSTEMUNITDIR)/dbus-org.bluez.obex.service
>>> +else
>>> +
>>>   systemduserunitdir = $(SYSTEMD_USERUNITDIR)
>>>   systemduserunit_DATA = obexd/src/obex.service
>>>   @@ -13,6 +26,7 @@ obexd-add-service-symlink:
>>>     obexd-remove-service-symlink:
>>>       rm -f $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service
>>> +endif
>>>   else
>>>   obexd-add-service-symlink:
>>>   obexd-remove-service-symlink:
>>> diff --git a/configure.ac b/configure.ac
>>> index d31eb1656..cc9a55f4c 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -283,6 +283,15 @@ if (test "${enable_obex}" != "no"); then
>>>   fi
>>>   AM_CONDITIONAL(OBEX, test "${enable_obex}" != "no")
>>>   +AC_ARG_ENABLE(use-systembus-for-obexd, AS_HELP_STRING([--enable-use-systembus-for-obexd],
>>> +        [enable systembus for obexd]), [enable_use_systembus_for_obexd=${enableval}])
>>> +AM_CONDITIONAL(USE_SYSTEMBUS_FOR_OBEXD, test "${enable_use_systembus_for_obexd}" = "yes")
>>> +if (test "${enable_use_systembus_for_obexd}" = "yes"); then
>>> +    AC_DEFINE(USE_SYSTEMBUS_FOR_OBEXD, 1, [Define to 1 if you want to use system bus for obexd.])
>>> +else
>>> +    AC_DEFINE(USE_SYSTEMBUS_FOR_OBEXD, 0, [Define to 0 if you want to use session bus for obexd.])
>>> +fi
>>> +
>>>   AC_ARG_ENABLE(btpclient, AS_HELP_STRING([--enable-btpclient],
>>>           [enable BTP client]), [enable_btpclient=${enableval}])
>>>   AM_CONDITIONAL(BTPCLIENT, test "${enable_btpclient}" = "yes")
>>
>> It would be nice to see the whole picture. Is it just for creating and placing the systemd units in the right place?
>>
>>
> yes, it is used to place the systemd units in the right place.
> Will share the whole patch.
>> Kind regards,
>>
>> Paul
Kind Regards,
Damodar.
diff mbox series

Patch

diff --git a/Makefile.obexd b/Makefile.obexd
index b7e9f2d33..87432cc37 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -2,6 +2,19 @@ 
 if OBEX
 
 if SYSTEMD
+
+if USE_SYSTEMBUS_FOR_OBEXD
+
+systemdsystemunit_DATA += obexd/src/obex.service
+dbussystembus_DATA += obexd/src/org.bluez.obex.service
+
+obexd-add-service-symlink:
+	$(LN_S) -f obex.service $(DESTDIR)$(SYSTEMD_SYSTEMUNITDIR)/dbus-org.bluez.obex.service
+
+obexd-remove-service-symlink:
+	rm -f $(DESTDIR)$(SYSTEMD_SYSTEMUNITDIR)/dbus-org.bluez.obex.service
+else
+
 systemduserunitdir = $(SYSTEMD_USERUNITDIR)
 systemduserunit_DATA = obexd/src/obex.service
 
@@ -13,6 +26,7 @@  obexd-add-service-symlink:
 
 obexd-remove-service-symlink:
 	rm -f $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service
+endif
 else
 obexd-add-service-symlink:
 obexd-remove-service-symlink:
diff --git a/configure.ac b/configure.ac
index d31eb1656..cc9a55f4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -283,6 +283,15 @@  if (test "${enable_obex}" != "no"); then
 fi
 AM_CONDITIONAL(OBEX, test "${enable_obex}" != "no")
 
+AC_ARG_ENABLE(use-systembus-for-obexd, AS_HELP_STRING([--enable-use-systembus-for-obexd],
+		[enable systembus for obexd]), [enable_use_systembus_for_obexd=${enableval}])
+AM_CONDITIONAL(USE_SYSTEMBUS_FOR_OBEXD, test "${enable_use_systembus_for_obexd}" = "yes")
+if (test "${enable_use_systembus_for_obexd}" = "yes"); then
+	AC_DEFINE(USE_SYSTEMBUS_FOR_OBEXD, 1, [Define to 1 if you want to use system bus for obexd.])
+else
+	AC_DEFINE(USE_SYSTEMBUS_FOR_OBEXD, 0, [Define to 0 if you want to use session bus for obexd.])
+fi
+
 AC_ARG_ENABLE(btpclient, AS_HELP_STRING([--enable-btpclient],
 		[enable BTP client]), [enable_btpclient=${enableval}])
 AM_CONDITIONAL(BTPCLIENT, test "${enable_btpclient}" = "yes")