diff mbox series

[PATCHv2] connman: add PACKAGECONFIG to support iwd

Message ID 20220824125037.4855-1-f_l_k@t-online.de
State Accepted, archived
Commit 4528cb220e5365f1f4a0a50122e14480ede65130
Headers show
Series [PATCHv2] connman: add PACKAGECONFIG to support iwd | expand

Commit Message

Markus Volk Aug. 24, 2022, 12:50 p.m. UTC
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/recipes-connectivity/connman/connman.inc | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Comments

Ross Burton Aug. 25, 2022, 12:17 p.m. UTC | #1
On 24 Aug 2022, at 13:50, Markus Volk via lists.openembedded.org <f_l_k=t-online.de@lists.openembedded.org> wrote:
> +# For smooth operation it would be best to start only one wireless daemon at a time.
> +# If wpa_supplicant is running, connman will use it preferentially.
> +# Select either wpa_supplicant or iwd
> +WIRELESS_DAEMON ??= "wpa_supplicant"
> PACKAGECONFIG ??= "wispr iptables client\
> -                   ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
> +                   ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd', d)} \
>                    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
> +                   ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi ${WIRELESS_DAEMON}', '', d)} \
> "

This is over-complicating things.  Why is the wifi daemon a special configuration option?  Just have wpa_supplicant in the default PACKAGECONFIG, and people who want to use iwd can set PACKAGECONFIG.

> +PACKAGECONFIG[wpa_supplicant] = ",,wpa-supplicant,wpa-supplicant"
> +# iwd would be required as a runtime dependency. it is nevertheless given as a recommendation because the recipe for it
> +# is not included in oe-core.
> +PACKAGECONFIG[iwd] = "--enable-iwd,--disable-iwd,,,iwd"

This definitely should be RDEPENDS.

Note that if wpa_supplicant and iwd are mutually exclusive, you can express that in the PACKAGECONFIG:

https://docs.yoctoproject.org/ref-manual/variables.html?#term-PACKAGECONFIG

Ross
Quentin Schulz Aug. 25, 2022, 2:59 p.m. UTC | #2
Hi Ross,

On 8/25/22 14:17, Ross Burton wrote:
> On 24 Aug 2022, at 13:50, Markus Volk via lists.openembedded.org <f_l_k=t-online.de@lists.openembedded.org> wrote:
>> +# For smooth operation it would be best to start only one wireless daemon at a time.
>> +# If wpa_supplicant is running, connman will use it preferentially.
>> +# Select either wpa_supplicant or iwd
>> +WIRELESS_DAEMON ??= "wpa_supplicant"
>> PACKAGECONFIG ??= "wispr iptables client\
>> -                   ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
>> +                   ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd', d)} \
>>                     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
>> +                   ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi ${WIRELESS_DAEMON}', '', d)} \
>> "
> 
> This is over-complicating things.  Why is the wifi daemon a special configuration option?  Just have wpa_supplicant in the default PACKAGECONFIG, and people who want to use iwd can set PACKAGECONFIG.
> 
>> +PACKAGECONFIG[wpa_supplicant] = ",,wpa-supplicant,wpa-supplicant"
>> +# iwd would be required as a runtime dependency. it is nevertheless given as a recommendation because the recipe for it
>> +# is not included in oe-core.
>> +PACKAGECONFIG[iwd] = "--enable-iwd,--disable-iwd,,,iwd"
> 
> This definitely should be RDEPENDS.
> 
> Note that if wpa_supplicant and iwd are mutually exclusive, you can express that in the PACKAGECONFIG:
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.yoctoproject.org_ref-2Dmanual_variables.html-3F-23term-2DPACKAGECONFIG&d=DwIFAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=8HjNGWSBnokVx86ZXb1HGtJWTl97isWyKhlw05xayeDV2PeizRV-8Et7M2oILR6A&s=SRukmgE6s_F_GQ3lRKUJZhJHBYIoHdF3lYfYPaNoS8E&e=
> 

 From the comment " For smooth operation it would be best to start only 
one wireless daemon at a time." I gathered that both can be enabled at once.

If we had --disable-wifi in PACKAGECONFIG[iwd] or 
PACKAGECONFIG[wpa_supplicant], we would be forced to have both or none 
since it would be part of the PACKAGECONFIG_CONFARGS if one is disabled.

If support for both at once is not supported by connman, then the wifi 
PACKAGECONFIG is unnecessary indeed.

Cheers,
Quentin
Markus Volk Aug. 25, 2022, 3:36 p.m. UTC | #3
Am Do, 25. Aug 2022 um 16:59:58 +0200 schrieb Quentin Schulz 
<quentin.schulz@theobroma-systems.com>:
> From the comment " For smooth operation it would be best to start 
> only one wireless daemon at a time." I gathered that both can be 
> enabled at once.

Correct. Connman doesn't really care if both wpa_supplicant and iwd are 
running. It's just that it then defaults to using wpa_supplicant. So to 
have a working out-of-box experience for iwd, you would either have to 
make them mutually exclusive, or change the Connman default 
configuration for iwd during installation.

I made this additional configure option to try to make it more visible 
that a decision should be made here. Additionally, the wireless daemon 
could be selected in a nicer way from a bbappend or e.g. local.conf.

If wpa_supplicant is preset in PACKAGECONFIG, we would always have to 
do a PACKAGECONFIG:remove for it.

For example, if we override this option in local.conf or distro.conf, 
we can make this decision visible to other recipes that might depend on 
this setting.
Markus Volk Aug. 25, 2022, 6:36 p.m. UTC | #4
Am Do, 25. Aug 2022 um 12:17:06 +0000 schrieb Ross Burton 
<ross.burton@arm.com>:
> Note that if wpa_supplicant and iwd are mutually exclusive, you can 
> express that in the PACKAGECONFIG:

I didn't want to make the decision whether wpa_supplicant and iwd 
should be mutually exclusive. Although I think mixed operation is 
nonsensical, it will probably be possible with the appropriate 
configuration.

Just let me know if you want me to add it as rconflict in PACKAGECONFIG
diff mbox series

Patch

diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index 5880ecd5d4..4b0c8a2c9f 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -28,10 +28,15 @@  EXTRA_OECONF += "\
     --enable-tools \
     --disable-polkit \
 "
+# For smooth operation it would be best to start only one wireless daemon at a time.
+# If wpa_supplicant is running, connman will use it preferentially.
+# Select either wpa_supplicant or iwd
+WIRELESS_DAEMON ??= "wpa_supplicant"
 
 PACKAGECONFIG ??= "wispr iptables client\
-                   ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi ${WIRELESS_DAEMON}', '', d)} \
 "
 
 # If you want ConnMan to support VPN, add following statement into
@@ -39,9 +44,13 @@  PACKAGECONFIG ??= "wispr iptables client\
 # PACKAGECONFIG:append:pn-connman = " openvpn vpnc l2tp pptp"
 
 PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_system_unitdir}/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''"
-PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant, wpa-supplicant"
+PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi"
 PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5, bluez5"
 PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono"
+PACKAGECONFIG[wpa_supplicant] = ",,wpa-supplicant,wpa-supplicant"
+# iwd would be required as a runtime dependency. it is nevertheless given as a recommendation because the recipe for it
+# is not included in oe-core.
+PACKAGECONFIG[iwd] = "--enable-iwd,--disable-iwd,,,iwd"
 PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
 PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
 PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc"