unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Connman
@ 2016-04-20 22:41 Efraim Flashner
  2016-04-21 13:07 ` Leo Famulari
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Efraim Flashner @ 2016-04-20 22:41 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 449 bytes --]

I think I've finally gotten connman working, with a service. I haven't
added an entry to doc/guix.texi yet, and for some reason when I started
the patch I stuck it in wicd.scm. I've also attached the OS config I
used while testing.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0001-gnu-Add-connman.patch --]
[-- Type: text/plain, Size: 4211 bytes --]

From efe1f20ecb23fc4ba2da647152c9f2a2e96293be Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Thu, 19 Apr 2016 17:25:41 +0200
Subject: [PATCH 1/2] gnu: Add connman.

* gnu/packages/wicd.scm (connman): New variable.
---
 gnu/packages/wicd.scm | 70 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/wicd.scm b/gnu/packages/wicd.scm
index f9aa657..8ceb4cf 100644
--- a/gnu/packages/wicd.scm
+++ b/gnu/packages/wicd.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,17 +23,24 @@
 (define-module (gnu packages wicd)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix licenses)
   #:use-module (guix utils)
   #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages linux)
-  #:use-module (gnu packages admin)
-  #:use-module (gnu packages python))
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages polkit)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages samba)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages vpn))
 
 (define-public wicd
   (package
@@ -190,3 +198,61 @@
 wireless networking.")
     (home-page "https://launchpad.net/wicd")
     (license gpl2+)))
+
+(define-public connman
+  (package
+    (name "connman")
+    (version "1.32")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://www.kernel.org/pub/linux/network/connman/"
+                            name "-" version ".tar.xz"))
+    (sha256
+     (base32
+      "0k4kw2j78gwxf0rq79a099qkzl6wi4v5i7rfs4rn0si0fd68d19i"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--enable-nmcompat"
+             "--sysconfdir=/etc"
+             "--localstatedir=/var"
+             "--enable-openconnect"
+             "--enable-openvpn"
+             "--enable-vpnc"
+             "--enable-pptp"
+             "--enable-l2tp"
+             (string-append
+              "--with-dbusconfdir=" (assoc-ref %outputs "out") "/etc")
+             (string-append
+              "--with-dbusdatadir=" (assoc-ref %outputs "out") "/share"))))
+    (native-inputs
+     `(("pkg-config", pkg-config)
+       ("python" ,python-2)))
+    (inputs
+     `(("dbus" ,dbus)
+       ("glib" ,glib)
+       ("gnutls" ,gnutls)
+       ("iptables" ,iptables)
+       ("polkit" ,polkit)
+       ("readline" ,readline)
+       ;; These inputs are needed for connman to include the interface to
+       ;; these technologies so IF they are installed they can be used.
+       ;; TODO: add neard, ofono
+       ("openconnect" ,openconnect)
+       ("openvpn" ,openvpn)
+       ("ppp", ppp)
+       ("vpnc" ,vpnc)
+       ("wpa-supplicant" ,wpa-supplicant)))
+    (home-page "https://01.org/connman")
+    (synopsis "Connection Manager daemon")
+    (description "The Linux Connection Manager project provides a daemon for
+managing Internet connections within embedded devices running the Linux
+operating system.  The Connection Manager is designed to be slim and to use as
+few resources as possible. It is fully modular system that can be extended
+through plug-ins.  The plug-in approach allows for easy adaption and
+modification for various use cases.  Connman implements DNS resolving and
+caching, DHCP clients for both IPv4 and IPv6, link-local IPv4 address handling
+and tethering (IP connection sharing) to clients via USB, ethernet, WiFi,
+cellular and Bluetooth.")
+    (license gpl2)))
-- 
2.8.1


[-- Attachment #1.3: 0002-services-Add-connman-service.patch --]
[-- Type: text/plain, Size: 3209 bytes --]

From 2e99131f5b455ceb7c70c33eb4c89134caa755bb Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Thu, 19 Apr 2016 22:10:11 +0200
Subject: [PATCH 2/2] services: Add connman-service.

* gnu/services/networking.scm (connman-service): New procedure.
(connman-service-type, %connman-activation): New variables.
(connman-shepherd-service): New procedure.
---
 gnu/services/networking.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5a0a211..5bb56a2 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -45,7 +46,8 @@
             tor-service
             bitlbee-service
             wicd-service
-            network-manager-service))
+            network-manager-service
+            connman-service))
 
 ;;; Commentary:
 ;;;
@@ -652,4 +654,47 @@ and @command{wicd-curses} user interfaces."
 that attempting to keep active network connectivity when available."
   (service network-manager-service-type network-manager))
 
+\f
+;;;
+;;; Connman
+;;;
+
+(define %connman-activation
+  ;; Activation gexp for Connman.
+  #~(begin
+      (use-modules (guix build utils))
+      (mkdir-p "/etc/connman/")
+      (mkdir-p "/var/lib/connman/")
+      (mkdir-p "/var/lib/connman-vpn/")))
+
+(define (connman-shepherd-service connman)
+  "Return a shepherd service for Connman"
+  (list (shepherd-service
+         (documentation "Run Connman")
+         (provision '(networking))
+         (requirement '(user-processes dbus-system loopback))
+         (start #~(make-forkexec-constructor
+                   (list (string-append #$connman
+                                        "/sbin/connmand")
+                         "-n" "-r")))
+         (stop #~(make-kill-destructor)))))
+
+(define connman-service-type
+  (service-type (name 'connman)
+                (extensions
+                 (list (service-extension shepherd-root-service-type
+                                          connman-shepherd-service)
+                       (service-extension dbus-root-service-type list)
+                       (service-extension activation-service-type
+                                          (const %connman-activation))
+                       ;; Add connman to the system profile.
+                       (service-extension profile-service-type list)))))
+
+(define* (connman-service #:key (connman connman))
+  "Return a service that runs Connman, a network connection manager.  This
+service adds the @var{connman} package to the global profile, providing
+several the @command{connmanctl} command to interact with the daemon and
+configure networking."
+  (service connman-service-type connman))
+
 ;;; networking.scm ends here
-- 
2.8.1


[-- Attachment #1.4: openbox.tmpl --]
[-- Type: text/plain, Size: 1685 bytes --]

;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu) (gnu system nss))
(use-service-modules desktop networking)
(use-package-modules openbox certs wicd xorg)

(operating-system
  (host-name "antelope")
  (timezone "Europe/Paris")
  (locale "en_US.UTF-8")

  ;; Assuming /dev/sdX is the target hard disk, and "my-root"
  ;; is the label of the target root file system.
  (bootloader (grub-configuration (device "/dev/sdX")))

  (file-systems (cons (file-system
                        (device "my-root")
                        (title 'label)
                        (mount-point "/")
                        (type "ext4"))
                      %base-file-systems))

  (users (cons (user-account
                (name "alice")
                (comment "Bob's brother")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video"))
                (home-directory "/home/alice"))
               %base-user-accounts))

  ;; Add a bunch of window managers; we can choose one at
  ;; the log-in screen with F1.
  (packages (cons* openbox                 ;window managers
                   nss-certs               ;for HTTPS access
                   connman xterm
                   %base-packages))

  ;; Use the "desktop" services, which include the X11
  ;; log-in service, networking with Wicd, and more.
  (services (cons* (connman-service)
                   (delete (wicd-service) %desktop-services)))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-05-06  9:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-20 22:41 [PATCH] Connman Efraim Flashner
2016-04-21 13:07 ` Leo Famulari
2016-04-25 22:04 ` Ludovic Courtès
2016-05-05  6:31   ` Efraim Flashner
2016-05-05 13:41     ` Ludovic Courtès
2016-04-28 16:07 ` Leo Famulari
2016-04-29 15:28   ` Ludovic Courtès
2016-05-05  6:36 ` [PATCH 1/2] gnu: Add connman Efraim Flashner
2016-05-05  6:36 ` [PATCH 2/2] services: Add connman-service Efraim Flashner
2016-05-06  9:53   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).