summaryrefslogtreecommitdiff
path: root/gnu/build/hurd-boot.scm
diff options
context:
space:
mode:
authorJan (janneke) Nieuwenhuizen <janneke@gnu.org>2020-04-30 15:40:07 +0200
committerJan Nieuwenhuizen <janneke@gnu.org>2020-06-08 14:26:14 +0200
commit68d8c094659565fe19abc1c433a17337ce5cacb7 (patch)
tree4f97b2413193eab93839f647a5cdcca9575dab7b /gnu/build/hurd-boot.scm
parentb37c544196898cc3dfa3da07ed344fbe11abc120 (diff)
gnu: services: Add %hurd-startup-service.
This decouples startup of the Hurd from the "hurd" package, moving the RC script into SYSTEM. * gnu/packages/hurd.scm (hurd)[inputs]: Remove hurd-rc-script. [arguments]: Do not substitute it. Update "runsystem.sh" to parse kernel arguments and exec into --system=SYSTEM/rc. (hurd-rc-script): Move to... * gnu/services.scm (%hurd-rc-file): ...this new variable. (hurd-rc-entry): New procedure. (%hurd-startup-service): Use it in new variable. * gnu/system.scm (hurd-default-essential-services): Use it.
Diffstat (limited to 'gnu/build/hurd-boot.scm')
-rw-r--r--gnu/build/hurd-boot.scm35
1 files changed, 19 insertions, 16 deletions
diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm
index 729822dcbd..09326233d2 100644
--- a/gnu/build/hurd-boot.scm
+++ b/gnu/build/hurd-boot.scm
@@ -153,27 +153,30 @@ XXX TODO: use settrans/setxattr instead of MAKEDEV
(lambda ()
(with-error-to-port (%make-void-port "w")
(lambda ()
- (zero? (system* "showtrans" "-s" node)))))))
-
- (for-each (match-lambda
- ((node command)
- (unless (translated? node)
- (mkdir-p (dirname node))
- (apply invoke "settrans" "-c" node command))))
- translators)
-
- (format #t "Creating essential device nodes...\n")
- (with-directory-excursion "/dev"
- (invoke "MAKEDEV" "--devdir=/dev" "std")
- (invoke "MAKEDEV" "--devdir=/dev" "vcs")
- (invoke "MAKEDEV" "--devdir=/dev" "tty1""tty2" "tty3" "tty4" "tty5" "tty6")
- (invoke "MAKEDEV" "--devdir=/dev" "ptyp0" "ptyp1" "ptyp2")
- (invoke "MAKEDEV" "--devdir=/dev" "console"))
+ (zero? (system* "showtrans" "--silent" node)))))))
(let* ((args (command-line))
(system (find-long-option "--system" args))
(to-load (find-long-option "--load" args)))
+ (format #t "Creating essential servers...\n")
+ (setenv "PATH" (string-append system "/profile/bin"
+ ":" system "/profile/sbin"))
+ (for-each (match-lambda
+ ((node command)
+ (unless (translated? node)
+ (mkdir-p (dirname node))
+ (apply invoke "settrans" "--create" node command))))
+ translators)
+
+ (format #t "Creating essential device nodes...\n")
+ (with-directory-excursion "/dev"
+ (invoke "MAKEDEV" "--devdir=/dev" "std")
+ (invoke "MAKEDEV" "--devdir=/dev" "vcs")
+ (invoke "MAKEDEV" "--devdir=/dev" "tty1""tty2" "tty3" "tty4" "tty5" "tty6")
+ (invoke "MAKEDEV" "--devdir=/dev" "ptyp0" "ptyp1" "ptyp2")
+ (invoke "MAKEDEV" "--devdir=/dev" "console"))
+
(false-if-exception (delete-file "/hurd"))
(let ((hurd/hurd (readlink* (string-append system "/profile/hurd"))))
(symlink hurd/hurd "/hurd"))