[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
14/24: system: Add `hurd-activation'.
From: |
guix-commits |
Subject: |
14/24: system: Add `hurd-activation'. |
Date: |
Sun, 17 May 2020 06:00:53 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit e65802f07485d83fbd005976d4cba484e1ea2268
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)
- 02/24: system: vm: Do not register-closures when cross-building., (continued)
- 02/24: system: vm: Do not register-closures when cross-building., guix-commits, 2020/05/17
- 03/24: system: vm: Build vm-image using native qemu., guix-commits, 2020/05/17
- 05/24: system: hurd: Add hurd-default-essential-services., guix-commits, 2020/05/17
- 11/24: system: Use 'hurd' package in label., guix-commits, 2020/05/17
- 08/24: system: Add 'hurd' field to <boot-parameters>., guix-commits, 2020/05/17
- 16/24: gnu: hurd: Create minimal "runsystem" script to invoke "rc"., guix-commits, 2020/05/17
- 07/24: bootloader: Add `<hurd-menu-entry>'., guix-commits, 2020/05/17
- 09/24: bootloader: grub: Add support for '<hurd-menu-entry>'., guix-commits, 2020/05/17
- 13/24: services: hurd: Add `hurd-etc-service'., guix-commits, 2020/05/17
- 12/24: system: examples: Add bare-hurd.tmpl., guix-commits, 2020/05/17
- 14/24: system: Add `hurd-activation'.,
guix-commits <=
- 17/24: services: Add `hurd-console-service-type'., guix-commits, 2020/05/17
- 18/24: services: Add `hurd-getty-service-type'., guix-commits, 2020/05/17
- 19/24: system: hurd: Populate services., guix-commits, 2020/05/17
- 20/24: DRAFT: system: vm: Activate the Hurd., guix-commits, 2020/05/17
- 21/24: system: bare-hurd.tmpl: Add openssh client and service., guix-commits, 2020/05/17
- 22/24: gnu: linux-libre: Add support for gnu.* namespace., guix-commits, 2020/05/17
- 23/24: gnu: hurd: Update to upstream Hurd-reserved xattr index., guix-commits, 2020/05/17
- 06/24: system: Add 'hurd' field to <operating-system>., guix-commits, 2020/05/17
- 04/24: system: vm: Add defaults for the Hurd., guix-commits, 2020/05/17
- 10/24: system: vm: Initial vm-image support for the Hurd., guix-commits, 2020/05/17