[PATCH 0/2] Add ModemManager service.

DoneSubmitted by Danny Milosavljevic.
Details
3 participants
  • Björn Höfling
  • Danny Milosavljevic
  • Ludovic Courtès
Owner
unassigned
Severity
normal
D
D
Danny Milosavljevic wrote on 29 Mar 2018 20:28
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20180329182856.7509-1-dannym@scratchpost.org
Danny Milosavljevic (2): services: Add modem-manager-service-type. services: Add ModemManager to '%desktop-services'.
doc/guix.texi | 22 ++++++++++++++++++++++ gnu/services/desktop.scm | 1 + gnu/services/networking.scm | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+)
D
D
Danny Milosavljevic wrote on 29 Mar 2018 20:33
[PATCH 1/2] services: Add modem-manager-service-type.
(address . 30991@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20180329183347.7748-1-dannym@scratchpost.org
* gnu/services/networking.scm (modem-manager-service-type): New variable.(<modem-manager-configuration>): New variable.(modem-manager-configuration): New procedure.(modem-manager-configuration?): New procedure.* doc/guix.texi (Networking Services): Document it.--- doc/guix.texi | 22 ++++++++++++++++++++++ gnu/services/networking.scm | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+)
Toggle diff (100 lines)diff --git a/doc/guix.texi b/doc/guix.texiindex 25c08b9f0..23b7ae089 100644--- a/doc/guix.texi+++ b/doc/guix.texi@@ -10712,6 +10712,28 @@ several commands to interact with the daemon and configure networking: and @command{wicd-curses} user interfaces. @end deffn +@cindex ModemManager++@defvr {Scheme Variable} modem-manager-service-type+This is the service type for the+@uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager}+service. The value for this service type is a+@code{modem-manager-configuration} record.++This service is part of @code{%desktop-services} (@pxref{Desktop+Services}).+@end defvr++@deftp {Data Type} modem-manager-configuration+Data type representing the configuration of ModemManager.++@table @asis+@item @code{modem-manager} (default: @code{modem-manager})+The ModemManager package to use.++@end table+@end deftp+ @cindex NetworkManager @defvr {Scheme Variable} network-manager-service-typediff --git a/gnu/services/networking.scm b/gnu/services/networking.scmindex 6ac440fd2..660ec162b 100644--- a/gnu/services/networking.scm+++ b/gnu/services/networking.scm@@ -30,6 +30,7 @@ #:use-module (gnu system pam) #:use-module (gnu packages admin) #:use-module (gnu packages connman)+ #:use-module (gnu packages freedesktop) #:use-module (gnu packages linux) #:use-module (gnu packages tor) #:use-module (gnu packages messaging)@@ -90,6 +91,9 @@ connman-configuration? connman-service-type + modem-manager-configuration+ modem-manager-configuration?+ modem-manager-service-type wpa-supplicant-service-type openvswitch-service-type@@ -890,6 +894,17 @@ and @command{wicd-curses} user interfaces." (service wicd-service-type wicd)) +;;;+;;; ModemManager+;;;++(define-record-type* <modem-manager-configuration>+ modem-manager-configuration make-modem-manager-configuration+ modem-manager-configuration?+ (modem-manager modem-manager-configuration-modem-manager+ (default modem-manager)))++ ;;; ;;; NetworkManager ;;;@@ -1027,6 +1042,26 @@ wireless networking.")))) a network connection manager.")))) +;;;+;;; Modem manager+;;;++(define modem-manager-service-type+ (let ((config->package+ (match-lambda+ (($ <modem-manager-configuration> modem-manager)+ (list modem-manager)))))+ (service-type (name 'modem-manager)+ (extensions+ (list (service-extension dbus-root-service-type+ config->package)))+ (default-value (modem-manager-configuration))+ (description+ "Run @uref{https://wiki.gnome.org/Projects/ModemManager,+ModemManager}, a modem management daemon that aims to simplify dialup+networking."))))++ ;;; ;;; WPA supplicant ;;;
D
D
Danny Milosavljevic wrote on 29 Mar 2018 20:33
[PATCH 2/2] services: Add ModemManager to '%desktop-services'.
(address . 30991@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20180329183347.7748-2-dannym@scratchpost.org
* gnu/services/desktop.scm (%desktop-services): Add ModemManager.--- gnu/services/desktop.scm | 1 + 1 file changed, 1 insertion(+)
Toggle diff (12 lines)diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scmindex 897252917..00f5c105b 100644--- a/gnu/services/desktop.scm+++ b/gnu/services/desktop.scm@@ -898,6 +898,7 @@ with the administrator's password." (simple-service 'mtp udev-service-type (list libmtp)) ;; The D-Bus clique.+ (service modem-manager-service-type) (service network-manager-service-type) (service wpa-supplicant-service-type) ;needed by NetworkManager (avahi-service)
D
D
Danny Milosavljevic wrote on 29 Mar 2018 21:15
Re: [PATCH 0/2] Add ModemManager service.
(address . 30991@debbugs.gnu.org)
20180329210726.54ac0348@scratchpost.org
I'd also like to extend udev-service-type in modem-manager-service-type - but that would create a cycle (gnu services networking) - (gnu services base).
Can we fix this please?
A way is to move static-networking-service into (gnu services base).
Or move %base-services to a new module (gnu base-services) or whatever.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlq9OzkACgkQ5xo1VCwwuqXk+ggAlOnFdGAaO/osY0svXbWIcsTirbCtefQhHxwERNqXqGEH2086E15a7Tdj2R3k0SSlJ47crQseFgSKa091nFoHWBkI+kkMhHJfKwSuO2dwsOaS6CmhMIvH1W2Ll1F5YLdOKDsxAWJNpMXTLJPFabiLvp+mRAY86c9Ffgchlq/DrIst7sBnWkqC5d+RoIWa8lFNdUhMqGgbHsmk7PsE1xncZnplycmfAdc5hwWDwQ113SV1T4TmGWH5gav7bflLHosqm+9k71sHBnrjKcwU9amY/y69RrEkQVlZpM1bU8mM9MpVUx5HanhjNLk9uShcgg6y2MR4e8LBuhTksohJnevb9g===yC2k-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 30 Mar 2018 00:21
[PATCH v2 0/3] Add ModemManager service.
(address . 30991@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20180329222140.21590-1-dannym@scratchpost.org
Danny Milosavljevic (3): services: Move static-networking to (gnu services base). services: Add modem-manager-service-type. services: Add ModemManager to '%desktop-services'.
doc/guix.texi | 22 +++++ gnu/services/base.scm | 160 ++++++++++++++++++++++++++++++++++- gnu/services/desktop.scm | 1 + gnu/services/networking.scm | 199 +++++++++----------------------------------- 4 files changed, 222 insertions(+), 160 deletions(-)
D
D
Danny Milosavljevic wrote on 30 Mar 2018 00:21
[PATCH v2 1/3] services: Move static-networking to (gnu services base).
(address . 30991@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20180329222140.21590-2-dannym@scratchpost.org
* gnu/services/networking.scm (static-networking, static-networking?,static-networking-interface, static-networking-ip, static-networking-netmask,static-networking-gateway, static-networking-requirement,static-networking-service, static-networking-service-type): Move to...* gnu/services/base.scm: ...here.--- gnu/services/base.scm | 160 +++++++++++++++++++++++++++++++++++++++++++- gnu/services/networking.scm | 160 +------------------------------------------- 2 files changed, 160 insertions(+), 160 deletions(-)
Toggle diff (370 lines)diff --git a/gnu/services/base.scm b/gnu/services/base.scmindex be1bfce57..694aab882 100644--- a/gnu/services/base.scm+++ b/gnu/services/base.scm@@ -26,7 +26,6 @@ #:use-module (guix store) #:use-module (gnu services) #:use-module (gnu services shepherd)- #:use-module (gnu services networking) #:use-module (gnu system pam) #:use-module (gnu system shadow) ; 'user-account', etc. #:use-module (gnu system uuid)@@ -64,6 +63,18 @@ console-font-service virtual-terminal-service-type + static-networking++ static-networking?+ static-networking-interface+ static-networking-ip+ static-networking-netmask+ static-networking-gateway+ static-networking-requirement++ static-networking-service+ static-networking-service-type+ udev-configuration udev-configuration? udev-configuration-rules@@ -2045,6 +2056,153 @@ This service is not part of @var{%base-services}." (start #~(make-forkexec-constructor #$kmscon-command)) (stop #~(make-kill-destructor))))))) +(define-record-type* <static-networking>+ static-networking make-static-networking+ static-networking?+ (interface static-networking-interface)+ (ip static-networking-ip)+ (netmask static-networking-netmask+ (default #f))+ (gateway static-networking-gateway ;FIXME: doesn't belong here+ (default #f))+ (provision static-networking-provision+ (default #f))+ (requirement static-networking-requirement+ (default '()))+ (name-servers static-networking-name-servers ;FIXME: doesn't belong here+ (default '())))++(define static-networking-shepherd-service+ (match-lambda+ (($ <static-networking> interface ip netmask gateway provision+ requirement name-servers)+ (let ((loopback? (and provision (memq 'loopback provision))))+ (shepherd-service++ (documentation+ "Bring up the networking interface using a static IP address.")+ (requirement requirement)+ (provision (or provision+ (list (symbol-append 'networking-+ (string->symbol interface)))))++ (start #~(lambda _+ ;; Return #t if successfully started.+ (let* ((addr (inet-pton AF_INET #$ip))+ (sockaddr (make-socket-address AF_INET addr 0))+ (mask (and #$netmask+ (inet-pton AF_INET #$netmask)))+ (maskaddr (and mask+ (make-socket-address AF_INET+ mask 0)))+ (gateway (and #$gateway+ (inet-pton AF_INET #$gateway)))+ (gatewayaddr (and gateway+ (make-socket-address AF_INET+ gateway 0))))+ (configure-network-interface #$interface sockaddr+ (logior IFF_UP+ #$(if loopback?+ #~IFF_LOOPBACK+ 0))+ #:netmask maskaddr)+ (when gateway+ (let ((sock (socket AF_INET SOCK_DGRAM 0)))+ (add-network-route/gateway sock gatewayaddr)+ (close-port sock))))))+ (stop #~(lambda _+ ;; Return #f is successfully stopped.+ (let ((sock (socket AF_INET SOCK_STREAM 0)))+ (when #$gateway+ (delete-network-route sock+ (make-socket-address+ AF_INET INADDR_ANY 0)))+ (set-network-interface-flags sock #$interface 0)+ (close-port sock)+: #f)))+ (respawn? #f))))))++(define (static-networking-etc-files interfaces)+ "Return a /etc/resolv.conf entry for INTERFACES or the empty list."+ (match (delete-duplicates+ (append-map static-networking-name-servers+ interfaces))+ (()+ '())+ ((name-servers ...)+ (let ((content (string-join+ (map (cut string-append "nameserver " <>)+ name-servers)+ "\n" 'suffix)))+ `(("resolv.conf"+ ,(plain-file "resolv.conf"+ (string-append "\+# Generated by 'static-networking-service'.\n"+ content))))))))++(define (static-networking-shepherd-services interfaces)+ "Return the list of Shepherd services to bring up INTERFACES, a list of+<static-networking> objects."+ (define (loopback? service)+ (memq 'loopback (shepherd-service-provision service)))++ (let ((services (map static-networking-shepherd-service interfaces)))+ (match (remove loopback? services)+ (()+ ;; There's no interface other than 'loopback', so we assume that the+ ;; 'networking' service will be provided by dhclient or similar.+ services)+ ((non-loopback ...)+ ;; Assume we're providing all the interfaces, and thus, provide a+ ;; 'networking' service.+ (cons (shepherd-service+ (provision '(networking))+ (requirement (append-map shepherd-service-provision+ services))+ (start #~(const #t))+ (stop #~(const #f))+ (documentation "Bring up all the networking interfaces."))+ services)))))++(define static-networking-service-type+ ;; The service type for statically-defined network interfaces.+ (service-type (name 'static-networking)+ (extensions+ (list+ (service-extension shepherd-root-service-type+ static-networking-shepherd-services)+ (service-extension etc-service-type+ static-networking-etc-files)))+ (compose concatenate)+ (extend append)+ (description+ "Turn up the specified network interfaces upon startup,+with the given IP address, gateway, netmask, and so on. The value for+services of this type is a list of @code{static-networking} objects, one per+network interface.")))++(define* (static-networking-service interface ip+ #:key+ netmask gateway provision+ ;; Most interfaces require udev to be usable.+ (requirement '(udev))+ (name-servers '()))+ "Return a service that starts @var{interface} with address @var{ip}. If+@var{netmask} is true, use it as the network mask. If @var{gateway} is true,+it must be a string specifying the default network gateway.++This procedure can be called several times, one for each network+interface of interest. Behind the scenes what it does is extend+@code{static-networking-service-type} with additional network interfaces+to handle."+ (simple-service 'static-network-interface+ static-networking-service-type+ (list (static-networking (interface interface) (ip ip)+ (netmask netmask) (gateway gateway)+ (provision provision)+ (requirement requirement)+ (name-servers name-servers)))))+ (define %base-services ;; Convenience variable holding the basic services.diff --git a/gnu/services/networking.scm b/gnu/services/networking.scmindex 6ac440fd2..da96bbeb5 100644--- a/gnu/services/networking.scm+++ b/gnu/services/networking.scm@@ -24,6 +24,7 @@ (define-module (gnu services networking) #:use-module (gnu services)+ #:use-module (gnu services base) #:use-module (gnu services shepherd) #:use-module (gnu services dbus) #:use-module (gnu system shadow)@@ -45,17 +46,6 @@ #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (%facebook-host-aliases- static-networking-- static-networking?- static-networking-interface- static-networking-ip- static-networking-netmask- static-networking-gateway- static-networking-requirement-- static-networking-service- static-networking-service-type dhcp-client-service %ntp-servers @@ -134,154 +124,6 @@ fe80::1%lo0 connect.facebook.net fe80::1%lo0 www.connect.facebook.net fe80::1%lo0 apps.facebook.com\n") --(define-record-type* <static-networking>- static-networking make-static-networking- static-networking?- (interface static-networking-interface)- (ip static-networking-ip)- (netmask static-networking-netmask- (default #f))- (gateway static-networking-gateway ;FIXME: doesn't belong here- (default #f))- (provision static-networking-provision- (default #f))- (requirement static-networking-requirement- (default '()))- (name-servers static-networking-name-servers ;FIXME: doesn't belong here- (default '())))--(define static-networking-shepherd-service- (match-lambda- (($ <static-networking> interface ip netmask gateway provision- requirement name-servers)- (let ((loopback? (and provision (memq 'loopback provision))))- (shepherd-service-- (documentation- "Bring up the networking interface using a static IP address.")- (requirement requirement)- (provision (or provision- (list (symbol-append 'networking-- (string->symbol interface)))))-- (start #~(lambda _- ;; Return #t if successfully started.- (let* ((addr (inet-pton AF_INET #$ip))- (sockaddr (make-socket-address AF_INET addr 0))- (mask (and #$netmask- (inet-pton AF_INET #$netmask)))- (maskaddr (and mask- (make-socket-address AF_INET- mask 0)))- (gateway (and #$gateway- (inet-pton AF_INET #$gateway)))- (gatewayaddr (and gateway- (make-socket-address AF_INET- gateway 0))))- (configure-network-interface #$interface sockaddr- (logior IFF_UP- #$(if loopback?- #~IFF_LOOPBACK- 0))- #:netmask maskaddr)- (when gateway- (let ((sock (socket AF_INET SOCK_DGRAM 0)))- (add-network-route/gateway sock gatewayaddr)- (close-port sock))))))- (stop #~(lambda _- ;; Return #f is successfully stopped.- (let ((sock (socket AF_INET SOCK_STREAM 0)))- (when #$gateway- (delete-network-route sock- (make-socket-address- AF_INET INADDR_ANY 0)))- (set-network-interface-flags sock #$interface 0)- (close-port sock)- #f)))- (respawn? #f))))))--(define (static-networking-etc-files interfaces)- "Return a /etc/resolv.conf entry for INTERFACES or the empty list."- (match (delete-duplicates- (append-map static-networking-name-servers- interfaces))- (()- '())- ((name-servers ...)- (let ((content (string-join- (map (cut string-append "nameserver " <>)- name-servers)- "\n" 'suffix)))- `(("resolv.conf"- ,(plain-file "resolv.conf"- (string-append "\-# Generated by 'static-networking-service'.\n"- content))))))))--(define (static-networking-shepherd-services interfaces)- "Return the list of Shepherd services to bring up INTERFACES, a list of-<static-networking> objects."- (define (loopback? service)- (memq 'loopback (shepherd-service-provision service)))-- (let ((services (map static-networking-shepherd-service interfaces)))- (match (remove loopback? services)- (()- ;; There's no interface other than 'loopback', so we assume that the- ;; 'networking' service will be provided by dhclient or similar.- services)- ((non-loopback ...)- ;; Assume we're providing all the interfaces, and thus, provide a- ;; 'networking' service.- (cons (shepherd-service- (provision '(networking))- (requirement (append-map shepherd-service-provision- services))- (start #~(const #t))- (stop #~(const #f))- (documentation "Bring up all the networking interfaces."))- services)))))--(define static-networking-service-type- ;; The service type for statically-defined network interfaces.- (service-type (name 'static-networking)- (extensions- (list- (service-extension shepherd-root-service-type- static-networking-shepherd-services)- (service-extension etc-service-type- static-networking-etc-files)))- (compose concatenate)- (extend append)- (description- "Turn up the specified network interfaces upon startup,-with the given IP address, gateway, netmask, and so on. The value for-services of this type is a list of @code{static-networking} objects, one per-network interface.")))--(define* (static-networking-service interface ip- #:key- netmask gateway provision- ;; Most interfaces require udev to be usable.- (requirement '(udev))- (name-servers '()))- "Return a service that starts @var{interface} with address @var{ip}. If-@var{netmask} is true, use it as the network mask. If @var{gateway} is true,-it must be a string specifying the default network gateway.--This procedure can be called several times, one for each network-interface of interest. Behind the scenes what it does is extend-@code{static-networking-service-type} with additional network interfaces-to handle."- (simple-service 'static-network-interface- static-networking-service-type- (list (static-networking (interface interface) (ip ip)- (netmask netmask) (gateway gateway)- (provision provision)- (requirement requirement)- (name-servers name-servers)))))- (define dhcp-client-service-type (shepherd-service-type 'dhcp-client
D
D
Danny Milosavljevic wrote on 30 Mar 2018 00:21
[PATCH v2 2/3] services: Add modem-manager-service-type.
(address . 30991@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20180329222140.21590-3-dannym@scratchpost.org
* gnu/services/networking.scm (modem-manager-service-type): New variable.(<modem-manager-configuration>): New variable.(modem-manager-configuration): New procedure.(modem-manager-configuration?): New procedure.* doc/guix.texi (Networking Services): Document it.--- doc/guix.texi | 22 ++++++++++++++++++++++ gnu/services/networking.scm | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+)
Toggle diff (104 lines)diff --git a/doc/guix.texi b/doc/guix.texiindex 25c08b9f0..23b7ae089 100644--- a/doc/guix.texi+++ b/doc/guix.texi@@ -10712,6 +10712,28 @@ several commands to interact with the daemon and configure networking: and @command{wicd-curses} user interfaces. @end deffn +@cindex ModemManager++@defvr {Scheme Variable} modem-manager-service-type+This is the service type for the+@uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager}+service. The value for this service type is a+@code{modem-manager-configuration} record.++This service is part of @code{%desktop-services} (@pxref{Desktop+Services}).+@end defvr++@deftp {Data Type} modem-manager-configuration+Data type representing the configuration of ModemManager.++@table @asis+@item @code{modem-manager} (default: @code{modem-manager})+The ModemManager package to use.++@end table+@end deftp+ @cindex NetworkManager @defvr {Scheme Variable} network-manager-service-typediff --git a/gnu/services/networking.scm b/gnu/services/networking.scmindex da96bbeb5..5092a5f35 100644--- a/gnu/services/networking.scm+++ b/gnu/services/networking.scm@@ -31,6 +31,7 @@ #:use-module (gnu system pam) #:use-module (gnu packages admin) #:use-module (gnu packages connman)+ #:use-module (gnu packages freedesktop) #:use-module (gnu packages linux) #:use-module (gnu packages tor) #:use-module (gnu packages messaging)@@ -80,6 +81,9 @@ connman-configuration? connman-service-type + modem-manager-configuration+ modem-manager-configuration?+ modem-manager-service-type wpa-supplicant-service-type openvswitch-service-type@@ -732,6 +736,17 @@ and @command{wicd-curses} user interfaces." (service wicd-service-type wicd)) +;;;+;;; ModemManager+;;;++(define-record-type* <modem-manager-configuration>+ modem-manager-configuration make-modem-manager-configuration+ modem-manager-configuration?+ (modem-manager modem-manager-configuration-modem-manager+ (default modem-manager)))++ ;;; ;;; NetworkManager ;;;@@ -869,6 +884,30 @@ wireless networking.")))) a network connection manager.")))) +;;;+;;; Modem manager+;;;++(define modem-manager-service-type+ (let ((config->package+ (match-lambda+ (($ <modem-manager-configuration> modem-manager)+ (list modem-manager)))))+ (service-type (name 'modem-manager)+ (extensions+ (list (service-extension dbus-root-service-type+ config->package)+ (service-extension udev-service-type+ config->package)+ (service-extension polkit-service-type+ config->package)))+ (default-value (modem-manager-configuration))+ (description+ "Run @uref{https://wiki.gnome.org/Projects/ModemManager,+ModemManager}, a modem management daemon that aims to simplify dialup+networking."))))++ ;;; ;;; WPA supplicant ;;;
D
D
Danny Milosavljevic wrote on 30 Mar 2018 00:21
[PATCH v2 3/3] services: Add ModemManager to '%desktop-services'.
(address . 30991@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20180329222140.21590-4-dannym@scratchpost.org
* gnu/services/desktop.scm (%desktop-services): Add ModemManager.--- gnu/services/desktop.scm | 1 + 1 file changed, 1 insertion(+)
Toggle diff (12 lines)diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scmindex 897252917..00f5c105b 100644--- a/gnu/services/desktop.scm+++ b/gnu/services/desktop.scm@@ -898,6 +898,7 @@ with the administrator's password." (simple-service 'mtp udev-service-type (list libmtp)) ;; The D-Bus clique.+ (service modem-manager-service-type) (service network-manager-service-type) (service wpa-supplicant-service-type) ;needed by NetworkManager (avahi-service)
L
L
Ludovic Courtès wrote on 31 Mar 2018 18:08
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
878ta8kz24.fsf@gnu.org
Hello Danny,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
Toggle quote (2 lines)> * gnu/services/desktop.scm (%desktop-services): Add ModemManager.
I would not add it to ‘%desktop-services’ because I’d think it’s not avery common requirement, but I don’t know. WDYT?
Thanks,Ludo’.
L
L
Ludovic Courtès wrote on 31 Mar 2018 18:13
Re: [bug#30991] [PATCH v2 1/3] services: Move static-networking to (gnu services base).
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
87y3i8jk9e.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:
Toggle quote (6 lines)> * gnu/services/networking.scm (static-networking, static-networking?,> static-networking-interface, static-networking-ip, static-networking-netmask,> static-networking-gateway, static-networking-requirement,> static-networking-service, static-networking-service-type): Move to...> * gnu/services/base.scm: ...here.
What’s the reason? Is there a module cross-dependency issue orsomething?
Toggle quote (10 lines)> + (stop #~(lambda _> + ;; Return #f is successfully stopped.> + (let ((sock (socket AF_INET SOCK_STREAM 0)))> + (when #$gateway> + (delete-network-route sock> + (make-socket-address> + AF_INET INADDR_ANY 0)))> + (set-network-interface-flags sock #$interface 0)> + (close-port sock)> +: #f)))
^A cat walked on the keyboard. :-)
Ludo’.
L
L
Ludovic Courtès wrote on 31 Mar 2018 18:14
Re: [bug#30991] [PATCH v2 2/3] services: Add modem-manager-service-type.
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
87tvswjk8h.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:
Toggle quote (6 lines)> * gnu/services/networking.scm (modem-manager-service-type): New variable.> (<modem-manager-configuration>): New variable.> (modem-manager-configuration): New procedure.> (modem-manager-configuration?): New procedure.> * doc/guix.texi (Networking Services): Document it.
LGTM, thanks!
Ludo'.
B
B
Björn Höfling wrote on 31 Mar 2018 20:39
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
20180331203951.2c37405c@alma-ubu
On Fri, 30 Mar 2018 00:21:39 +0200Danny Milosavljevic <dannym@scratchpost.org> wrote:
Toggle quote (27 lines)> * gnu/services/networking.scm (modem-manager-service-type): New> variable. (<modem-manager-configuration>): New variable.> (modem-manager-configuration): New procedure.> (modem-manager-configuration?): New procedure.> * doc/guix.texi (Networking Services): Document it.> ---> doc/guix.texi | 22 ++++++++++++++++++++++> gnu/services/networking.scm | 39> +++++++++++++++++++++++++++++++++++++++ 2 files changed, 61> insertions(+)> > diff --git a/doc/guix.texi b/doc/guix.texi> index 25c08b9f0..23b7ae089 100644> --- a/doc/guix.texi> +++ b/doc/guix.texi> @@ -10712,6 +10712,28 @@ several commands to interact with the daemon> and configure networking: and @command{wicd-curses} user interfaces.> @end deffn> > +@cindex ModemManager> +> +@defvr {Scheme Variable} modem-manager-service-type> +This is the service type for the> +@uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager}> +service. The value for this service type is a> +@code{modem-manager-configuration} record.
See below ...
[..]
Toggle quote (5 lines)> diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm> index da96bbeb5..5092a5f35 100644> --- a/gnu/services/networking.scm> +++ b/gnu/services/networking.scm
[..]
Toggle quote (2 lines)> +(define modem-manager-service-type
[..]
Toggle quote (5 lines)> + (description> + "Run> @uref{https://wiki.gnome.org/Projects/ModemManager, +ModemManager}, a> modem management daemon that aims to simplify dialup +networking."))))
URL in texinfo and here: This page says only "This page does not existyet. You can create a new empty page, or use one of the page templates."
I found this one working, but it's the unstable version:
https://developer.gnome.org/ModemManager/unstable/
Björn
-----BEGIN PGP SIGNATURE-----Version: GnuPG v2
iEYEARECAAYFAlq/1fcACgkQvyhstlk+X/0j3gCgs+MXLTXaA/EJwijsglSaCTxH2sEAn1DVhXIKwtMwxMfjYDqdKvSROYrK=S4El-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 1 Apr 2018 10:16
Re: [bug#30991] [PATCH v2 1/3] services: Move static-networking to (gnu services base).
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 30991@debbugs.gnu.org)
20180401101607.31d695fa@scratchpost.org
Hi Ludo,
On Sat, 31 Mar 2018 18:13:33 +0200ludo@gnu.org (Ludovic Courtès) wrote:
Toggle quote (11 lines)> Danny Milosavljevic <dannym@scratchpost.org> skribis:> > > * gnu/services/networking.scm (static-networking, static-networking?,> > static-networking-interface, static-networking-ip, static-networking-netmask,> > static-networking-gateway, static-networking-requirement,> > static-networking-service, static-networking-service-type): Move to...> > * gnu/services/base.scm: ...here. > > What’s the reason? Is there a module cross-dependency issue or> something?
Yes, (gnu services base) uses (gnu services networking), and now I wantedto use (gnu services networking) in (gnu services base) - becauseI extend udev service and it's in the latter.
but I thought of a better way to resolve it: Just put modem-manager serviceinto (gnu services base) to begin with. Testing...
Toggle quote (4 lines)> > +: #f))) > ^> A cat walked on the keyboard. :-)
Hehe, oops!
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlrAlVYACgkQ5xo1VCwwuqVrmggAiZ47zmIOx7O5+9fs6CGM6pE5knaU7GDrSFdm1xgGNlcV2UJiqPf3a+m91rh2ICpy+UnXqXyLlLKDMS8cHfqHNvVN5PBxv+gMza8m1O3PGKXlzjzvlGWPSZP1q5l56j7V8RGpfHcTHAujFVSXWHTiJ50J/kFCttPRpolrDx6Npf07n3fUUfcQZ6Z/w+VJ7M144yHCzqx2GX7CElqQfs10rxWlYCVtfkLIOl2NaKR0+uwb3hBQyfS4oFaUE7noZ8XuvIp+asow3W13HPsaOfBNedtxie6nv3jqDr+JaB6rWvbTH14bex5bBFEt43qBejQa0DTrCJkKrRkFXOdJAM+Y8Q===yY7Q-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 1 Apr 2018 11:38
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
87po3jgtbc.fsf@gnu.org
Hello!
Danny Milosavljevic <dannym@scratchpost.org> skribis:
Toggle quote (18 lines)> On Sat, 31 Mar 2018 18:13:33 +0200> ludo@gnu.org (Ludovic Courtès) wrote:>>> Danny Milosavljevic <dannym@scratchpost.org> skribis:>> >> > * gnu/services/networking.scm (static-networking, static-networking?,>> > static-networking-interface, static-networking-ip, static-networking-netmask,>> > static-networking-gateway, static-networking-requirement,>> > static-networking-service, static-networking-service-type): Move to...>> > * gnu/services/base.scm: ...here. >> >> What’s the reason? Is there a module cross-dependency issue or>> something?>> Yes, (gnu services base) uses (gnu services networking), and now I wanted> to use (gnu services networking) in (gnu services base) - because> I extend udev service and it's in the latter.
I see.
Toggle quote (3 lines)> but I thought of a better way to resolve it: Just put modem-manager service> into (gnu services base) to begin with. Testing...
I’d actually prefer the initial approach—moving‘static-networking-service-type’ to (gnu services base). That seemsmore logical to me.
Thanks,Ludo’.
D
D
Danny Milosavljevic wrote on 1 May 2018 11:58
Re: [bug#30991] [PATCH v2 3/3] services: Add ModemManager to '%desktop-services'.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 30991@debbugs.gnu.org)
20180501115824.2955c218@scratchpost.org
Hi Ludo,
On Sat, 31 Mar 2018 18:08:35 +0200ludo@gnu.org (Ludovic Courtès) wrote:
Toggle quote (7 lines)> Danny Milosavljevic <dannym@scratchpost.org> skribis:> > > * gnu/services/desktop.scm (%desktop-services): Add ModemManager. > > I would not add it to ‘%desktop-services’ because I’d think it’s not a> very common requirement, but I don’t know. WDYT?
Do we need internet in order to install GuixSD?
Then modem-manager should at least be available in the installation image.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlroOkAACgkQ5xo1VCwwuqXJOgf/QlghCa1BrnzNxY9BXof6+Tv4fPndsQROd81YY0D9zBh9K925PMVfq+hCmU2bNECpQ/Sv/E1OszKHOjYUEsdxbSiusXJf4dgTMtBLoLD7kxRV9z/GFBc2fBmNAeFFlv8NUq0aasg43gogGO/X57V0YsAg5bm75i7oueXwM0eG6b9o9ssWACitmGZhwAagNAEkavmodW558Cf+8MlVPhad42n4bGhzfI1Uya2qx8DRs3xBH4H2O+9Q6ioapbfaBsvRW8EQU2q5h9K5+OQWSd39BV0ORSOtVLS4Scj9XYRIfA9y3p8Qect+a686wyV/ityt2yXsWoD0IoBbSHFVLIrsng===SzHe-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 6 May 2018 23:00
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
874ljkmrcp.fsf@gnu.org
Hello Danny,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
Toggle quote (14 lines)> On Sat, 31 Mar 2018 18:08:35 +0200> ludo@gnu.org (Ludovic Courtès) wrote:>>> Danny Milosavljevic <dannym@scratchpost.org> skribis:>> >> > * gnu/services/desktop.scm (%desktop-services): Add ModemManager. >> >> I would not add it to ‘%desktop-services’ because I’d think it’s not a>> very common requirement, but I don’t know. WDYT?>> Do we need internet in order to install GuixSD?>> Then modem-manager should at least be available in the installation image.
I think this is orthogonal to the question of adding it to‘%desktop-services’ since the installation image doesn’t rely on‘%desktop-services’.
Nevertheless, this will all be a matter of size, usability, anddocumentation. If it adds “too much” to the size of the installationimage, I’d be rather against it.
If we do add it to the installation image, then we’ll have to documentit a little.
But then, at this point we should also consider adding NetworkManager tothe installation image.
WDYT?
Thanks,Ludo’.
D
D
Danny Milosavljevic wrote on 8 May 2018 09:04
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 30991@debbugs.gnu.org)
20180508090407.3bca7c9f@scratchpost.org
Hi Ludo,
On Sun, 06 May 2018 23:00:54 +0200ludo@gnu.org (Ludovic Courtès) wrote:
Toggle quote (11 lines)> >> I would not add it to ‘%desktop-services’ because I’d think it’s not a> >> very common requirement, but I don’t know. WDYT? > >> > Do we need internet in order to install GuixSD?> >> > Then modem-manager should at least be available in the installation image. > > I think this is orthogonal to the question of adding it to> ‘%desktop-services’ since the installation image doesn’t rely on> ‘%desktop-services’.
True. I agree.
Toggle quote (4 lines)> Nevertheless, this will all be a matter of size, usability, and> documentation. If it adds “too much” to the size of the installation> image, I’d be rather against it.
Well, some way of getting to the internet eventually needs to be availablesomewhere.
(it's fine if it's only in the installed system, so I guess compilationof everything is fine).
In Austria the cellphone internet is very cheap - so almost everyone has it(and many have only that). That said, USB or Wifi tethering is common, too.
I'm just trying to reduce the number of things I have to charge on the road :)
GNU Linux distributions nowadays have trouble providing any kind of simpledialup installation - so it's more difficult to install GNU Linux here.I think that's ridiculous since the AT commands and PPP required to havesome kind of internet didn't change sice circa 1985 - and it's small, too.
(I didn't know ModemManager before I packaged it here - but it doessome extra stuff like provide network card simulator integration for theextremely fast LTE modems)
I still have not-so-fond memories of manually downloading a random wvdialbinary and its dependencies in order to be able to install Gentoo. A normalperson (TM) would just give up ;)
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlrxS+cACgkQ5xo1VCwwuqV73gf/bPPXAina7zUkA03LhZJiAvUzZrlbJW84FUWDbNe6qbkpKrfhNdfH66PagS5GZd88+UwMOD+1rqaj8sVOg8/LH4fGMQVvEp6hED+fx6sP34zF5KtLyRU9/ysh34eAl8ZFmJN2zn4QJJgLJxR7pPqgb9MxevDt5E3CjFsHad1VlBC/8DmXa4w8cJkjYGLTRL8d/3z/hQ5tnLqNX5Ej1VYY6DU2pguQWLE8dpfvkOk160u8SYDJ68XDfPkrNpC+esiQAIFWodMQ5vLpTnF/gU+u9ywYyxXOpvY8cZHUw3wG46+S6s6Im/Xvx23cP6ALFOOCXRxpamRkeyix8+7Gq+eCSw===BoxU-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 8 May 2018 15:35
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
87sh722rtb.fsf@gnu.org
Hi Danny,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
Toggle quote (16 lines)> On Sun, 06 May 2018 23:00:54 +0200> ludo@gnu.org (Ludovic Courtès) wrote:>>> >> I would not add it to ‘%desktop-services’ because I’d think it’s not a>> >> very common requirement, but I don’t know. WDYT? >> >>> > Do we need internet in order to install GuixSD?>> >>> > Then modem-manager should at least be available in the installation image. >> >> I think this is orthogonal to the question of adding it to>> ‘%desktop-services’ since the installation image doesn’t rely on>> ‘%desktop-services’.>> True. I agree.
So do you still want to add ‘modem-manager’ to ‘%desktop-services’? :-)
Toggle quote (15 lines)>> Nevertheless, this will all be a matter of size, usability, and>> documentation. If it adds “too much” to the size of the installation>> image, I’d be rather against it.>> Well, some way of getting to the internet eventually needs to be available> somewhere.>> (it's fine if it's only in the installed system, so I guess compilation> of everything is fine).>> In Austria the cellphone internet is very cheap - so almost everyone has it> (and many have only that). That said, USB or Wifi tethering is common, too.>> I'm just trying to reduce the number of things I have to charge on the road :)
:-)
I would expect people installing an OS to have Ethernet or WiFi. Onegets WiFi even on the train nowadays. ;-)
In terms of size it doesn’t look good:
Toggle snippet (6 lines)$ guix size $(guix system build ~/src/guix/gnu/system/install.scm ) | tail -1total: 1116.4 MiB$ guix size $(guix system build ~/src/guix/gnu/system/install.scm ) modem-manager | tail -1total: 1346.0 MiB
WDYT?
(I actually fail to see how we end up with 1G in the first place…)
Toggle quote (13 lines)> GNU Linux distributions nowadays have trouble providing any kind of simple> dialup installation - so it's more difficult to install GNU Linux here.> I think that's ridiculous since the AT commands and PPP required to have> some kind of internet didn't change sice circa 1985 - and it's small, too.>> (I didn't know ModemManager before I packaged it here - but it does> some extra stuff like provide network card simulator integration for the> extremely fast LTE modems)>> I still have not-so-fond memories of manually downloading a random wvdial> binary and its dependencies in order to be able to install Gentoo. A normal> person (TM) would just give up ;)
Heheh.
Thanks,Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2018 15:22
Re: [bug#30991] [PATCH v2 2/3] services: Add modem-manager-service-type.
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
87d0ttbdog.fsf@gnu.org
Hello Danny,
ludo@gnu.org (Ludovic Courtès) skribis:
Toggle quote (10 lines)> Danny Milosavljevic <dannym@scratchpost.org> skribis:>>> * gnu/services/networking.scm (modem-manager-service-type): New variable.>> (<modem-manager-configuration>): New variable.>> (modem-manager-configuration): New procedure.>> (modem-manager-configuration?): New procedure.>> * doc/guix.texi (Networking Services): Document it.>> LGTM, thanks!
Ping! :-)
I think the only question was about patch 3/3, which adds ModemManagerto ‘%desktop-services’. I’m in favor of dropping patch 3/3, butregardless patches 1/3 (the variant that moves‘static-networking-service-type’ to (gnu services base), as wediscussed) and 2/3 can definitely go in!
Thanks,Ludo’.
D
D
Danny Milosavljevic wrote on 4 Sep 2018 21:41
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 30991@debbugs.gnu.org)
20180904214117.6aff8c89@scratchpost.org
Hi Ludo,
On Tue, 04 Sep 2018 15:22:07 +0200ludo@gnu.org (Ludovic Courtès) wrote:
Toggle quote (6 lines)> I think the only question was about patch 3/3, which adds ModemManager> to ‘%desktop-services’. I’m in favor of dropping patch 3/3, but> regardless patches 1/3 (the variant that moves> ‘static-networking-service-type’ to (gnu services base), as we> discussed) and 2/3 can definitely go in!
It already is in master. I guess I left the bug report open so far - probablybecause of the %desktop-services .
I still want to underline that there should be a way for a regular userto bootstrap from the GuixSD image to a "guix pull"-able system usinghis existing internet connection - otherwise the first impression is bad.
This means that the GuixSD image needs to have at least pppd, andmaybe modem-manager too (maybe not).
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAluO390ACgkQ5xo1VCwwuqVVlwf/Vav09TdwX+/Ua7ChXNUe+Ck2iRn23rmE2vSFTrMkp+vv0JQ/7b77gLBJgA8y6D7DZNajBiLEGvALJs1+B1qaQwbE0q5gJUgsBK4T3g+cZlOsIyzB28yB49ZlUQpAD8Ig5KepLFyoYcA5sqCX2bxYCTyR+0M18AFb0gLzUa4+1A8UDGpUUWc66XixgQbECo9OJEh7rMPAhoeXElROd3hi4CE+XtxfjWYMrYLOabQEimp/Gw7qO4M6Jtu/8FJSK2uwHP0I7Xcm9bjgNDH/8WqX6Oov8xBMsrYesdhZI5tSUoOppFrhAmeQTRq1lJkYkfy2d4N3DaeVeLVgYWAdKQDtvw===Io9r-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 4 Sep 2018 22:53
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30991@debbugs.gnu.org)
87zhwx7znk.fsf@gnu.org
Hello Danny,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
Toggle quote (12 lines)> On Tue, 04 Sep 2018 15:22:07 +0200> ludo@gnu.org (Ludovic Courtès) wrote:>>> I think the only question was about patch 3/3, which adds ModemManager>> to ‘%desktop-services’. I’m in favor of dropping patch 3/3, but>> regardless patches 1/3 (the variant that moves>> ‘static-networking-service-type’ to (gnu services base), as we>> discussed) and 2/3 can definitely go in!>> It already is in master. I guess I left the bug report open so far - probably> because of the %desktop-services .
Oh, silly me.
Toggle quote (7 lines)> I still want to underline that there should be a way for a regular user> to bootstrap from the GuixSD image to a "guix pull"-able system using> his existing internet connection - otherwise the first impression is bad.>> This means that the GuixSD image needs to have at least pppd, and> maybe modem-manager too (maybe not).
I agree in principle, though, as I wrote, I think we need to strike abalance between popularity and overhead, so to speak. ModemManagercurrently takes quite a bit of extra space, which is why I’m reluctant.Do you think this can be optimized? Or would pppd enough be convenient?
Thanks,Ludo’.
D
D
Danny Milosavljevic wrote on 4 Sep 2018 23:16
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 30991@debbugs.gnu.org)
20180904231635.7d4c8234@scratchpost.org
Hi Ludo,
On Tue, 04 Sep 2018 22:53:19 +0200ludo@gnu.org (Ludovic Courtès) wrote:
Toggle quote (2 lines)> Do you think this can be optimized?
I'll check.
Toggle quote (2 lines)>Or would pppd enough be convenient?
I think that pppd would work on the vast majority of modems (slow transferspeeds sometimes since many modems need network card emulation for thefaster modes - but they do work with PPP just fine, just slow).
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAluO9jQACgkQ5xo1VCwwuqUoAggApEXJTG2VgExOvdlMZYqtNFTm3VzJxusuQBbW8fVgls9D7tEfdWRRVm0gzY2gj5DpawOEmNHDOs+itYwH3S3Qk1ZZlIRuQdKO2qYrU9PIDSkITplyOYgUAqNDn729nBsCkyLJU4qOVCkjRGWrwLhbGNjV4RWWLJeFb7H/BbURk/HWue7Bjiw1inANx9crPCPMYurhvgi6gJIkqedVNtUUZg6gG8WnLezcIaC+u46AIHBkXxyFkI0sXZ5yJ3/ap/MnKYHkzHreuKfv9qEOZHAS6bKwmpuXBNlqQNtnvsXdJ2+gdChWyT0QLtRYPvvLbn+bA81FrF2tnChLBroXCuiFmw===dyTM-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 14 May 2019 10:09
control message for bug #30991
(address . control@debbugs.gnu.org)
87ftph319y.fsf@gnu.org
tags 30991 fixedclose 30991
?
Your comment

This issue is archived.

To comment on this conversation send email to 30991@debbugs.gnu.org