[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
13/16: system: Add hurd activation.
From: |
guix-commits |
Subject: |
13/16: system: Add hurd activation. |
Date: |
Tue, 5 May 2020 13:14:18 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 499d5ac666a674bef57f54e31213627036ce069e
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sun May 3 16:32:09 2020 +0200
system: Add hurd activation.
* gnu/system.scm (gnu/linux-activation-script): Rename from
activation-script.
(activation-script, hurd-activation-script): New procedure.
---
gnu/services.scm | 55 ++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 40 insertions(+), 15 deletions(-)
diff --git a/gnu/services.scm b/gnu/services.scm
index 614956f..f161635 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -519,6 +519,43 @@ ACTIVATION-SCRIPT-TYPE."
(define (activation-script gexps)
"Return the system's activation script, which evaluates GEXPS."
+ (program-file "activate.scm" (if (hurd-target?)
+ (hurd-activation-script gexps)
+ (gnu/linux-activation-script gexps))))
+
+(define (gnu/linux-activation-script gexps)
+ "Return a GNU/Linux system activation script, which evaluates GEXPS."
+
+ (define actions
+ (map (cut program-file "activate-service.scm" <>) gexps))
+
+ (with-imported-modules (source-module-closure
+ '((gnu build activation)
+ (guix build utils)))
+ #~(begin
+ (use-modules (gnu build activation)
+ (guix build utils))
+
+ ;; Make sure the user accounting database exists. If it
+ ;; does not exist, 'setutxent' does not create it and
+ ;; thus there is no accounting at all.
+ (close-port (open-file "/var/run/utmpx" "a0"))
+
+ ;; Same for 'wtmp', which is populated by mingetty et
+ ;; al.
+ (close-port (open-file "/var/log/wtmp" "a0"))
+
+ ;; Set up /run/current-system. Among other things this
+ ;; sets up locales, which the activation snippets
+ ;; executed below may expect.
+ (activate-current-system)
+
+ ;; Run the services' activation snippets.
+ ;; TODO: Use 'load-compiled'.
+ (for-each primitive-load '#$actions))))
+
+(define (hurd-activation-script gexps)
+ "Return the Hurd activation script, which evaluates GEXPS."
(define actions
(map (cut program-file "activate-service.scm" <>) gexps))
@@ -530,23 +567,11 @@ ACTIVATION-SCRIPT-TYPE."
(use-modules (gnu build activation)
(guix build utils))
- ;; Make sure the user accounting database exists. If it
- ;; does not exist, 'setutxent' does not create it and
- ;; thus there is no accounting at all.
- (close-port (open-file "/var/run/utmpx" "a0"))
-
- ;; Same for 'wtmp', which is populated by mingetty et
- ;; al.
+ (mkdir-p "/var/run") ;for the PID files
(mkdir-p "/var/log")
- (close-port (open-file "/var/log/wtmp" "a0"))
-
- ;; Set up /run/current-system. Among other things this
- ;; sets up locales, which the activation snippets
- ;; executed below may expect.
- (activate-current-system)
- ;; Run the services' activation snippets.
- ;; TODO: Use 'load-compiled'.
+ ;; XXX TODO
+ ;; (activate-hurd-system)
(for-each primitive-load '#$actions)))))
(define (gexps->activation-gexp gexps)
- 03/16: gnu: guix: Update to 52ce01b974., (continued)
- 03/16: gnu: guix: Update to 52ce01b974., guix-commits, 2020/05/05
- 04/16: syscalls: Cross-build fix for alignof*, sizeof*., guix-commits, 2020/05/05
- 06/16: system: hurd: Add hurd-default-essential-services., guix-commits, 2020/05/05
- 07/16: system: hurd: Add hurd-grub-configuration-file., guix-commits, 2020/05/05
- 05/16: system: vm: Add defaults for the Hurd., guix-commits, 2020/05/05
- 09/16: system: Add 'hurd' field to <operating-system>., guix-commits, 2020/05/05
- 12/16: services: hurd: Add hurd-etc-sevcices., guix-commits, 2020/05/05
- 08/16: system: hurd: Add hurd-grub-minimal-bootloader., guix-commits, 2020/05/05
- 11/16: system: examples: Add bare-hurd.tmpl., guix-commits, 2020/05/05
- 16/16: HACK: hurd-etc-service: apply target force, guix-commits, 2020/05/05
- 13/16: system: Add hurd activation.,
guix-commits <=
- 14/16: DRAFT services: hurd: Use activation-service, hurd-etc-service., guix-commits, 2020/05/05
- 10/16: system: vm: Initial vm-image support for the Hurd., guix-commits, 2020/05/05
- 15/16: HACK hurd-etc-service: add with-parameters *ugh*, guix-commits, 2020/05/05