diff mbox series

[v2,1/6] default-providers: Add VIRTUAL-RUNTIME_dbus variable

Message ID 20250328150136.1855862-1-niko.mauno@vaisala.com
State New
Headers show
Series [v2,1/6] default-providers: Add VIRTUAL-RUNTIME_dbus variable | expand

Commit Message

Niko Mauno March 28, 2025, 3:01 p.m. UTC
The purpose of the new variable is to facilitate oe-core users who wish
to use an alternative runtime D-Bus implementation instead of the
default Freedesktop.org's dbus, such as dbus-broker, a recipe for which
is currently available under
meta-openembedded/meta-oe/recipes-core/dbus/

While introducing this facilitation the intent is to preserve the
existing functionality, while allowing the user to optionally select an
alternative runtime D-Bus implementation by adding the following line
e.g. to local.conf file:

  VIRTUAL-RUNTIME_dbus = "dbus-broker"

As a background, for example the Fedora distribution uses dbus-broker
instead of Freedesktop.org's D-Bus implementation. The following
excerpts from
https://fedoraproject.org/wiki/Changes/DbusBrokerAsTheDefaultDbusImplementation
provide background for their technological decision

  This change provides a more scalable and more reliable implementation in place of the reference implementation.
  The reference implementation suffers from long-standing issues including potential dead-locks and susceptibility to denial of service attacks, which the replacement implementation does not.

and

  No visible changes in behavior are expected, except for different log messages.
  Any visibly different behavior to `dbus-daemon` should be reported as a regression.
  Ideally, this change should only improve the performance and security of the message bus.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 meta/conf/distro/include/default-providers.inc | 1 +
 1 file changed, 1 insertion(+)

Comments

Adrian Freihofer March 29, 2025, 2:02 p.m. UTC | #1
Hi Niko

Thank you for the patch. It would be nice to have an easy way to switch
to dbus-broker.

On Fri, 2025-03-28 at 15:01 +0000, Niko Mauno via
lists.openembedded.org wrote:
> The purpose of the new variable is to facilitate oe-core users who
> wish
> to use an alternative runtime D-Bus implementation instead of the
> default Freedesktop.org's dbus, such as dbus-broker, a recipe for
> which
> is currently available under
> meta-openembedded/meta-oe/recipes-core/dbus/
> 
> While introducing this facilitation the intent is to preserve the
> existing functionality, while allowing the user to optionally select
> an
> alternative runtime D-Bus implementation by adding the following line
> e.g. to local.conf file:
> 
>   VIRTUAL-RUNTIME_dbus = "dbus-broker"

Introducing a VIRTUAL-RUNTIME_dbus variable would work. But it requires
to change all dbus related recipes which are not only in oe-core.

I'm wondering if using a PREFERRED_RPROVIDER would simplify this.
https://docs.yoctoproject.org/dev/ref-manual/variables.html#term-PREFERRED_RPROVIDER

This would probably allow a back and forward compatible implementation
with changing only the dbus-broker and maybe the dbus recipes plus
adding something like
  PREFERRED_RPROVIDER_dbus ?= "dbus"
or
  PREFERRED_RPROVIDER_virtual-dbus ?= "dbus"
to OE-core.

Regards,
Adrian

> 
> As a background, for example the Fedora distribution uses dbus-broker
> instead of Freedesktop.org's D-Bus implementation. The following
> excerpts from
> https://fedoraproject.org/wiki/Changes/DbusBrokerAsTheDefaultDbusImplementation
> provide background for their technological decision
> 
>   This change provides a more scalable and more reliable
> implementation in place of the reference implementation.
>   The reference implementation suffers from long-standing issues
> including potential dead-locks and susceptibility to denial of
> service attacks, which the replacement implementation does not.
> 
> and
> 
>   No visible changes in behavior are expected, except for different
> log messages.
>   Any visibly different behavior to `dbus-daemon` should be reported
> as a regression.
>   Ideally, this change should only improve the performance and
> security of the message bus.
> 
> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> ---
>  meta/conf/distro/include/default-providers.inc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/conf/distro/include/default-providers.inc
> b/meta/conf/distro/include/default-providers.inc
> index d3eefb754b..cebd0400f4 100644
> --- a/meta/conf/distro/include/default-providers.inc
> +++ b/meta/conf/distro/include/default-providers.inc
> @@ -31,6 +31,7 @@ VIRTUAL-RUNTIME_base-utils ?= "busybox"
>  VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
>  VIRTUAL-RUNTIME_base-utils-syslog ?= "busybox-syslog"
>  VIRTUAL-RUNTIME_keymaps ?= "keymaps"
> +VIRTUAL-RUNTIME_dbus ?= "dbus"
>  
>  #
>  # Default recipe providers
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#213847):
> https://lists.openembedded.org/g/openembedded-core/message/213847
> Mute This Topic: https://lists.openembedded.org/mt/111955697/4454582
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/openembedded-core/unsub [
> adrian.freihofer@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Richard Purdie March 29, 2025, 2:26 p.m. UTC | #2
On Sat, 2025-03-29 at 15:02 +0100, Adrian Freihofer via lists.openembedded.org wrote:
> Hi Niko
> 
> Thank you for the patch. It would be nice to have an easy way to switch
> to dbus-broker.
> 
> On Fri, 2025-03-28 at 15:01 +0000, Niko Mauno via
> lists.openembedded.org wrote:
> > The purpose of the new variable is to facilitate oe-core users who
> > wish
> > to use an alternative runtime D-Bus implementation instead of the
> > default Freedesktop.org's dbus, such as dbus-broker, a recipe for
> > which
> > is currently available under
> > meta-openembedded/meta-oe/recipes-core/dbus/
> > 
> > While introducing this facilitation the intent is to preserve the
> > existing functionality, while allowing the user to optionally select
> > an
> > alternative runtime D-Bus implementation by adding the following line
> > e.g. to local.conf file:
> > 
> >   VIRTUAL-RUNTIME_dbus = "dbus-broker"
> 
> Introducing a VIRTUAL-RUNTIME_dbus variable would work. But it requires
> to change all dbus related recipes which are not only in oe-core.
> 
> I'm wondering if using a PREFERRED_RPROVIDER would simplify this.
> https://docs.yoctoproject.org/dev/ref-manual/variables.html#term-PREFERRED_RPROVIDER
> 
> This would probably allow a back and forward compatible implementation
> with changing only the dbus-broker and maybe the dbus recipes plus
> adding something like
>   PREFERRED_RPROVIDER_dbus ?= "dbus"
> or
>   PREFERRED_RPROVIDER_virtual-dbus ?= "dbus"
> to OE-core.

Sadly it doesn't work like that. I regret adding PREFERRED_RPROVIDER as
it doesn't work as people think and only helps under very very rare
circumstances.

Runtime issues are a package manager level problem, not a bitbake one,
unless bitbake is doing variable substitution beforehand, which it only
does with the normal rules.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index d3eefb754b..cebd0400f4 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -31,6 +31,7 @@  VIRTUAL-RUNTIME_base-utils ?= "busybox"
 VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
 VIRTUAL-RUNTIME_base-utils-syslog ?= "busybox-syslog"
 VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+VIRTUAL-RUNTIME_dbus ?= "dbus"
 
 #
 # Default recipe providers