From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: [PATCHES] Get elogind-service working as intended Date: Thu, 03 Sep 2015 17:23:36 -0400 Message-ID: <87a8t3mc2v.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXbz6-0004Pd-2T for guix-devel@gnu.org; Thu, 03 Sep 2015 17:23:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXbz2-00087F-U9 for guix-devel@gnu.org; Thu, 03 Sep 2015 17:23:52 -0400 Received: from world.peace.net ([50.252.239.5]:46556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXbz2-00086w-N9 for guix-devel@gnu.org; Thu, 03 Sep 2015 17:23:48 -0400 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain These patches are needed to get Andy's elogind-service working as intended, e.g. to allow things like suspend-on-lid-close and various hot keys to work. I'm not really happy with any of these, so if someone wants to solve these problems in a better way, please don't hesitate to do so :) Comments and suggestions welcome. Mark --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-file-systems-Add-systemd-file-systems-add-it-to-base.patch Content-Description: [PATCH 1/3] file-systems: Add %systemd-file-systems; add it to %base-file-systems >From 34d9f68b886fe590ff0efcd33d54e5d2f487ff70 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 3 Sep 2015 16:58:08 -0400 Subject: [PATCH 1/3] file-systems: Add %systemd-file-systems; add it to %base-file-systems. * gnu/system/file-systems.scm (%systemd-file-systems): New variable. (%base-file-systems): Add %systemd-file-systems. --- gnu/system/file-systems.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 003eb44..d03dcff 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -50,6 +50,7 @@ %devtmpfs-file-system %immutable-store %control-groups + %systemd-file-systems %base-file-systems %container-file-systems @@ -258,6 +259,26 @@ UUID representation." '("cpuset" "cpu" "cpuacct" "memory" "devices" "freezer" "blkio" "perf_event" "hugetlb"))))) +(define %systemd-file-systems + ;; We don't use systemd, but these file systems are needed for elogind, + ;; which was extracted from systemd. + (list (file-system + (device "systemd") + (mount-point "/run/systemd") + (type "tmpfs") + (check? #f) + (flags '(no-suid no-dev no-exec)) + (options "mode=0755") + (create-mount-point? #t)) + (file-system + (device "systemd") + (mount-point "/run/user") + (type "tmpfs") + (check? #f) + (flags '(no-suid no-dev no-exec)) + (options "mode=0755") + (create-mount-point? #t)))) + (define %base-file-systems ;; List of basic file systems to be mounted. Note that /proc and /sys are ;; currently mounted by the initrd. @@ -265,6 +286,7 @@ UUID representation." %pseudo-terminal-file-system %shared-memory-file-system %immutable-store) + %systemd-file-systems %control-groups)) ;; File systems for Linux containers differ from %base-file-systems in that -- 2.4.3 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0002-services-Add-udev-rules-for-upower-colord-elogind-to.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH 2/3] services: Add udev rules for (upower colord elogind) to %desktop-services >From 59921d5bd704b07d25104b7a1921380892f60a80 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 3 Sep 2015 17:12:38 -0400 Subject: [PATCH 2/3] services: Add udev rules for (upower colord elogind) to %desktop-services. * gnu/services/desktop.scm (%desktop-services): Replace the 'udev-service' from %base-services. * gnu/services/base.scm (%base-services): Add a comment to keep them in syn= c. --- gnu/services/base.scm | 4 ++++ gnu/services/desktop.scm | 25 ++++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 888e446..7f37b3d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.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 Alex Kost +;;; Copyright =C2=A9 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -884,6 +885,9 @@ This is the GNU operating system, welcome!\n\n"))) ;; The LVM2 rules are needed as soon as LVM2 or the device-mappe= r is ;; used, so enable them by default. The FUSE and ALSA rules are ;; less critical, but handy. + ;; + ;; XXX Keep this in sync with the 'udev-service' call in + ;; %desktop-services. (udev-service #:rules (list lvm2 fuse alsa-utils crda))))) =20 ;;; base.scm ends here diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 1bf3db0..6017449 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2015 Andy Wingo +;;; Copyright =C2=A9 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,8 @@ #:use-module (gnu packages avahi) #:use-module (gnu packages wicd) #:use-module (gnu packages polkit) + #:use-module ((gnu packages linux) + #:select (lvm2 fuse alsa-utils crda)) #:use-module (guix monads) #:use-module (guix records) #:use-module (guix store) @@ -593,12 +596,24 @@ when they log out." (ntp-service) =20 (map (lambda (mservice) - ;; Provide an nscd ready to use nss-mdns. (mlet %store-monad ((service mservice)) - (if (memq 'nscd (service-provision service)) - (nscd-service (nscd-configuration) - #:name-services (list nss-mdns)) - mservice))) + (cond + ;; Provide an nscd ready to use nss-mdns. + ((memq 'nscd (service-provision service)) + (nscd-service (nscd-configuration) + #:name-services (list nss-mdns))) + + ;; Add more rules to udev-service. + ;; + ;; XXX Keep this in sync with the 'udev-service' call in + ;; %base-services. Here we intend only to add 'upower', + ;; 'colord', and 'elogind'. + ((memq 'udev (service-provision service)) + (udev-service #:rules + (list lvm2 fuse alsa-utils crda + upower colord elogind))) + + (else mservice)))) %base-services))) =20 ;;; desktop.scm ends here --=20 2.4.3 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-services-elogind-configuration-Disable-hibernation-k.patch Content-Description: [PATCH 3/3] services: elogind-configuration: Disable hibernation key by default >From 00b8791d7cea8f9702a004377756caefa243b23e Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 3 Sep 2015 17:16:26 -0400 Subject: [PATCH 3/3] services: elogind-configuration: Disable hibernation key by default. * gnu/services/desktop.scm (): Change the default value of the 'handle-hibernate-key' field to 'ignore'. --- gnu/services/desktop.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 6017449..b91bdd8 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -439,7 +439,11 @@ the system if the user is logged in locally." (handle-suspend-key elogind-handle-suspend-key (default 'suspend)) (handle-hibernate-key elogind-handle-hibernate-key - (default 'hibernate)) + ;; (default 'hibernate) + ;; XXX Ignore it for now, since we don't + ;; yet handle resume-from-hibernation in + ;; our initrd. + (default 'ignore)) (handle-lid-switch elogind-handle-lid-switch (default 'suspend)) (handle-lid-switch-docked elogind-handle-lid-switch-docked -- 2.4.3 --=-=-=--