From: Mark H Weaver <mhw@netris.org>
To: guix-devel@gnu.org
Subject: [PATCHES] Get elogind-service working as intended
Date: Thu, 03 Sep 2015 17:23:36 -0400 [thread overview]
Message-ID: <87a8t3mc2v.fsf@netris.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH 1/3] file-systems: Add %systemd-file-systems; add it to %base-file-systems --]
[-- Type: text/x-patch, Size: 2136 bytes --]
From 34d9f68b886fe590ff0efcd33d54e5d2f487ff70 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@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
[-- Attachment #3: [PATCH 2/3] services: Add udev rules for (upower colord elogind) to %desktop-services --]
[-- Type: text/x-patch, Size: 3681 bytes --]
From 59921d5bd704b07d25104b7a1921380892f60a80 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@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 <ludo@gnu.org>
;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
+;;; Copyright © 2015 Mark H Weaver <mhw@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 <ludo@gnu.org>
;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
+;;; Copyright © 2015 Mark H Weaver <mhw@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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: [PATCH 3/3] services: elogind-configuration: Disable hibernation key by default --]
[-- Type: text/x-patch, Size: 1441 bytes --]
From 00b8791d7cea8f9702a004377756caefa243b23e Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@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
next reply other threads:[~2015-09-03 21:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-03 21:23 Mark H Weaver [this message]
2015-09-04 7:57 ` [PATCHES] Get elogind-service working as intended Andy Wingo
2015-09-06 21:23 ` Service refactoring Ludovic Courtès
2015-09-08 8:47 ` Andy Wingo
2015-09-08 10:12 ` Ludovic Courtès
2015-09-08 10:33 ` Andy Wingo
2015-09-08 14:48 ` Mark H Weaver
2015-09-10 16:05 ` Ludovic Courtès
2015-09-10 16:14 ` Ludovic Courtès
2015-09-20 15:42 ` Ludovic Courtès
2015-09-21 8:18 ` Andy Wingo
2015-09-21 16:00 ` Ludovic Courtès
2015-09-24 0:33 ` Thompson, David
2015-09-24 7:41 ` Ludovic Courtès
2015-09-24 9:33 ` 宋文武
2015-09-24 17:09 ` Ludovic Courtès
2015-09-25 22:50 ` Christopher Allan Webber
2015-09-26 12:50 ` Ludovic Courtès
2015-09-30 8:59 ` Ludovic Courtès
2015-10-10 21:01 ` Ludovic Courtès
2015-09-10 16:03 ` [PATCHES] Get elogind-service working as intended Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a8t3mc2v.fsf@netris.org \
--to=mhw@netris.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).