[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#73927] [PATCH 03/16] hurd-boot: Support system init: Create essenti
From: |
Janneke Nieuwenhuizen |
Subject: |
[bug#73927] [PATCH 03/16] hurd-boot: Support system init: Create essential device nodes. |
Date: |
Mon, 21 Oct 2024 10:16:59 +0200 |
* 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 4407284acb..daf4fb41ab 100644
--- a/gnu/build/hurd-boot.scm
+++ b/gnu/build/hurd-boot.scm
@@ -79,13 +79,13 @@ (define* (make-hurd-device-nodes #:optional (root "/"))
(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 @@ (define* (make-hurd-device-nodes #:optional (root "/"))
"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
@@ -279,7 +280,8 @@ (define* (set-hurd-device-translators #:optional (root "/"))
(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")))
@@ -326,6 +328,10 @@ (define* (boot-hurd-system #:key (on-error 'debug))
(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)
--
2.46.0
- [bug#73927] [PATCH 00/16] Installer support for (cross) installing the Hurd., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 01/16] system: hurd: Remove qemu networking from %base-services/hurd., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 02/16] gnu: hurd: Support system init in /libexec/runsystem., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 05/16] gnu: hurd: Support second boot., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 07/16] maint: Add installer dependencies to the manifest., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 03/16] hurd-boot: Support system init: Create essential device nodes.,
Janneke Nieuwenhuizen <=
- [bug#73927] [PATCH 06/16] hurd-boot: Support second boot., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 04/16] system: hurd: Add swap-services to hurd-default-essential-services., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 11/16] installer: Fix file-name typos., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 09/16] installer: Align comments., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 10/16] installer: Use "partitioning-page" consistently., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 12/16] installer: Use `%' for parameter %run-command-in-installer., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 13/16] installer: Add dry-run?, Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 08/16] installer: Remove unused (newt) imports., Janneke Nieuwenhuizen, 2024/10/21
- [bug#73927] [PATCH 16/16] DRAFT installer: Support dry-run from Guile via store., Janneke Nieuwenhuizen, 2024/10/21