[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
22/36: services: Add hurd-console-service-type.
From: |
guix-commits |
Subject: |
22/36: services: Add hurd-console-service-type. |
Date: |
Fri, 24 Apr 2020 08:14:11 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 37cbd51458e29239fa2090be0050dbdd55679a1e
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Mon Apr 13 10:13:05 2020 +0200
services: Add hurd-console-service-type.
* gnu/services/hurd.scm (<hurd-console-configuration>): New variable.
(hurd-console-shepherd-service, hurd-console-service-type): New function.
(hurd-service->shepherd-service): Add entry.
---
gnu/services/hurd.scm | 45 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/gnu/services/hurd.scm b/gnu/services/hurd.scm
index 77dd226..34a8118 100644
--- a/gnu/services/hurd.scm
+++ b/gnu/services/hurd.scm
@@ -26,7 +26,8 @@
#:use-module (guix records)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
- #:export (hurd-service->shepherd-service))
+ #:export (hurd-console-service-type
+ hurd-service->shepherd-service))
;;; Commentary:
;;;
@@ -38,6 +39,48 @@
(define (hurd-service->shepherd-service service)
(let ((config (service-value service)))
(match config
+ (($ <hurd-console-configuration>) (hurd-console-shepherd-service config))
(_ '()))))
+
+;;;
+;;; Simple wrapper for <hurd>/bin/console.
+;;;
+
+(define-record-type* <hurd-console-configuration>
+ hurd-console-configuration make-hurd-console-configuration
+ hurd-console-configuration?
+ (hurd hurd-console-configuration-hurd ;package
+ (default hurd)))
+
+(define (hurd-console-shepherd-service config)
+ "Return a <shepherd-service> for a Hurd console with CONFIG."
+
+ (define console-command
+ #~(list
+ (string-append #$(hurd-console-configuration-hurd config)
"/bin/console")
+ "-c" "/dev/vcs"
+ "-d" "vga"
+ "-d" "pc_kbd"
+ "-d" "generic_speaker"))
+
+ (list (shepherd-service
+ (documentation "Hurd console.")
+ (provision '(console))
+ (requirement '())
+ (start #~(lambda _ (fork+exec-command #$console-command) #t))
+ (stop #~(make-kill-destructor)))))
+
+(define hurd-console-service-type
+ (service-type
+ (name 'console)
+ (description
+ "Run a hurd console, @command{console}.")
+ (extensions
+ (list (service-extension shepherd-root-service-type
+ hurd-console-shepherd-service)))
+ (compose concatenate)
+ (extend append)
+ (default-value (hurd-console-configuration))))
+
;;; hurd.scm ends here
- 15/36: gnu: Add dde-sources., (continued)
- 15/36: gnu: Add dde-sources., guix-commits, 2020/04/24
- 16/36: gnu: Add netdde., guix-commits, 2020/04/24
- 13/36: gnu: hurd: Fix references to /bin/w., guix-commits, 2020/04/24
- 18/36: gnu: Add libtirpc/hurd., guix-commits, 2020/04/24
- 23/36: services: Add hurd-ttys-service-type., guix-commits, 2020/04/24
- 21/36: services: Add hurd., guix-commits, 2020/04/24
- 24/36: services: Add hurd-user-services-service-type., guix-commits, 2020/04/24
- 25/36: services: Add guix-daemon-service as a Hurd service., guix-commits, 2020/04/24
- 26/36: services: hurd: Add dummy syslog., guix-commits, 2020/04/24
- 27/36: services: hurd: Add dummy loopback., guix-commits, 2020/04/24
- 22/36: services: Add hurd-console-service-type.,
guix-commits <=
- 30/36: system: gnu: Populate "/etc" from "/boot/activation"., guix-commits, 2020/04/24
- 28/36: services: Add openssh-service as a Hurd service., guix-commits, 2020/04/24
- 32/36: system: hurd: Create system profile for guix development., guix-commits, 2020/04/24
- 29/36: system: hurd: Add the Shepherd., guix-commits, 2020/04/24
- 34/36: system: hurd: Add guix., guix-commits, 2020/04/24
- 33/36: system: gnu: Add %bootstrap-{gcc, binutils, glibc} for devel profile., guix-commits, 2020/04/24
- 02/36: build: Don't build man pages when cross-compiling., guix-commits, 2020/04/24
- 36/36: HACK use uncompiled .scm for shepherd, guix-commits, 2020/04/24
- 31/36: system: hurd: Add openssh service., guix-commits, 2020/04/24
- 08/36: gnu: guix: Use gnutls-3.6.13 when cross-compiling., guix-commits, 2020/04/24