[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/19: hurd-boot: Support system init: Create essential device nodes.
From: |
guix-commits |
Subject: |
10/19: hurd-boot: Support system init: Create essential device nodes. |
Date: |
Sat, 2 Sep 2023 11:48:57 -0400 (EDT) |
janneke pushed a commit to branch hurd-team
in repository guix.
commit 76285951c23da491edbffc1cb80b54769715e6a1
Author: Janneke Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Tue May 30 18:07:17 2023 +0200
hurd-boot: Support system init: Create essential device nodes.
* gnu/build/hurd-boot.scm (make-hurd-device-nodes): Cater for existing
directories (dev, servers).
(set-hurd-device-translators): Remove /servers/socket/1, that is created by
libexec/console-run. Cater for nonexistent /dev/console.
(boot-hurd-system): Call make-hurd-device-nodes on initial run.
---
gnu/build/hurd-boot.scm | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm
index 19bdbdf6ae..bd19fd5212 100644
--- a/gnu/build/hurd-boot.scm
+++ b/gnu/build/hurd-boot.scm
@@ -79,13 +79,13 @@ Return the value associated with OPTION, or #f on failure."
(define (scope dir)
(string-append root (if (string-suffix? "/" root) "" "/") dir))
- (mkdir (scope "dev"))
+ (mkdir-p (scope "dev"))
;; Don't create /dev/null etc just yet; the store
;; messes-up the permission bits.
;; Don't create /dev/console, /dev/vcs, etc.: they are created by
;; console-run on first boot.
- (mkdir (scope "servers"))
+ (mkdir-p (scope "servers"))
(for-each (lambda (file)
(call-with-output-file (scope (string-append "servers/" file))
(lambda (port)
@@ -100,7 +100,8 @@ Return the value associated with OPTION, or #f on failure."
"kill"
"suspend"))
- (mkdir (scope "servers/socket"))
+ (mkdir-p (scope "servers/socket"))
+
;; Don't create /servers/socket/1 & co: runsystem does that on first boot.
;; TODO: Set the 'gnu.translator' extended attribute for passive translator
@@ -266,7 +267,8 @@ set."
(for-each scope-set-translator servers)
(mkdir* "dev/vcs/1")
(mkdir* "dev/vcs/2")
- (rename-file (scope "dev/console") (scope "dev/console-"))
+ (when (file-exists? (scope "dev/console"))
+ (rename-file (scope "dev/console") (scope "dev/console-")))
(for-each scope-set-translator devices)
(false-if-EEXIST (symlink "/dev/random" (scope "dev/urandom")))
@@ -313,6 +315,10 @@ XXX TODO: use Linux xattr/setxattr to remove (settrans in)
/libexec/RUNSYSTEM
(let ((hurd/hurd (readlink* (string-append system "/profile/hurd"))))
(symlink hurd/hurd "/hurd"))
+ (unless (file-exists? "/servers/startup")
+ (format #t "Creating essential device nodes...\n")
+ (make-hurd-device-nodes))
+
(format #t "Setting-up essential translators...\n")
(setenv "PATH" (string-append system "/profile/bin"))
(set-hurd-device-translators)
- branch hurd-team created (now 17f1e06a5f), guix-commits, 2023/09/02
- 04/19: squash! self: Build directories in chunks of max 25 files at a time. -- typo, guix-commits, 2023/09/02
- 06/19: maint: Support `guix shell' in Guix's git archive with manifest.scm., guix-commits, 2023/09/02
- 07/19: gnu: gdk-pixbuf: Build without gobject-introspection for the Hurd., guix-commits, 2023/09/02
- 09/19: hurd: Support system init in /libexec/runsystem., guix-commits, 2023/09/02
- 11/19: system: hurd: Add procps to %base-packages/hurd., guix-commits, 2023/09/02
- 13/19: DRAFT hurd: Support second boot., guix-commits, 2023/09/02
- 03/19: gnu: guix: Update to 1.4.0-12.329069a2fb., guix-commits, 2023/09/02
- 08/19: gnu: librsvg: Build without gobject-introspection for the Hurd., guix-commits, 2023/09/02
- 10/19: hurd-boot: Support system init: Create essential device nodes.,
guix-commits <=
- 01/19: self: Build directories in chunks of max 25 files at a time., guix-commits, 2023/09/02
- 19/19: Revert "DRAFT daemon: Support chroot builds on GNU/Hurd.", guix-commits, 2023/09/02
- 05/19: squash! self: Build directories in chunks of max 25 files at a time. -- remove gc, guix-commits, 2023/09/02
- 02/19: gnu: guix: Update to 1.4.0-11.45de303d8b., guix-commits, 2023/09/02
- 14/19: DRAFT hurd-boot: Support second boot., guix-commits, 2023/09/02
- 16/19: gnu: Add libc-locales-for-target and glibc-locales/hurd., guix-commits, 2023/09/02
- 18/19: DRAFT daemon: Support chroot builds on GNU/Hurd., guix-commits, 2023/09/02
- 15/19: DRAFT system: examples: Add devel-hurd.tmpl., guix-commits, 2023/09/02
- 17/19: locale: Set %default-locale-definitions to glibc/hurd on the Hurd., guix-commits, 2023/09/02
- 12/19: system: hurd: Add swap-services to hurd-default-essential-services., guix-commits, 2023/09/02