[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
23/43: system: hurd: Add the Shepherd.
From: |
guix-commits |
Subject: |
23/43: system: hurd: Add the Shepherd. |
Date: |
Mon, 20 Apr 2020 07:34:07 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit bc34f5ef2c344029d38c93a8843b637d7cda6d62
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Tue Apr 7 08:03:03 2020 +0200
system: hurd: Add the Shepherd.
This starts console and ttys using the Shepherd. Shepherd is not running as
PID 1 yet, its started from `rc'.
* gnu/system/hurd.scm (%base-packages/hurd): Add "shepherd".
(%base-services/hurd): New variable.
(%hurd-os): New variable.
(hurd-shepherd-services): New function.
(cross-hurd-image): Use them to generate an (unused and incomplete) ...
(shepherd.conf): Generate from services defined in
%hurd-os.
* gnu/packages/hurd.scm (hurd-rc-script): Do not start console, start the
shepherd instead.
(hurd)[arguments]: Create pty devices.
* gnu/system/hurd.scm (shepherd.conf): New file.
---
gnu/packages/hurd.scm | 14 +++++++++-----
gnu/system/hurd.scm | 43 +++++++++++++++++++++++++++++++++++++++++--
2 files changed, 50 insertions(+), 7 deletions(-)
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index dd75879..2637883 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -349,10 +349,13 @@ boot, since this cannot be done from GNU/Linux."
(apply invoke "settrans" "-c" node command))))
'#$translators)
- ;; Start the oh-so-fancy console client.
- (mkdir-p "/var/run") ;for the PID file
- (invoke "console" "--daemonize" "-c" "/dev/vcs"
- "-d" "vga" "-d" "pc_kbd" "-d" "generic_speaker"))))
+ ;; Generate the ssh host keys.
+ (invoke "/run/current-system/profile/bin/ssh-keygen" "-A")
+ (mkdir-p "/var/run") ;for the PID files
+ ;; Hand over to the Shepherd
+ (false-if-exception (delete-file "/var/run/shepherd/socket"))
+ (invoke "/run/current-system/profile/bin/shepherd"
+ "--config" "/etc/shepherd.conf"))))
;; FIXME: We want the program to use the cross-compiled Guile when
;; cross-compiling. But why do we need to be explicit here?
@@ -469,7 +472,8 @@ fsysopts / --writable
# MAKEDEV relies on pipes so this needs to be set up.
settrans -c /servers/socket/1 /hurd/pflocal
-(cd /dev; MAKEDEV -D /dev std vcs tty{1,2,3,4,5,6})\n")))
+(cd /dev; MAKEDEV -D /dev std vcs tty{1,2,3,4,5,6})
+(cd /dev; MAKEDEV -D /dev ptyp{0,1,2,3})\n")))
(substitute* "daemons/runsystem.hurd.sh"
(("export PATH")
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 28ef7cf..9f4d4e2 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -18,6 +18,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu system hurd)
+ #:use-module (srfi srfi-1)
#:use-module (guix gexp)
#:use-module (guix profiles)
#:use-module (guix utils)
@@ -31,6 +32,10 @@
#:use-module (gnu packages guile-xyz)
#:use-module (gnu packages hurd)
#:use-module (gnu packages less)
+ #:use-module (gnu services)
+ #:use-module (gnu services base)
+ #:use-module (gnu services hurd)
+ #:use-module (gnu system)
#:use-module (gnu system vm)
#:export (cross-hurd-image))
@@ -51,10 +56,38 @@
#:system system
#:target target))
+;; XXX: We will replace this by addding (gnu services shepherd).
+(define shepherd-configuration-file
+ (@@ (gnu services shepherd) shepherd-configuration-file))
+
(define %base-packages/hurd
(list hurd bash coreutils file findutils grep sed
guile-3.0 guile-colorized guile-readline
- net-base inetutils less which))
+ net-base inetutils less shepherd which))
+
+(define %base-services/hurd
+ (list (service hurd-user-processes-service-type)
+ (service hurd-console-service-type
+ (hurd-console-configuration (hurd hurd)))
+ (service hurd-ttys-service-type
+ (hurd-ttys-configuration (hurd hurd)))
+ (service guix-service-type
+ (guix-configuration
+ (guix guix)
+ (extra-options '("--disable-chroot"
+ "--disable-deduplication"
+ "--max-jobs=1"))))))
+
+(define %hurd-os
+ (operating-system
+ (host-name "guixygnu")
+ (bootloader #f)
+ (file-systems '())
+ (timezone "GNUrope")
+ (services %base-services/hurd)))
+
+(define (hurd-shepherd-services os)
+ (append-map hurd-service->shepherd-service (operating-system-services os)))
(define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach))
"Return a cross-built GNU/Hurd image."
@@ -136,6 +169,9 @@ if [ -f \"$GUIX_PROFILE/etc/profile\" ]; then
. \"$GUIX_PROFILE/etc/profile\"
fi\n"))
+ (define shepherd.conf
+ (shepherd-configuration-file (hurd-shepherd-services %hurd-os)))
+
(define hurd-directives
`((directory "/servers")
,@(map (lambda (server)
@@ -199,6 +235,7 @@ fi\n"))
"i586-pc-gnu"))
hurd)
"/etc/ttys"))
+ ("/etc/shepherd.conf" -> ,shepherd.conf)
("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system
"i586-pc-gnu"))
bash)
@@ -213,13 +250,15 @@ fi\n"))
("passwd" ,passwd)
("group" ,group)
("etc-profile" ,etc-profile)
- ("shadow" ,shadow))
+ ("shadow" ,shadow)
+ ("shepherd.conf" ,shepherd.conf))
#:copy-inputs? #t
#:os system-profile
#:bootcfg-drv grub.cfg
#:bootloader grub-bootloader
#:register-closures? #f
#:device-nodes 'hurd
+ #:disk-image-size (* 10 (expt 2 30)) ;10GiB
#:extra-directives hurd-directives))
;; Return this thunk so one can type "guix build -f gnu/system/hurd.scm".
- 16/43: services: Add hurd-console-service-type., (continued)
- 16/43: services: Add hurd-console-service-type., guix-commits, 2020/04/20
- 04/43: gnu: texinfo: Cross-build fix: Use host perl in host scripts., guix-commits, 2020/04/20
- 11/43: gnu: hurd: Add NFS support., guix-commits, 2020/04/20
- 13/43: system: hurd: Add less, which to %base-packages/hurd., guix-commits, 2020/04/20
- 14/43: system: hurd: Add /etc/group., guix-commits, 2020/04/20
- 17/43: services: Add hurd-ttys-service-type., guix-commits, 2020/04/20
- 10/43: gnu: Add netdde., guix-commits, 2020/04/20
- 19/43: services: Add guix-daemon-service as a Hurd service., guix-commits, 2020/04/20
- 20/43: services: hurd: Add dummy syslog., guix-commits, 2020/04/20
- 21/43: services: hurd: Add dummy loopback., guix-commits, 2020/04/20
- 23/43: system: hurd: Add the Shepherd.,
guix-commits <=
- 22/43: services: Add openssh-service as a Hurd service., guix-commits, 2020/04/20
- 15/43: services: Add hurd., guix-commits, 2020/04/20
- 12/43: gnu: Add libtirpc/hurd., guix-commits, 2020/04/20
- 25/43: system: gnu: Populate "/etc" from "/boot/activation"., guix-commits, 2020/04/20
- 24/43: HACK use uncompiled .scm for shepherd, guix-commits, 2020/04/20
- 28/43: system: gnu: Add %bootstrap-{gcc, binutils, glibc} for devel profile., guix-commits, 2020/04/20
- 26/43: system: hurd: Add openssh service., guix-commits, 2020/04/20
- 32/43: system: hurd: Add guix., guix-commits, 2020/04/20
- 31/43: HACK gnu: python: Disable tests on the Hurd., guix-commits, 2020/04/20
- 30/43: gnu: tcl: Disable troublesome test on the Hurd., guix-commits, 2020/04/20