services: connman: Deprecate 'iwd?' field.
* gnu/services/networking.scm (<connman-configuration>) [iwd?]: Use helper to warn deprecated field. (connman-shepherd-service): Make iwd? a local variable independent from the deprecated field. * doc/guix.texi (Networking Setup): Remove mention of iwd? field. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
		
							parent
							
								
									269871d18e
								
							
						
					
					
						commit
						17c80118fa
					
				
					 2 changed files with 27 additions and 23 deletions
				
			
		| 
						 | 
					@ -19926,8 +19926,6 @@ networks.
 | 
				
			||||||
@item @code{disable-vpn?} (default: @code{#f})
 | 
					@item @code{disable-vpn?} (default: @code{#f})
 | 
				
			||||||
When true, disable connman's vpn plugin.
 | 
					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 table
 | 
				
			||||||
@end deftp
 | 
					@end deftp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1294,7 +1294,8 @@ wireless networking."))))
 | 
				
			||||||
  (disable-vpn? connman-configuration-disable-vpn?
 | 
					  (disable-vpn? connman-configuration-disable-vpn?
 | 
				
			||||||
                (default #f))
 | 
					                (default #f))
 | 
				
			||||||
  (iwd?         connman-configuration-iwd?
 | 
					  (iwd?         connman-configuration-iwd?
 | 
				
			||||||
                (default #f)))
 | 
					                (default #f)
 | 
				
			||||||
 | 
					                (sanitize warn-iwd?-field-deprecation)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define (connman-activation config)
 | 
					(define (connman-activation config)
 | 
				
			||||||
  (let ((disable-vpn? (connman-configuration-disable-vpn? config)))
 | 
					  (let ((disable-vpn? (connman-configuration-disable-vpn? config)))
 | 
				
			||||||
| 
						 | 
					@ -1308,27 +1309,32 @@ wireless networking."))))
 | 
				
			||||||
(define (connman-shepherd-service config)
 | 
					(define (connman-shepherd-service config)
 | 
				
			||||||
  (match-record config <connman-configuration> (connman shepherd-requirement
 | 
					  (match-record config <connman-configuration> (connman shepherd-requirement
 | 
				
			||||||
                                                disable-vpn? iwd?)
 | 
					                                                disable-vpn? iwd?)
 | 
				
			||||||
    (list (shepherd-service
 | 
					    (let ((iwd? (or iwd?  ; TODO: deprecated field, remove later.
 | 
				
			||||||
           (documentation "Run Connman")
 | 
					                    (and shepherd-requirement
 | 
				
			||||||
           (provision '(networking))
 | 
					                         (memq 'iwd shepherd-requirement)))))
 | 
				
			||||||
           (requirement `(user-processes dbus-system loopback
 | 
					      (list (shepherd-service
 | 
				
			||||||
                          ,@shepherd-requirement
 | 
					             (documentation "Run Connman")
 | 
				
			||||||
                          ,@(if iwd? '(iwd) '())))
 | 
					             (provision '(networking))
 | 
				
			||||||
           (start #~(make-forkexec-constructor
 | 
					             (requirement `(user-processes dbus-system loopback
 | 
				
			||||||
                     (list (string-append #$connman
 | 
					                                           ,@shepherd-requirement
 | 
				
			||||||
                                          "/sbin/connmand")
 | 
					                                           ;; TODO: iwd? is deprecated and should be passed
 | 
				
			||||||
                           "--nodaemon"
 | 
					                                           ;; with shepherd-requirement, remove later.
 | 
				
			||||||
                           "--nodnsproxy"
 | 
					                                           ,@(if iwd? '(iwd) '())))
 | 
				
			||||||
                           #$@(if disable-vpn? '("--noplugin=vpn") '())
 | 
					             (start #~(make-forkexec-constructor
 | 
				
			||||||
                           #$@(if iwd? '("--wifi=iwd_agent") '()))
 | 
					                       (list (string-append #$connman
 | 
				
			||||||
 | 
					                                            "/sbin/connmand")
 | 
				
			||||||
 | 
					                             "--nodaemon"
 | 
				
			||||||
 | 
					                             "--nodnsproxy"
 | 
				
			||||||
 | 
					                             #$@(if disable-vpn? '("--noplugin=vpn") '())
 | 
				
			||||||
 | 
					                             #$@(if iwd? '("--wifi=iwd_agent") '()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                     ;; As connman(8) notes, when passing '-n', connman
 | 
					                       ;; As connman(8) notes, when passing '-n', connman
 | 
				
			||||||
                     ;; "directs log output to the controlling terminal in
 | 
					                       ;; "directs log output to the controlling terminal in
 | 
				
			||||||
                     ;; addition to syslog."  Redirect stdout and stderr
 | 
					                       ;; addition to syslog."  Redirect stdout and stderr
 | 
				
			||||||
                     ;; to avoid spamming the console (XXX: for some reason
 | 
					                       ;; to avoid spamming the console (XXX: for some reason
 | 
				
			||||||
                     ;; redirecting to /dev/null doesn't work.)
 | 
					                       ;; redirecting to /dev/null doesn't work.)
 | 
				
			||||||
                     #:log-file "/var/log/connman.log"))
 | 
					                       #:log-file "/var/log/connman.log"))
 | 
				
			||||||
           (stop #~(make-kill-destructor))))))
 | 
					             (stop #~(make-kill-destructor)))))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define %connman-log-rotation
 | 
					(define %connman-log-rotation
 | 
				
			||||||
  (list (log-rotation
 | 
					  (list (log-rotation
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue