All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wpa-supplicant: add virtual supplicant
@ 2020-02-10 21:42 Maxime Roussin-Bélanger
  2020-02-13 14:24 ` Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Roussin-Bélanger @ 2020-02-10 21:42 UTC (permalink / raw)
  To: openembedded-core

There is a second supplicant raising, iwd. User should be
able to switch between wpa-supplicant and iwd. Let's provide
a virtual package.

ConnMan, systemd-networkd and NetworkManager supports iwd.

Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
---
 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb | 3 +++
 meta/recipes-core/packagegroups/packagegroup-base.bb           | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb
index 2db09ad2c6..270e14eeb3 100644
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb
@@ -15,6 +15,9 @@ PACKAGECONFIG[openssl] = ",,openssl"
 
 inherit pkgconfig systemd
 
+PROVIDES = "virtual/supplicant"
+RPROVIDES_${PN} += "virtual/supplicant"
+
 SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
diff --git a/meta/recipes-core/packagegroups/packagegroup-base.bb b/meta/recipes-core/packagegroups/packagegroup-base.bb
index 1f802da09b..911877cf0a 100644
--- a/meta/recipes-core/packagegroups/packagegroup-base.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -270,7 +270,7 @@ SUMMARY_packagegroup-base-wifi = "WiFi support"
 RDEPENDS_packagegroup-base-wifi = "\
     iw \
     wireless-regdb-static \
-    wpa-supplicant"
+    virtual/supplicant"
 
 RRECOMMENDS_packagegroup-base-wifi = "\
     ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-zd1211rw', '',d)} \
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] wpa-supplicant: add virtual supplicant
  2020-02-10 21:42 [PATCH] wpa-supplicant: add virtual supplicant Maxime Roussin-Bélanger
@ 2020-02-13 14:24 ` Richard Purdie
  2020-02-13 15:22   ` Maxime Roussin-Bélanger
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2020-02-13 14:24 UTC (permalink / raw)
  To: Maxime Roussin-Bélanger, openembedded-core

On Mon, 2020-02-10 at 16:42 -0500, Maxime Roussin-Bélanger wrote:
> There is a second supplicant raising, iwd. User should be
> able to switch between wpa-supplicant and iwd. Let's provide
> a virtual package.
> 
> ConnMan, systemd-networkd and NetworkManager supports iwd.
> 
> Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
> ---
>  meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb | 3 +++
>  meta/recipes-core/packagegroups/packagegroup-base.bb           | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)

I know its not easy to understand but we don't support virtual/* names
in the runtime namespace, only the build time one (PROVIDES/DEPENDS).

Grep for VIRTUAL-RUNTIME to see how we handle this (its ugly I know).

Cheers,

Richard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wpa-supplicant: add virtual supplicant
  2020-02-13 14:24 ` Richard Purdie
@ 2020-02-13 15:22   ` Maxime Roussin-Bélanger
  2020-02-13 15:27     ` Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Roussin-Bélanger @ 2020-02-13 15:22 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]

On Thu, Feb 13, 2020 at 9:24 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
>
> On Mon, 2020-02-10 at 16:42 -0500, Maxime Roussin-Bélanger wrote:
> > There is a second supplicant raising, iwd. User should be
> > able to switch between wpa-supplicant and iwd. Let's provide
> > a virtual package.
> >
> > ConnMan, systemd-networkd and NetworkManager supports iwd.
> >
> > Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com
>
> > ---
> >  meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb | 3 +++
> >  meta/recipes-core/packagegroups/packagegroup-base.bb           | 2 +-
> >  2 files changed, 4 insertions(+), 1 deletion(-)
>
> I know its not easy to understand but we don't support virtual/* names
> in the runtime namespace, only the build time one (PROVIDES/DEPENDS).
>
> Grep for VIRTUAL-RUNTIME to see how we handle this (its ugly I know).

Hmm interesting!

If I follow correctly that's mean I have to create:

VIRTUAL-RUNTIME_wireless-daemon and then people can override it.

