[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/04: HACK: system: hurd: Export some things for VM
From: |
guix-commits |
Subject: |
03/04: HACK: system: hurd: Export some things for VM |
Date: |
Sat, 2 May 2020 05:40:16 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit ea118f62201fd77fb2ec4b06fd98f481002f7d97
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sat May 2 11:24:59 2020 +0200
HACK: system: hurd: Export some things for VM
---
gnu/system/hurd.scm | 132 ++++++++++++++++++++++++++++------------------------
1 file changed, 70 insertions(+), 62 deletions(-)
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index e7fcdbd..6980f42 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -60,7 +60,14 @@
hurd-grub-minimal-bootloader
%base-packages/hurd
%base-services/hurd
- %hurd-default-operating-system))
+ %hurd-default-operating-system
+
+ ;; XXX Remove once we break the Shepherd bootstrap cycle
+ %hurd-boot-fstab
+ %hurd-boot-passwd
+ %hurd-boot-group
+ %hurd-boot-shadow
+ hurd-shepherd.conf-hack))
;;; Commentary:
;;;
@@ -210,6 +217,59 @@ menuentry \"GNU\" {
(define (hurd-shepherd-services os)
(append-map hurd-service->shepherd-service (operating-system-services os)))
+(define %hurd-boot-fstab
+ (plain-file "fstab"
+ "# This file was generated from your Guix configuration. Any
changes
+# will be lost upon reboot or reconfiguration.
+
+/dev/hd0s1 / ext2 defaults
+"))
+
+(define %hurd-boot-passwd
+ (plain-file "passwd"
+ "root:x:0:0:root:/root:/bin/sh
+guixbuilder:x:1:1:guixbuilder:/var/empty:/bin/no-sh
+sshd:x:2:2:sshd:/var/empty:/bin/no-sh
+"))
+
+(define %hurd-boot-group
+ (plain-file "group"
+ "guixbuild:x:1:guixbuilder
+"))
+
+(define %hurd-boot-shadow
+ (plain-file "shadow"
+ "root::17873::::::
+"))
+
+;; XXX Ideally...almost...
+(define (hurd-shepherd.conf--Includes-fake-services os)
+ (shepherd-configuration-file
+ (append-map list
+ (service-value
+ (fold-services (operating-system-services os)
+ #:target-type
+ shepherd-root-service-type)))))
+
+;; XXX Uglier..closer to running...
+(define (hurd-shepherd.conf--Errors-out-on-missing-services os)
+ (shepherd-configuration-file
+ (filter
+ (lambda (value)
+ ;; XXX Remove file-systems, loopback, syslogd, user-processes
+ ;; those are fake/don't work yet on the Hurd
+ (pk "prov" (memq (car (shepherd-service-provision value))
+ '(console guix-daemon ssh-daemon ttys
+ user-processes))))
+ (service-value
+ (fold-services (operating-system-services os)
+ #:target-type
+ shepherd-root-service-type)))))
+
+;; XXX Tempory hack using hurd-service->shepherd-service
+(define (hurd-shepherd.conf-hack os)
+ (shepherd-configuration-file (hurd-shepherd-services os)))
+
(define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach) (os
%hurd-default-operating-system))
"Return a cross-built GNU/Hurd image."
@@ -245,61 +305,9 @@ menuentry \"GNU\" {
(define grub.cfg
(hurd-grub-configuration-file #f '() #:system "i586-pc-gnu"))
- (define fstab
- (plain-file "fstab"
- "# This file was generated from your Guix configuration. Any
changes
-# will be lost upon reboot or reconfiguration.
-
-/dev/hd0s1 / ext2 defaults
-"))
-
- (define passwd
- (plain-file "passwd"
- "root:x:0:0:root:/root:/bin/sh
-guixbuilder:x:1:1:guixbuilder:/var/empty:/bin/no-sh
-sshd:x:2:2:sshd:/var/empty:/bin/no-sh
-"))
-
- (define group
- (plain-file "group"
- "guixbuild:x:1:guixbuilder
-"))
-
- (define shadow
- (plain-file "shadow"
- "root::17873::::::
-"))
-
- ;; XXX Ideally...almost...
- (define shepherd.conf--Includes-fake-services
- (with-parameters ((%current-target-system "i586-pc-gnu"))
- (shepherd-configuration-file
- (append-map list
- (service-value
- (fold-services (operating-system-services os)
- #:target-type
- shepherd-root-service-type))))))
-
- ;; XXX Uglier..closer to running...
- (define shepherd.conf--Errors-out-on-missing-services
- (with-parameters ((%current-target-system "i586-pc-gnu"))
- (shepherd-configuration-file
- (filter
- (lambda (value)
- ;; XXX Remove file-systems, loopback, syslogd, user-processes
- ;; those are fake/don't work yet on the Hurd
- (pk "prov" (memq (car (shepherd-service-provision value))
- '(console guix-daemon ssh-daemon ttys
- user-processes))))
- (service-value
- (fold-services (operating-system-services os)
- #:target-type
- shepherd-root-service-type))))))
-
- ;; XXX Tempory hack using hurd-service->shepherd-service
(define shepherd.conf
(with-parameters ((%current-target-system "i586-pc-gnu"))
- (shepherd-configuration-file (hurd-shepherd-services os))))
+ (hurd-shepherd.conf-hack os)))
(define boot-activation
(with-parameters ((%current-target-system "i586-pc-gnu"))
@@ -347,11 +355,11 @@ sshd:x:2:2:sshd:/var/empty:/bin/no-sh
(directory "/run")
(directory "/run/current-system")
("/run/current-system/profile" -> ,system-profile)
- ("/etc/fstab" -> ,fstab)
+ ("/etc/fstab" -> ,%hurd-boot-fstab)
;; Hmm, someone runs chown which before (or while?) we run
/boot/activation
- ("/etc/group" -> ,group)
- ("/etc/passwd" -> ,passwd)
- ("/etc/shadow" -> ,shadow)
+ ("/etc/group" -> ,%hurd-boot-group)
+ ("/etc/passwd" -> ,%hurd-boot-passwd)
+ ("/etc/shadow" -> ,%hurd-boot-shadow)
(file "/etc/resolv.conf"
"nameserver 10.0.2.3\n")
("/etc/motd" -> ,(file-append (with-parameters ((%current-target-system
@@ -380,10 +388,10 @@ sshd:x:2:2:sshd:/var/empty:/bin/no-sh
#:device-nodes 'hurd
#:inputs `(("system" ,system-profile)
("grub.cfg" ,grub.cfg)
- ("fstab" ,fstab)
- ("passwd" ,passwd)
- ("group" ,group)
- ("shadow" ,shadow)
+ ("fstab" ,hurd-boot-fstab)
+ ("passwd" ,%hurd-boot-passwd)
+ ("group" ,%hurd-boot-group)
+ ("shadow" ,%hurd-boot-shadow)
("shepherd.conf" ,shepherd.conf)
("boot-activation" ,boot-activation)
("root-.gitconfig" ,root-.gitconfig))