From 6f8f13e941e0743d0c367baa7d5fa683d437f6bc Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 2 Jul 2020 23:20:03 +0200 Subject: services: wpa-supplicant: Do not export the record. * gnu/services/networking.scm: Remove from exports. --- gnu/services/networking.scm | 1 - 1 file changed, 1 deletion(-) (limited to 'gnu/services/networking.scm') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index d6b0aee357b..bd01df1ba7a 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -130,7 +130,6 @@ usb-modeswitch-configuration-usb-modeswitch-data usb-modeswitch-service-type - wpa-supplicant-configuration wpa-supplicant-configuration? wpa-supplicant-configuration-wpa-supplicant -- cgit v1.3 From 4d06076714f03da55d09efede055f0c40da3403e Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 25 Jun 2020 00:33:38 +0200 Subject: services: wpa-supplicant: Support specifying additional service dependencies. * gnu/services/networking.scm ()[requirement]: New parameter. (wpa-supplicant-shepherd-service): Use it instead of hard-coded list. * doc/guix.texi (Networking Services): Document accordingly. --- doc/guix.texi | 3 +++ gnu/services/networking.scm | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'gnu/services/networking.scm') diff --git a/doc/guix.texi b/doc/guix.texi index 78233676053..ce17c2de8e8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14172,6 +14172,9 @@ It takes the following parameters: @item @code{wpa-supplicant} (default: @code{wpa-supplicant}) The WPA Supplicant package to use. +@item @code{requirement} (default: @code{'(user-processes dbus-system loopback syslogd)} +List of services that should be started before WPA Supplicant starts. + @item @code{dbus?} (default: @code{#t}) Whether to listen for requests on D-Bus. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index bd01df1ba7a..348dc369d8d 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -133,6 +133,7 @@ wpa-supplicant-configuration wpa-supplicant-configuration? wpa-supplicant-configuration-wpa-supplicant + wpa-supplicant-configuration-requirement wpa-supplicant-configuration-pid-file wpa-supplicant-configuration-dbus? wpa-supplicant-configuration-interface @@ -1319,6 +1320,8 @@ whatever the thing is supposed to do)."))) wpa-supplicant-configuration? (wpa-supplicant wpa-supplicant-configuration-wpa-supplicant ; (default wpa-supplicant)) + (requirement wpa-supplicant-configuration-requirement ;list of symbols + (default '(user-processes dbus-system loopback syslogd))) (pid-file wpa-supplicant-configuration-pid-file ;string (default "/var/run/wpa_supplicant.pid")) (dbus? wpa-supplicant-configuration-dbus? ;Boolean @@ -1332,12 +1335,12 @@ whatever the thing is supposed to do)."))) (define wpa-supplicant-shepherd-service (match-lambda - (($ wpa-supplicant pid-file dbus? interface - config-file extra-options) + (($ wpa-supplicant requirement pid-file dbus? + interface config-file extra-options) (list (shepherd-service (documentation "Run the WPA supplicant daemon") (provision '(wpa-supplicant)) - (requirement '(user-processes dbus-system loopback syslogd)) + (requirement requirement) (start #~(make-forkexec-constructor (list (string-append #$wpa-supplicant "/sbin/wpa_supplicant") -- cgit v1.3 From ef20acae83af8189df3225bdf59c5a0c1ae7da45 Mon Sep 17 00:00:00 2001 From: Brice Waegeneire Date: Thu, 14 May 2020 18:44:15 +0200 Subject: services: simulated-wifi: Use 'kernel-module-loader'. * gnu/services/networking.scm (simulated-wifi-shepherd-services): Change 'mac-simulation-module' service to use 'kernel-module-loader'. --- gnu/services/networking.scm | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'gnu/services/networking.scm') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 348dc369d8d..353fdce2bb6 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2019 Sou Bunnbu ;;; Copyright © 2019 Alex Griffin +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,7 @@ #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services configuration) + #:use-module (gnu services linux) #:use-module (gnu services shepherd) #:use-module (gnu services dbus) #:use-module (gnu system shadow) @@ -1442,10 +1444,10 @@ simulation." (append (hostapd-shepherd-services config #:requirement '(unblocked-wifi - mac-simulation-module)) + kernel-module-loader)) (list (shepherd-service (provision '(unblocked-wifi)) - (requirement '(file-systems mac-simulation-module)) + (requirement '(file-systems kernel-module-loader)) (documentation "Unblock WiFi devices for use by mac80211_hwsim.") (start #~(lambda _ @@ -1453,21 +1455,6 @@ simulation." "unblock" "0") (invoke #$(file-append util-linux "/sbin/rfkill") "unblock" "1"))) - (one-shot? #t)) - (shepherd-service - (provision '(mac-simulation-module)) - (requirement '(file-systems)) - (modules '((guix build utils))) - (documentation - "Load the mac80211_hwsim Linux kernel module.") - (start (with-imported-modules '((guix build utils)) - #~(lambda _ - ;; XXX: We can't use 'load-linux-module*' here because it - ;; expects a flat module directory. - (setenv "LINUX_MODULE_DIRECTORY" - "/run/booted-system/kernel/lib/modules") - (invoke #$(file-append kmod "/bin/modprobe") - "mac80211_hwsim")))) (one-shot? #t))))) (define simulated-wifi-service-type @@ -1475,7 +1462,9 @@ simulation." (name 'simulated-wifi) (extensions (list (service-extension shepherd-root-service-type - simulated-wifi-shepherd-services))) + simulated-wifi-shepherd-services) + (service-extension kernel-module-loader-service-type + (const '("mac80211_hwsim"))))) (default-value (hostapd-configuration (interface "wlan1") (ssid "Test Network"))) -- cgit v1.3