If the (R)DEPENDS on a recipe change depending on the wireless daemon that
was chosen(i.e. connman), do you handle it with d.getVar and
d.setVar("DEPENDS... inside a
anonymous python function inside the recipe?

The packageconfig would like this ?

PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi,
${VIRTUAL-RUNTIME_wireless-daemon}, ${VIRTUAL-RUNTIME_wireless-daemon}"

Example:

if VIRTUAL-RUNTIME_wireless-daemon == "iwd":
    DEPENDS += "iwd"
    EXTRA_OECONF += "--enable-iwd"
elif VIRTUAL-RUNTIME_wireless-daemon == "wpa-supplicant":
    DEPENDS += "wpa-supplicant"


Thanks,
Max.

>
> Cheers,
>
> Richard

[-- Attachment #2: Type: text/html, Size: 2479 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wpa-supplicant: add virtual supplicant
  2020-02-13 15:22   ` Maxime Roussin-Bélanger
@ 2020-02-13 15:27     ` Richard Purdie
  2020-02-13 15:54       ` Maxime Roussin-Bélanger
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2020-02-13 15:27 UTC (permalink / raw)
  To: Maxime Roussin-Bélanger; +Cc: openembedded-core

On Thu, 2020-02-13 at 10:22 -0500, Maxime Roussin-Bélanger wrote:
> On Thu, Feb 13, 2020 at 9:24 AM Richard Purdie <
> richard.purdie@linuxfoundation.org> wrote:
> > I know its not easy to understand but we don't support virtual/* 
> > names in the runtime namespace, only the build time one
> > (PROVIDES/DEPENDS).
> > Grep for VIRTUAL-RUNTIME to see how we handle this (its ugly I
> know).
> 
> Hmm interesting! 
> 
> If I follow correctly that's mean I have to create:
> 
> VIRTUAL-RUNTIME_wireless-daemon and then people can override it.

Correct.

> If the (R)DEPENDS on a recipe change depending on the wireless daemon
> that
> was chosen(i.e. connman), do you handle it with d.getVar and
> d.setVar("DEPENDS... inside a 
> anonymous python function inside the recipe?
> 
> The packageconfig would like this ?
> 
> PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, ${VIRTUAL-
> RUNTIME_wireless-daemon}, ${VIRTUAL-RUNTIME_wireless-daemon}"
> 
> Example:
> 
> if VIRTUAL-RUNTIME_wireless-daemon == "iwd":
>     DEPENDS += "iwd"
>     EXTRA_OECONF += "--enable-iwd"
> elif VIRTUAL-RUNTIME_wireless-daemon == "wpa-supplicant":
>     DEPENDS += "wpa-supplicant"

At this point it suggests they're not interchangeable and therefore not
simple runtime switchable dependencies.

The closest analogy is the "ld-is-gold" DISTRO_FEATURE when you have
something that isn't compatible like this.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wpa-supplicant: add virtual supplicant
  2020-02-13 15:27     ` Richard Purdie
@ 2020-02-13 15:54       ` Maxime Roussin-Bélanger
  2020-02-13 16:00         ` Alexander Kanavin
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Roussin-Bélanger @ 2020-02-13 15:54 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2533 bytes --]

On Thu, Feb 13, 2020 at 10:27 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
>
> On Thu, 2020-02-13 at 10:22 -0500, Maxime Roussin-Bélanger wrote:
> > On Thu, Feb 13, 2020 at 9:24 AM Richard Purdie <
> > richard.purdie@linuxfoundation.org> wrote:
> > > I know its not easy to understand but we don't support virtual/*
> > > names in the runtime namespace, only the build time one
> > > (PROVIDES/DEPENDS).
> > > Grep for VIRTUAL-RUNTIME to see how we handle this (its ugly I
> > know).
> >
> > Hmm interesting!
> >
> > If I follow correctly that's mean I have to create:
> >
> > VIRTUAL-RUNTIME_wireless-daemon and then people can override it.
>
> Correct.
>
> > If the (R)DEPENDS on a recipe change depending on the wireless daemon
> > that
> > was chosen(i.e. connman), do you handle it with d.getVar and
> > d.setVar("DEPENDS... inside a
> > anonymous python function inside the recipe?
> >
> > The packageconfig would like this ?
> >
> > PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, ${VIRTUAL-
> > RUNTIME_wireless-daemon}, ${VIRTUAL-RUNTIME_wireless-daemon}"
> >
> > Example:
> >
> > if VIRTUAL-RUNTIME_wireless-daemon == "iwd":
> >     DEPENDS += "iwd"
> >     EXTRA_OECONF += "--enable-iwd"
> > elif VIRTUAL-RUNTIME_wireless-daemon == "wpa-supplicant":
> >     DEPENDS += "wpa-supplicant"
>
> At this point it suggests they're not interchangeable and therefore not
> simple runtime switchable dependencies.
>
> The closest analogy is the "ld-is-gold" DISTRO_FEATURE when you have
> something that isn't compatible like this.

I realize that my example isn't the proper one.. sorry about that! We can
probably
simplify with PACKAGECONFIG.

Maybe the right solution would be to provide two packageconfig?

PACKAGECONFIG[iwd] = "--enable-iwd, --disable-wifi, iwd, iwd"
PACKAGECONFIG[wpa-supplicant] = "--enable-wifi, --disable-wifi,
wpa-supplicant, wpa-supplicant"

They are mutually exclusive, is this something that can be done through
PACKAGECONFIG?

Maybe we don't deal with the conflicts that can occur if a user activates
both? It would probably
fail at configure time? What is good practice here?

At the same time, it is VERY weird for a system to have iwd and
wpa_supplicant. If I recall correctly,
iwd has an error message with another wireless daemon run concurrently.

I would like to be able to force the user to choose only one... because I
think having both is an error.


Thanks,
Max.

>
> Cheers,
>
> Richard

[-- Attachment #2: Type: text/html, Size: 3389 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wpa-supplicant: add virtual supplicant
  2020-02-13 15:54       ` Maxime Roussin-Bélanger
@ 2020-02-13 16:00         ` Alexander Kanavin
  2020-02-13 16:13           ` Maxime Roussin-Bélanger
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Kanavin @ 2020-02-13 16:00 UTC (permalink / raw)
  To: Maxime Roussin-Bélanger; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

On Thu, 13 Feb 2020 at 16:55, Maxime Roussin-Bélanger <
maxime.roussinbelanger@gmail.com> wrote:

> PACKAGECONFIG[iwd] = "--enable-iwd, --disable-wifi, iwd, iwd"
> PACKAGECONFIG[wpa-supplicant] = "--enable-wifi, --disable-wifi,
> wpa-supplicant, wpa-supplicant"
>

The problem with this, is that enabling one but not the other will combine
into '--enable-iwd --disable-wifi' which is not what is intended.

I am not sure why you need to specify them as both build and runtime
dependencies, can you clarify why?

Alex

[-- Attachment #2: Type: text/html, Size: 958 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wpa-supplicant: add virtual supplicant
  2020-02-13 16:00         ` Alexander Kanavin
@ 2020-02-13 16:13           ` Maxime Roussin-Bélanger
  2020-02-13 23:18             ` Andreas Oberritter
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Roussin-Bélanger @ 2020-02-13 16:13 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

On Thu, Feb 13, 2020 at 11:00 AM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:
>
> On Thu, 13 Feb 2020 at 16:55, Maxime Roussin-Bélanger <
maxime.roussinbelanger@gmail.com> wrote:
>>
>> PACKAGECONFIG[iwd] = "--enable-iwd, --disable-wifi, iwd, iwd"
>> PACKAGECONFIG[wpa-supplicant] = "--enable-wifi, --disable-wifi,
wpa-supplicant, wpa-supplicant"
>
>
> The problem with this, is that enabling one but not the other will
combine into '--enable-iwd --disable-wifi' which is not what is intended.

Actually, it is what is intended, the `--disable-wifi` will disable
wpa-supplicant support, but keep the wifi support from other plugins (i.e.
iwd).

I agree that maybe the `--enable-wifi` is probably not the best option
name, but I am not sure I can something about it :)

>
>
> I am not sure why you need to specify them as both build and runtime
dependencies, can you clarify why?

iwd is probably not needed as a build dependency.. I would have to recheck
that. ConnMan
needs the runtime for the dbus interface that iwd exposes.

wpa-supplicant is probably the same thing. I'm not sure why originally
wpa-supplicant is specified as
a build dependency. It's been there for 5 years..

Thanks,
Max.

>
> Alex

>

[-- Attachment #2: Type: text/html, Size: 1827 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wpa-supplicant: add virtual supplicant
  2020-02-13 16:13           ` Maxime Roussin-Bélanger
@ 2020-02-13 23:18             ` Andreas Oberritter
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Oberritter @ 2020-02-13 23:18 UTC (permalink / raw)
  To: Maxime Roussin-Bélanger; +Cc: OE-core

On Thu, 13 Feb 2020 11:13:49 -0500
Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> wrote:

> On Thu, Feb 13, 2020 at 11:00 AM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
> >
> > On Thu, 13 Feb 2020 at 16:55, Maxime Roussin-Bélanger <
> maxime.roussinbelanger@gmail.com> wrote:
> >>
> >> PACKAGECONFIG[iwd] = "--enable-iwd, --disable-wifi, iwd, iwd"
> >> PACKAGECONFIG[wpa-supplicant] = "--enable-wifi, --disable-wifi,
> wpa-supplicant, wpa-supplicant"
> >
> >
> > The problem with this, is that enabling one but not the other will
> combine into '--enable-iwd --disable-wifi' which is not what is intended.
> 
> Actually, it is what is intended, the `--disable-wifi` will disable
> wpa-supplicant support, but keep the wifi support from other plugins (i.e.
> iwd).
> 
> I agree that maybe the `--enable-wifi` is probably not the best option
> name, but I am not sure I can something about it :)

It should be the user's responsibility (or the image recipe's) to choose the
wifi daemon, and it should be possible to uninstall one and install the other
from a package feed, or even to install both at the same time and use one for
wlan0 and the other for wlan1.

Debian enables support for both daemons in connman and has the following
package metadata:

Recommends: wpasupplicant | iwd

I don't know whether there's a way to generate that line in OE. If not, you
could try to fake it by adding RPROVIDES_${PN} = "iwd-or-wpasupplicant" or
something similar to both daemon's recipes and recommending that in recipes
supporting both daemons.

Best regards,
Andreas


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-13 23:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 21:42 [PATCH] wpa-supplicant: add virtual supplicant Maxime Roussin-Bélanger
2020-02-13 14:24 ` Richard Purdie
2020-02-13 15:22   ` Maxime Roussin-Bélanger
2020-02-13 15:27     ` Richard Purdie
2020-02-13 15:54       ` Maxime Roussin-Bélanger
2020-02-13 16:00         ` Alexander Kanavin
2020-02-13 16:13           ` Maxime Roussin-Bélanger
2020-02-13 23:18             ` Andreas Oberritter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.