[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
16/48: services: Add hurd-console-service-type.
From: |
guix-commits |
Subject: |
16/48: services: Add hurd-console-service-type. |
Date: |
Sun, 19 Apr 2020 10:22:10 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 73ad0e9d0521cf7b5e19ed713b566e6cd922331e
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
- 07/48: gnu: hurd: Build DDE libraries., (continued)
- 07/48: gnu: hurd: Build DDE libraries., guix-commits, 2020/04/19
- 26/48: system: hurd: Add openssh service., guix-commits, 2020/04/19
- 37/48: gnu: coreutils: Mark three more tests XFAIL on the Hurd., guix-commits, 2020/04/19
- 34/48: gnu: tcl: Disable troublesome test on the Hurd., guix-commits, 2020/04/19
- 47/48: REMOVEME gnu: guix: Bugfix for cross compiling to the Hurd., guix-commits, 2020/04/19
- 44/48: gnu: guix: Avoid loading (gnu installer) when cross compiling., guix-commits, 2020/04/19
- 46/48: Revert "records: Have ABI check work well for cross-compilation.", guix-commits, 2020/04/19
- 48/48: gnu: guix: Run `make update-guix-package'., guix-commits, 2020/04/19
- 10/48: system: hurd: Add /etc/group., guix-commits, 2020/04/19
- 09/48: gnu: hurd: Use default Qemu guest ip: 10.0.2.15., guix-commits, 2020/04/19
- 16/48: services: Add hurd-console-service-type.,
guix-commits <=
- 24/48: HACK use uncompiled .scm for shepherd, guix-commits, 2020/04/19
- 33/48: gnu: cmake: Remove "libuv" dependency for the Hurd., guix-commits, 2020/04/19
- 41/48: gnu: guix: Cross-build fix: override compressors., guix-commits, 2020/04/19
- 23/48: system: hurd: Add the Shepherd., guix-commits, 2020/04/19
- 27/48: system: hurd: Add less, which to %base-packages/hurd., guix-commits, 2020/04/19
- 40/48: gnu: guix: Cross-build fixup for wrap-program., guix-commits, 2020/04/19
- 45/48: Revert "compile: Run the load phase within 'with-target'.", guix-commits, 2020/04/19