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'.
This commit is contained in:
parent
b523b034e2
commit
ef20acae83
1 changed files with 7 additions and 18 deletions
|
@ -13,6 +13,7 @@
|
||||||
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;; Copyright © 2019 Sou Bunnbu <iyzsong@member.fsf.org>
|
;;; Copyright © 2019 Sou Bunnbu <iyzsong@member.fsf.org>
|
||||||
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
|
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
|
||||||
|
;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
#:use-module (gnu services base)
|
#:use-module (gnu services base)
|
||||||
#:use-module (gnu services configuration)
|
#:use-module (gnu services configuration)
|
||||||
|
#:use-module (gnu services linux)
|
||||||
#:use-module (gnu services shepherd)
|
#:use-module (gnu services shepherd)
|
||||||
#:use-module (gnu services dbus)
|
#:use-module (gnu services dbus)
|
||||||
#:use-module (gnu system shadow)
|
#:use-module (gnu system shadow)
|
||||||
|
@ -1442,10 +1444,10 @@ simulation."
|
||||||
(append (hostapd-shepherd-services config
|
(append (hostapd-shepherd-services config
|
||||||
#:requirement
|
#:requirement
|
||||||
'(unblocked-wifi
|
'(unblocked-wifi
|
||||||
mac-simulation-module))
|
kernel-module-loader))
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(provision '(unblocked-wifi))
|
(provision '(unblocked-wifi))
|
||||||
(requirement '(file-systems mac-simulation-module))
|
(requirement '(file-systems kernel-module-loader))
|
||||||
(documentation
|
(documentation
|
||||||
"Unblock WiFi devices for use by mac80211_hwsim.")
|
"Unblock WiFi devices for use by mac80211_hwsim.")
|
||||||
(start #~(lambda _
|
(start #~(lambda _
|
||||||
|
@ -1453,21 +1455,6 @@ simulation."
|
||||||
"unblock" "0")
|
"unblock" "0")
|
||||||
(invoke #$(file-append util-linux "/sbin/rfkill")
|
(invoke #$(file-append util-linux "/sbin/rfkill")
|
||||||
"unblock" "1")))
|
"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)))))
|
(one-shot? #t)))))
|
||||||
|
|
||||||
(define simulated-wifi-service-type
|
(define simulated-wifi-service-type
|
||||||
|
@ -1475,7 +1462,9 @@ simulation."
|
||||||
(name 'simulated-wifi)
|
(name 'simulated-wifi)
|
||||||
(extensions
|
(extensions
|
||||||
(list (service-extension shepherd-root-service-type
|
(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
|
(default-value (hostapd-configuration
|
||||||
(interface "wlan1")
|
(interface "wlan1")
|
||||||
(ssid "Test Network")))
|
(ssid "Test Network")))
|
||||||
|
|
Reference in a new issue