janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit e6e84b4d45f448c5dff776a66f2a10922b1d9e69
Author: Jan (janneke) Nieuwenhuizen <[email protected]>
AuthorDate: Thu Apr 30 15:40:07 2020 +0200
WIP: gnu: services: Add %hurd-bare-metal-service.
* gnu/services.scm (%hurd-system-activation): New procedure.
(%hurd-bare-metal-service): New variable.
* gnu/system.scm (hurd-default-essential-services): Ues it.
---
gnu/services.scm | 21 +++++++++++++++++++++
gnu/system.scm | 3 ++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/gnu/services.scm b/gnu/services.scm
index ebe36bd..08b9344 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -93,6 +93,7 @@
activation-service-type
activation-service->script
%linux-bare-metal-service
+ %hurd-bare-metal-service
special-files-service-type
extra-special-file
etc-service-type
@@ -638,6 +639,26 @@ ACTIVATION-SCRIPT-TYPE."
activation-service-type
%linux-kernel-activation))
+(define %hurd-system-activation
+ ;; Activation of the Hurd system.
+ #~(begin
+ ;; Tell the kernel to use our 'modprobe' command.
+ (display "Zee Passive Hurd\n")
+ (with-output-to-file "/tmp/before"
+ (lambda _ (display "hallo\n")))
+ (sleep 2)
+ (unless (file-exists? "/hurd")
+ (symlink "/hurd" (string-append #+hurd "/hurd")))
+ (with-output-to-file "/tmp/after"
+ (lambda _ (display "hallo\n")))
+ (display "Zee Active Hurd\n")))
+
+(define %hurd-bare-metal-service
+ ;; The service that does things that are needed on the "bare metal", but not
+ ;; necessary or impossible in a container.
+ (simple-service 'hurd-bare-metal
+ activation-service-type
+ %hurd-system-activation))
(define special-files-service-type
;; Service to install "special files" such as /bin/sh and /usr/bin/env.
diff --git a/gnu/system.scm b/gnu/system.scm
index 9e733a1..74fa4b5 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -575,8 +575,9 @@ bookkeeping."
(let ((entries (hurd-operating-system-directory-base-entries os)))
(list (service system-service-type entries)
%boot-service
- %shepherd-root-service
%activation-service
+ %shepherd-root-service
+ %hurd-bare-metal-service
(service user-processes-service-type '(user-processes))
(account-service (append (operating-system-accounts os)
(operating-system-groups os))