all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#60752] [PATCH] services: connman: Add iwd backend support.
@ 2023-01-12 12:56 ` Declan Tsien
  2023-01-12 14:12   ` Bruno Victal
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Declan Tsien @ 2023-01-12 12:56 UTC (permalink / raw)
  To: 60752


[-- Attachment #1.1: 0001-services-connman-Add-iwd-backend-support.patch --]
[-- Type: text/x-patch, Size: 3251 bytes --]

From d15947bcbfd16b1509df555a2b05a5639dec923a Mon Sep 17 00:00:00 2001
From: Declan Tsien <declantsien@riseup.net>
Date: Thu, 12 Jan 2023 18:37:51 +0800
Subject: [PATCH] services: connman: Add iwd backend support.

* gnu/services/networking.scm (connman-configuration)[iwd?]: New
field.
(connman-shepherd-service): Applied iwd? logic.
* doc/guix.texi: Add information about connman-configuration iwd? option.
---
 doc/guix.texi               |  3 +++
 gnu/services/networking.scm | 13 +++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 751d0957d8..ac483dacb9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19726,6 +19726,9 @@ The connman package to use.
 
 @item @code{disable-vpn?} (default: @code{#f})
 When true, disable connman's vpn plugin.
+
+@item @code{iwd?} (default: @code{#f})
+When true, ConnMan uses iwd to connect to wireless networks.
 @end table
 @end deftp
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 702404bc6c..f24c8f7063 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2022 Andrew Tropin <andrew@trop.in>
+;;; Copyright © 2022 Declan Tsien <declantsien@riseup.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1265,7 +1266,8 @@ (define-record-type* <connman-configuration>
   (connman      connman-configuration-connman
                 (default connman))
   (disable-vpn? connman-configuration-disable-vpn?
-                (default #f)))
+                (default #f))
+  (iwd? connman-configuration-iwd? (default #f)))
 
 (define (connman-activation config)
   (let ((disable-vpn? (connman-configuration-disable-vpn? config)))
@@ -1281,18 +1283,21 @@ (define (connman-shepherd-service config)
   (and
    (connman-configuration? config)
    (let ((connman      (connman-configuration-connman config))
-         (disable-vpn? (connman-configuration-disable-vpn? config)))
+         (disable-vpn? (connman-configuration-disable-vpn? config))
+         (iwd? (connman-configuration-iwd? config)))
      (list (shepherd-service
             (documentation "Run Connman")
             (provision '(networking))
             (requirement
-             '(user-processes dbus-system loopback wpa-supplicant))
+             (append '(user-processes dbus-system loopback)
+                     (if iwd? '(iwd) '(wpa-supplicant))))
             (start #~(make-forkexec-constructor
                       (list (string-append #$connman
                                            "/sbin/connmand")
                             "--nodaemon"
                             "--nodnsproxy"
-                            #$@(if disable-vpn? '("--noplugin=vpn") '()))
+                            #$@(if disable-vpn? '("--noplugin=vpn") '())
+                            #$@(if iwd? '("--wifi=iwd_agent") '()))
 
                       ;; As connman(8) notes, when passing '-n', connman
                       ;; "directs log output to the controlling terminal in
-- 
2.38.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* [bug#60752] [PATCH] services: connman: Add iwd backend support.
  2023-01-12 12:56 ` [bug#60752] [PATCH] services: connman: Add iwd backend support Declan Tsien
@ 2023-01-12 14:12   ` Bruno Victal
  2023-01-12 14:31     ` Declan Tsien
  2023-01-14  1:17   ` [bug#60752] [Declan Tsien] Re: [bug#60752] [PATCH] services: connman: Add option to disable wpa-supplicant Declan Tsien
  2023-01-14  1:54   ` bug#60752: Declan Tsien
  2 siblings, 1 reply; 9+ messages in thread
From: Bruno Victal @ 2023-01-12 14:12 UTC (permalink / raw)
  To: 60752; +Cc: declantsien

Hi,

Does connman absolutely require a wireless adapter backend?
IMO if that's not the case, neither iwd nor wpa-supplicant backends should be pulled by connman. (or at least they should be required only if they are present among the services field)
This is because not every machine comes or wants to use a wireless adapter.


Cheers,
Bruno




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

* [bug#60752] [PATCH] services: connman: Add iwd backend support.
  2023-01-12 14:12   ` Bruno Victal
@ 2023-01-12 14:31     ` Declan Tsien
  2023-01-12 14:53       ` Bruno Victal
  0 siblings, 1 reply; 9+ messages in thread
From: Declan Tsien @ 2023-01-12 14:31 UTC (permalink / raw)
  To: 60752; +Cc: Bruno Victal

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

Bruno Victal <mirai@makinata.eu> writes:

>
> IMO if that's not the case, neither iwd nor wpa-supplicant backends should be pulled by connman. (or at least they should be required only if they are present among the services field)
> This is because not every machine comes or wants to use a wireless adapter.
>

Right, are you suggesting removing wpa-supplicant from requirement
field?

Yeah, it would make more sense and fit my needs too.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* [bug#60752] [PATCH] services: connman: Add iwd backend support.
  2023-01-12 14:31     ` Declan Tsien
@ 2023-01-12 14:53       ` Bruno Victal
  2023-01-12 15:22         ` Declan Tsien
  0 siblings, 1 reply; 9+ messages in thread
From: Bruno Victal @ 2023-01-12 14:53 UTC (permalink / raw)
  To: Declan Tsien, 60752

On 2023-01-12 14:31, Declan Tsien wrote:
> Bruno Victal <mirai@makinata.eu> writes:
> 
>>
>> IMO if that's not the case, neither iwd nor wpa-supplicant backends should be pulled by connman. (or at least they should be required only if they are present among the services field)
>> This is because not every machine comes or wants to use a wireless adapter.
>>
> 
> Right, are you suggesting removing wpa-supplicant from requirement
> field?

If that's possible, yes.




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

* [bug#60752] [PATCH] services: connman: Add iwd backend support.
  2023-01-12 14:53       ` Bruno Victal
@ 2023-01-12 15:22         ` Declan Tsien
  0 siblings, 0 replies; 9+ messages in thread
From: Declan Tsien @ 2023-01-12 15:22 UTC (permalink / raw)
  To: Bruno Victal; +Cc: 60752

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

Bruno Victal <mirai@makinata.eu> writes:

> On 2023-01-12 14:31, Declan Tsien wrote:
>> Bruno Victal <mirai@makinata.eu> writes:
>> 
>>>
>>> IMO if that's not the case, neither iwd nor wpa-supplicant backends should be pulled by connman. (or at least they should be required only if they are present among the services field)
>>> This is because not every machine comes or wants to use a wireless adapter.
>>>
>> 
>> Right, are you suggesting removing wpa-supplicant from requirement
>> field?
>
> If that's possible, yes.

I think that is a question for people with more knowledge in this regard.

But to my experiencing using connman and iwd. I think it's OK.
Now I am running these two shepherd services separately

- connman (without wpa-supplicant and iwd)
- iwd

This patch can be closed without applying.

Thanks for clarifying things for me.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* [bug#60752] [Declan Tsien] Re: [bug#60752] [PATCH] services: connman: Add option to disable wpa-supplicant.
  2023-01-12 12:56 ` [bug#60752] [PATCH] services: connman: Add iwd backend support Declan Tsien
  2023-01-12 14:12   ` Bruno Victal
@ 2023-01-14  1:17   ` Declan Tsien
  2023-01-14  1:54   ` bug#60752: Declan Tsien
  2 siblings, 0 replies; 9+ messages in thread
From: Declan Tsien @ 2023-01-14  1:17 UTC (permalink / raw)
  To: 60752


[-- Attachment #1.1: Type: text/plain, Size: 281 bytes --]


-------------------- Start of forwarded message --------------------
From: Declan Tsien <declantsien@riseup.net>
To: Bruno Victal <mirai@makinata.eu>
Subject: Re: [bug#60752] [PATCH] services: connman: Add option to disable
 wpa-supplicant.
Date: Sat, 14 Jan 2023 09:13:50 +0800


[-- Attachment #1.2.1.1: Type: text/plain, Size: 422 bytes --]

Bruno Victal <mirai@makinata.eu> writes:

> Hi,
>
> Does connman absolutely require a wireless adapter backend?
> IMO if that's not the case, neither iwd nor wpa-supplicant backends should be pulled by connman. (or at least they should be required only if they are present among the services field)
> This is because not every machine comes or wants to use a wireless adapter.
>
>
> Cheers,
> Bruno

Hi,
what about this.


[-- Attachment #1.2.1.2: services: connman: Add option to disable wpa-supplicant. --]
[-- Type: text/x-patch, Size: 3549 bytes --]

From 379d4afac343101a2351bab4f314496395828d8d Mon Sep 17 00:00:00 2001
From: Declan Tsien <declantsien@riseup.net>
Date: Sat, 14 Jan 2023 08:57:02 +0800
Subject: [PATCH] services: connman: Add option to disable wpa-supplicant.

* gnu/services/networking.scm
(connman-configuration)[disable-wpa-supplicant?]: New field.
(connman-shepherd-service): Applied disable-wpa-supplicant? logic.

* doc/guix.texi: Add information about connman-configuration
disable-wpa-supplicant? option.
---
 doc/guix.texi               |  4 ++++
 gnu/services/networking.scm | 20 ++++++++++++--------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 751d0957d8..29be830bd4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19726,6 +19726,10 @@ The connman package to use.
 
 @item @code{disable-vpn?} (default: @code{#f})
 When true, disable connman's vpn plugin.
+
+@item @code{disable-wpa-supplicant?} (default: @code{#f})
+When true, remove @code{wpa-supplicant} requirement. Let users disable
+wireless adapters or hook in a another implementation like @code{iwd}.
 @end table
 @end deftp
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 702404bc6c..39162fe822 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2022 Andrew Tropin <andrew@trop.in>
+;;; Copyright © 2023 Declan Tsien <declantsien@riseup.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1262,10 +1263,12 @@ (define network-manager-service-type
 (define-record-type* <connman-configuration>
   connman-configuration make-connman-configuration
   connman-configuration?
-  (connman      connman-configuration-connman
-                (default connman))
-  (disable-vpn? connman-configuration-disable-vpn?
-                (default #f)))
+  (connman                 connman-configuration-connman
+                           (default connman))
+  (disable-vpn?            connman-configuration-disable-vpn?
+                           (default #f))
+  (disable-wpa-supplicant? connman-configuration-disable-wpa-supplicant?
+                           (default #f)))
 
 (define (connman-activation config)
   (let ((disable-vpn? (connman-configuration-disable-vpn? config)))
@@ -1280,13 +1283,14 @@ (define (connman-shepherd-service config)
   "Return a shepherd service for Connman"
   (and
    (connman-configuration? config)
-   (let ((connman      (connman-configuration-connman config))
-         (disable-vpn? (connman-configuration-disable-vpn? config)))
+   (let ((connman                 (connman-configuration-connman config))
+         (disable-vpn?            (connman-configuration-disable-vpn? config))
+         (disable-wpa-supplicant? (connman-configuration-disable-wpa-supplicant? config)))
      (list (shepherd-service
             (documentation "Run Connman")
             (provision '(networking))
-            (requirement
-             '(user-processes dbus-system loopback wpa-supplicant))
+            (requirement (append '(user-processes dbus-system loopback)
+                                 (if disable-wpa-supplicant? '() '(wpa-supplicant))))
             (start #~(make-forkexec-constructor
                       (list (string-append #$connman
                                            "/sbin/connmand")
-- 
2.38.1


[-- Attachment #1.2.1.3: Type: text/plain, Size: 129 bytes --]


This way, connman service can let users disable wireless adapters or hook
in a another implementation like iwd.

Cheers,
Declan

[-- Attachment #1.2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 67 bytes --]

-------------------- End of forwarded message --------------------

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* bug#60752:
  2023-01-12 12:56 ` [bug#60752] [PATCH] services: connman: Add iwd backend support Declan Tsien
  2023-01-12 14:12   ` Bruno Victal
  2023-01-14  1:17   ` [bug#60752] [Declan Tsien] Re: [bug#60752] [PATCH] services: connman: Add option to disable wpa-supplicant Declan Tsien
@ 2023-01-14  1:54   ` Declan Tsien
  2023-01-16 17:22     ` bug#60752: Andrew Tropin
  2 siblings, 1 reply; 9+ messages in thread
From: Declan Tsien @ 2023-01-14  1:54 UTC (permalink / raw)
  To: 60752-done

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


Started a new thread since the subject has changed
https://issues.guix.gnu.org/60800

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* bug#60752:
  2023-01-14  1:54   ` bug#60752: Declan Tsien
@ 2023-01-16 17:22     ` Andrew Tropin
  2023-01-17  0:30       ` [bug#60752] Declan Tsien
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Tropin @ 2023-01-16 17:22 UTC (permalink / raw)
  To: Declan Tsien, 60752-done

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

On 2023-01-14 09:54, Declan Tsien wrote:

> Started a new thread since the subject has changed
> https://issues.guix.gnu.org/60800

Let's keep the discussion in this thread, not to lose the context.

BTW, there is a retitle command for debbugs in case it necessary to
change the title of the bug. 


From what I see wpa-supplicant requirement is not needed, as Bruno
mentioned, there are use cases, where connman can be used without
wpa-supplicant or wireless backend at all.

According to the documentation I was able to find, to enable iwd support
--wifi=iwd_agent should be added to connmand, so I applied the first
patch with a few adjustments: Completely removed wpa-supplicant
requirement, realigned the code.  Unfortunately, I don't use connman and
can't easily check, Declan, could you please confirm that iwd is now
working correctly with connman?

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* [bug#60752]
  2023-01-16 17:22     ` bug#60752: Andrew Tropin
@ 2023-01-17  0:30       ` Declan Tsien
  0 siblings, 0 replies; 9+ messages in thread
From: Declan Tsien @ 2023-01-17  0:30 UTC (permalink / raw)
  To: Andrew Tropin; +Cc: 60752

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

Andrew Tropin <andrew@trop.in> writes:

> On 2023-01-14 09:54, Declan Tsien wrote:
>
>> Started a new thread since the subject has changed
>> https://issues.guix.gnu.org/60800
>
> Let's keep the discussion in this thread, not to lose the context.
>
> BTW, there is a retitle command for debbugs in case it necessary to
> change the title of the bug. 
>

Thanks.

>
> From what I see wpa-supplicant requirement is not needed, as Bruno
> mentioned, there are use cases, where connman can be used without
> wpa-supplicant or wireless backend at all.
>
> According to the documentation I was able to find, to enable iwd support
> --wifi=iwd_agent should be added to connmand, so I applied the first
> patch with a few adjustments: Completely removed wpa-supplicant
> requirement, realigned the code.  Unfortunately, I don't use connman and
> can't easily check, Declan, could you please confirm that iwd is now
> working correctly with connman?
>
> -- 
> Best regards,
> Andrew Tropin

Yeah, Its working.

In my case, --wifi=iwd_agent is not required either when using iwd.
But it should be useful when wpa-supplicant and iwd services are both
in the system.

Best regards,
Declan Tsien

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

end of thread, other threads:[~2023-01-17  0:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <874jstc3zl.fsf@riseup.net>
2023-01-12 12:56 ` [bug#60752] [PATCH] services: connman: Add iwd backend support Declan Tsien
2023-01-12 14:12   ` Bruno Victal
2023-01-12 14:31     ` Declan Tsien
2023-01-12 14:53       ` Bruno Victal
2023-01-12 15:22         ` Declan Tsien
2023-01-14  1:17   ` [bug#60752] [Declan Tsien] Re: [bug#60752] [PATCH] services: connman: Add option to disable wpa-supplicant Declan Tsien
2023-01-14  1:54   ` bug#60752: Declan Tsien
2023-01-16 17:22     ` bug#60752: Andrew Tropin
2023-01-17  0:30       ` [bug#60752] Declan Tsien

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.