From patchwork Sat Jan 14 01:47:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Declan Tsien X-Patchwork-Id: 46104 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0B75827BBEB; Sat, 14 Jan 2023 01:48:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ADDCF27BBE9 for ; Sat, 14 Jan 2023 01:48:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGVeN-0001S3-IW; Fri, 13 Jan 2023 20:48:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGVeM-0001Rv-Pc for guix-patches@gnu.org; Fri, 13 Jan 2023 20:48:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGVeM-00019B-Gq for guix-patches@gnu.org; Fri, 13 Jan 2023 20:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGVeM-0000CM-6W for guix-patches@gnu.org; Fri, 13 Jan 2023 20:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60800] [PATCH] services: connman: Add option to disable wpa-supplicant. Resent-From: Declan Tsien Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Jan 2023 01:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60800 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60800@debbugs.gnu.org Cc: Bruno Victal X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1673660857574 (code B ref -1); Sat, 14 Jan 2023 01:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2023 01:47:37 +0000 Received: from localhost ([127.0.0.1]:52852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGVdw-000099-Nw for submit@debbugs.gnu.org; Fri, 13 Jan 2023 20:47:37 -0500 Received: from lists.gnu.org ([209.51.188.17]:40316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGVdt-00008v-QY for submit@debbugs.gnu.org; Fri, 13 Jan 2023 20:47:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGVdt-0001QJ-LB for guix-patches@gnu.org; Fri, 13 Jan 2023 20:47:33 -0500 Received: from mx0.riseup.net ([198.252.153.6]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGVdr-00017h-Pf for guix-patches@gnu.org; Fri, 13 Jan 2023 20:47:33 -0500 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4Nv1PZ0vxWz9slr; Sat, 14 Jan 2023 01:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1673660850; bh=wP5W3WFHYYg/07SRU5lf/NJ5rgdZpUe5u1wd6NhdAc4=; h=From:To:Cc:Subject:Date:From; b=G+wGMvfsCyng/ik6NfzbNGkqUM/2EEuUd7RcKpY3KVLBzOLqcvoEkkEuqNeoQ66vd g0bh3C4OkrTVEAY7EKLqEySuK+Q5Ptkx0iuQWXr3yRpWmRqr2zP+RQ6FQaGmkecgI1 h8VBkUFNP7hkrQ3o67tGtubDYVLmojt2BOtT37a4= X-Riseup-User-ID: 54C687042E1A2F807EC19783FD5474CF8711D1A3BDAE63DA7950DFDC662BBA83 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4Nv1PY27jlz5vSS; Sat, 14 Jan 2023 01:47:29 +0000 (UTC) From: Declan Tsien Date: Sat, 14 Jan 2023 09:47:22 +0800 Message-ID: <87sfgdanv9.fsf@riseup.net> MIME-Version: 1.0 Received-SPF: pass client-ip=198.252.153.6; envelope-from=declantsien@riseup.net; helo=mx0.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches I am starting a new thread and will close the old one, since the subject changed. Not sure this is the right way. This is a follow-up of https://issues.guix.gnu.org/60752 As Bruno Victal 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 This patch allows users to disable wireless adapters or hook in a another implementation like iwd, without breaking existing installations. From 379d4afac343101a2351bab4f314496395828d8d Mon Sep 17 00:00:00 2001 From: Declan Tsien 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 ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2022 Andrew Tropin +;;; Copyright © 2023 Declan Tsien ;;; ;;; This file is part of GNU Guix. ;;; @@ -1262,10 +1263,12 @@ (define network-manager-service-type (define-record-type* 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