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
>From 34d9f68b886fe590ff0efcd33d54e5d2f487ff70 Mon Sep 17 00:00:00 2001 From: Mark H Weaver <m...@netris.org> 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
>From 59921d5bd704b07d25104b7a1921380892f60a80 Mon Sep 17 00:00:00 2001 From: Mark H Weaver <m...@netris.org> 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 sync. --- 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 © 2013, 2014, 2015 Ludovic Courtès <l...@gnu.org> ;;; Copyright © 2015 Alex Kost <alez...@gmail.com> +;;; Copyright © 2015 Mark H Weaver <m...@netris.org> ;;; ;;; 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-mapper 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))))) ;;; 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 © 2014, 2015 Ludovic Courtès <l...@gnu.org> ;;; Copyright © 2015 Andy Wingo <wi...@igalia.com> +;;; Copyright © 2015 Mark H Weaver <m...@netris.org> ;;; ;;; 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) (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))) ;;; desktop.scm ends here -- 2.4.3
>From 00b8791d7cea8f9702a004377756caefa243b23e Mon Sep 17 00:00:00 2001 From: Mark H Weaver <m...@netris.org> 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 (<elogind-configuration>): 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