Skip to contentSkip to conversation

wpa-supplicant: add virtual supplicant

PATCH In review Maxime Roussin-Bélanger 4 participants 8 messages Feb 10, 2020 – Feb 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wpa-supplicant: add virtual supplicant

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.

---
 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(-)
meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb +3 -0
index 2db09ad2c6..270e14eeb3 100644
@@ -15,6 +15,9 @@ PACKAGECONFIG[openssl] = ",,openssl"
 
 inherit pkgconfig systemd
 
+PROVIDES = "virtual/supplicant"
+RPROVIDES_${PN} += "virtual/supplicant"
+
 SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service [email protected] [email protected]"
 SYSTEMD_AUTO_ENABLE = "disable"
 
meta/recipes-core/packagegroups/packagegroup-base.bb +1 -1
index 1f802da09b..911877cf0a 100644
@@ -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)} \
Signature · 1 line
2.20.1
#1 lore raw
Quoted 11 lines · Maxime Roussin-Bélanger

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.

---
 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

#2 lore raw
Quoted 15 lines · Richard Purdie
Quoted 4 lines · Maxime Roussin-Bélanger

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

Quoted 8 lines

ConnMan, systemd-networkd and NetworkManager supports iwd.

---
 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(-)
Quoted 4 lines

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.

Quoted 4 lines

Cheers,

Richard

#3 lore raw
Quoted 6 lines · Maxime Roussin-Bélanger
Quoted 4 lines · Richard Purdie

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

Quoted 7 lines

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.

Quoted 11 lines

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}"

Quoted 7 lines

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

#4 lore raw
Quoted 37 lines · Richard Purdie
Quoted 6 lines · Maxime Roussin-Bélanger
Quoted 4 lines · Richard Purdie

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

Quoted 7 lines

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.

Quoted 11 lines

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}"

Quoted 7 lines

Example:

if VIRTUAL-RUNTIME_wireless-daemon == "iwd":

    DEPENDS += "iwd"
    EXTRA_OECONF += "--enable-iwd"
elif VIRTUAL-RUNTIME_wireless-daemon == "wpa-supplicant":
    DEPENDS += "wpa-supplicant"
Quoted 5 lines

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.

Quoted 4 lines

Cheers,

Richard

#5 lore raw
Quoted 4 lines · Maxime Roussin-Bélanger

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

#6 lore raw
Quoted 2 lines · Alexander Kanavin

On Thu, 13 Feb 2020 at 16:55, Maxime Roussin-Bélanger <

Quoted 3 lines · [email protected]> wrote:
Quoted 3 lines

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

wpa-supplicant, wpa-supplicant"

Quoted 3 lines

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 :)

Quoted 3 lines

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.

Quoted 4 lines

Alex

#7 lore raw
Quoted 12 lines · On Thu, 13 Feb 2020 11:13:49 -0500 Maxime Roussin-Bélanger…
Quoted 2 lines · Alexander Kanavin

On Thu, 13 Feb 2020 at 16:55, Maxime Roussin-Bélanger <

Quoted 3 lines · [email protected]> wrote:
Quoted 3 lines

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

wpa-supplicant, wpa-supplicant"

Quoted 3 lines

The problem with this, is that enabling one but not the other will

Quoted 8 lines

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