From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: [PATCH] Connman Date: Thu, 21 Apr 2016 01:41:45 +0300 Message-ID: <20160420224145.GA8585@debian-netbook> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mojUlQ0s9EVzWg2t" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1at0oi-0006yJ-SC for guix-devel@gnu.org; Wed, 20 Apr 2016 18:41:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1at0of-00009N-Gd for guix-devel@gnu.org; Wed, 20 Apr 2016 18:41:52 -0400 Received: from flashner.co.il ([178.62.234.194]:55874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1at0of-000079-4U for guix-devel@gnu.org; Wed, 20 Apr 2016 18:41:49 -0400 Received: from debian-netbook (ool-45706c69.dyn.optonline.net [69.112.108.105]) by flashner.co.il (Postfix) with ESMTPSA id 63C9C40163 for ; Wed, 20 Apr 2016 22:41:47 +0000 (UTC) Content-Disposition: inline List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --mojUlQ0s9EVzWg2t Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-Add-connman.patch" Content-Transfer-Encoding: quoted-printable =46rom efe1f20ecb23fc4ba2da647152c9f2a2e96293be Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner 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 =C2=A9 2015 Pierre-Antoine Rault ;;; Copyright =C2=A9 2015 Andreas Enge ;;; Copyright =C2=A9 2016 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2016 Efraim Flashner ;;; ;;; 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)) =20 (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/conn= man/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "0k4kw2j78gwxf0rq79a099qkzl6wi4v5i7rfs4rn0si0fd68d19i")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list "--enable-nmcompat" + "--sysconfdir=3D/etc" + "--localstatedir=3D/var" + "--enable-openconnect" + "--enable-openvpn" + "--enable-vpnc" + "--enable-pptp" + "--enable-l2tp" + (string-append + "--with-dbusconfdir=3D" (assoc-ref %outputs "out") "/etc") + (string-append + "--with-dbusdatadir=3D" (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 f= or +managing Internet connections within embedded devices running the Linux +operating system. The Connection Manager is designed to be slim and to us= e 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 hand= ling +and tethering (IP connection sharing) to clients via USB, ethernet, WiFi, +cellular and Bluetooth.") + (license gpl2))) --=20 2.8.1 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0002-services-Add-connman-service.patch" Content-Transfer-Encoding: quoted-printable =46rom 2e99131f5b455ceb7c70c33eb4c89134caa755bb Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner 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 =C2=A9 2013, 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2015 Mark H Weaver +;;; Copyright =C2=A9 2016 Efraim Flashner ;;; ;;; 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)) =20 ;;; 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)) =20 +=0C +;;; +;;; 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 --=20 2.8.1 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="openbox.tmpl" ;; 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)) --RnlQjJ0d97Da+TV1-- --mojUlQ0s9EVzWg2t Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJXGAWoAAoJEPTB05F+rO6T5mYP/2ICEi9vcorgk3TtTZldVuCt /eXYzCVmvjoygveeHUfD9O0FSwYiCgNQtyw/6w92/M8Eul+n7hwCkOuLQ9FMteNY UUHiRki7hkmzSVHoFfhpsIyONrbYlEZs9qcr+DRDttKBZJG6bfYzRWgEWC9FiIpZ t+3IjXttxIVv53Gr7/+SYMQSUoUUJlJ3JHJ0qKxltshzmAjpdeT+atj39Uu4fkms rINhX6MZKF/u4G60F2I3Pa2VEIEdw/1w6fsCE+YT5pJG8+vJFHaaXV4O0dUoWCcM bWxt8yJayqltj0NdS0jLtVyeaJLT62luuUZmQEqFYXfaNPalNnxzNJWkqiVnK2ip kAi8zgWH/Hs9gqT4c5Y3nJctOn+3Z/h5j9jcIijo0nTDpqog1VlYj6d/WkDnXtaj ZEjm/2X23Dc8ayr8L/nE7yhUe0k+cNebG0O2Fk+ZNgXNfzmB5aYYM/bYYuVKwv8a Sy1a+CtiTUSVzdSwI9dE/8TZLReqDyFCEqNCDSyMisB7qhvsuQyUD8P7rmmKMIc8 b2POU9p5ANOuTLd7wc+wzJDRsZS4838tkmtdctsXnWiDW/iT7s1ObFsTJyjPf83R FhHwuq59SqyZFz/jJHLG8L+CMgZSKIwZ1ilA4RvigAYhvzozXfwx8vNmz+DBO5Ys zM6fn0oEPon1iaPifajd =2tix -----END PGP SIGNATURE----- --mojUlQ0s9EVzWg2t--