diff options
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/build/hurd-boot.scm | 42 | ||||
| -rw-r--r-- | gnu/build/image.scm | 2 | ||||
| -rw-r--r-- | gnu/system/image.scm | 6 | ||||
| -rw-r--r-- | gnu/system/images/hurd.scm | 12 |
4 files changed, 50 insertions, 12 deletions
diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index ce198cce961..578378bb208 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm | |||
| @@ -74,10 +74,18 @@ Return the value associated with OPTION, or #f on failure." | |||
| 74 | (loop (absolute target) (+ depth 1)) | 74 | (loop (absolute target) (+ depth 1)) |
| 75 | file)))))) | 75 | file)))))) |
| 76 | 76 | ||
| 77 | (define* (make-hurd-device-nodes #:optional (root "/")) | 77 | (define* (make-hurd-device-nodes #:key (root "/") (hurd "/hurd")) |
| 78 | "Make some of the nodes needed on GNU/Hurd." | 78 | "Make some of the nodes needed on GNU/Hurd." |
| 79 | (define (scope dir) | 79 | (define (scope dir) |
| 80 | (string-append root (if (string-suffix? "/" root) "" "/") dir)) | 80 | (in-vicinity root dir)) |
| 81 | |||
| 82 | (define scope-set-translator | ||
| 83 | (match-lambda | ||
| 84 | ((file-name command) | ||
| 85 | (scope-set-translator (list file-name command #o600))) | ||
| 86 | ((file-name command mode) | ||
| 87 | (let ((mount-point (scope file-name))) | ||
| 88 | (set-translator mount-point command mode))))) | ||
| 81 | 89 | ||
| 82 | (mkdir-p (scope "dev")) | 90 | (mkdir-p (scope "dev")) |
| 83 | ;; XXX: We must have `/dev/console` otherwise `console-run` tries to | 91 | ;; XXX: We must have `/dev/console` otherwise `console-run` tries to |
| @@ -114,12 +122,32 @@ Return the value associated with OPTION, or #f on failure." | |||
| 114 | "suspend")) | 122 | "suspend")) |
| 115 | 123 | ||
| 116 | (mkdir-p (scope "servers/socket")) | 124 | (mkdir-p (scope "servers/socket")) |
| 125 | (mkdir-p (scope "servers/bus/pci")) | ||
| 117 | 126 | ||
| 118 | ;; Don't create /servers/socket/1 & co: runsystem does that on first boot. | 127 | ;; Set the 'gnu.translator' extended attribute for passive translator |
| 128 | ;; settings for pipes (servers/socet/1) and mount information (proc/mounts). | ||
| 129 | ;; Pipes are needed for guile-3.0.11 to startup, this enables moving | ||
| 130 | ;; "runsystem" to guile. | ||
| 131 | ;; XXX TODO: Set more passive xattr translators? | ||
| 132 | (define servers | ||
| 133 | `( | ||
| 134 | ;; ("servers/bus/pci" ("/hurd/pci-arbiter")) | ||
| 135 | ;; ("servers/crash-dump-core" ("/hurd/crash" "--dump-core")) | ||
| 136 | ;; ("servers/crash-kill" ("/hurd/crash" "--kill")) | ||
| 137 | ;; ("servers/crash-suspend" ("/hurd/crash" "--suspend")) | ||
| 138 | ;; ("servers/password" ("/hurd/password")) | ||
| 139 | ;; PIPE -- for running runsystem as Guile | ||
| 140 | ("servers/socket/1" (,(in-vicinity hurd "pflocal"))) | ||
| 141 | ;; /servers/socket/2 and /26 are created by 'static-networking-service'. | ||
| 142 | ;; XXX: Spawn pfinet without arguments on these nodes so that a DHCP | ||
| 143 | ;; client has someone to talk to? | ||
| 144 | ("proc" (,(in-vicinity hurd "procfs") "--stat-mode=444")))) | ||
| 119 | 145 | ||
| 120 | ;; TODO: Set the 'gnu.translator' extended attribute for passive translator | 146 | (for-each scope-set-translator servers) |
| 121 | ;; settings? | 147 | |
| 122 | (mkdir-p (scope "servers/bus/pci"))) | 148 | (define devices |
| 149 | '()) | ||
| 150 | (for-each scope-set-translator devices)) | ||
| 123 | 151 | ||
| 124 | (define (passive-translator-xattr? file-name) | 152 | (define (passive-translator-xattr? file-name) |
| 125 | "Return true if FILE-NAME has an extended @code{gnu.translator} attribute | 153 | "Return true if FILE-NAME has an extended @code{gnu.translator} attribute |
| @@ -190,7 +218,7 @@ needed." | |||
| 190 | "Make some of the device nodes needed on GNU/Hurd." | 218 | "Make some of the device nodes needed on GNU/Hurd." |
| 191 | 219 | ||
| 192 | (define (scope dir) | 220 | (define (scope dir) |
| 193 | (string-append root (if (string-suffix? "/" root) "" "/") dir)) | 221 | (in-vicinity root dir)) |
| 194 | 222 | ||
| 195 | (define scope-set-translator | 223 | (define scope-set-translator |
| 196 | (match-lambda | 224 | (match-lambda |
diff --git a/gnu/build/image.scm b/gnu/build/image.scm index dbb87103daf..820dfe202fb 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm | |||
| @@ -322,7 +322,7 @@ register-closure." | |||
| 322 | 322 | ||
| 323 | ;; Populate /dev. | 323 | ;; Populate /dev. |
| 324 | (when make-device-nodes | 324 | (when make-device-nodes |
| 325 | (make-device-nodes root)) | 325 | (make-device-nodes #:root root)) |
| 326 | 326 | ||
| 327 | (when register-closures? | 327 | (when register-closures? |
| 328 | (unless copy-closures? | 328 | (unless copy-closures? |
diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 0e4967012c8..bdf4aff9718 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm | |||
| @@ -352,7 +352,8 @@ set to the given OS." | |||
| 352 | (define-syntax-rule (with-imported-modules* gexp* ...) | 352 | (define-syntax-rule (with-imported-modules* gexp* ...) |
| 353 | (with-extensions gcrypt-sqlite3&co | 353 | (with-extensions gcrypt-sqlite3&co |
| 354 | (with-imported-modules `(,@(source-module-closure | 354 | (with-imported-modules `(,@(source-module-closure |
| 355 | '((gnu build image) | 355 | '((ice-9 optargs) |
| 356 | (gnu build image) | ||
| 356 | (gnu build bootloader) | 357 | (gnu build bootloader) |
| 357 | (gnu build hurd-boot) | 358 | (gnu build hurd-boot) |
| 358 | (gnu build linux-boot) | 359 | (gnu build linux-boot) |
| @@ -360,7 +361,8 @@ set to the given OS." | |||
| 360 | #:select? neither-config-nor-git?) | 361 | #:select? neither-config-nor-git?) |
| 361 | ((guix config) => ,(make-config.scm))) | 362 | ((guix config) => ,(make-config.scm))) |
| 362 | #~(begin | 363 | #~(begin |
| 363 | (use-modules (gnu build image) | 364 | (use-modules (ice-9 optargs) |
| 365 | (gnu build image) | ||
| 364 | (gnu build bootloader) | 366 | (gnu build bootloader) |
| 365 | (gnu build hurd-boot) | 367 | (gnu build hurd-boot) |
| 366 | (gnu build linux-boot) | 368 | (gnu build linux-boot) |
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index ba223b1e0cd..c65a9c8f13d 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com> | 2 | ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com> |
| 3 | ;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org> | 3 | ;;; Copyright © 2020, 2024, 2026 Janneke Nieuwenhuizen <janneke@gnu.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 6 | ;;; |
| @@ -22,6 +22,7 @@ | |||
| 22 | #:use-module (gnu bootloader) | 22 | #:use-module (gnu bootloader) |
| 23 | #:use-module (gnu bootloader grub) | 23 | #:use-module (gnu bootloader grub) |
| 24 | #:use-module (gnu image) | 24 | #:use-module (gnu image) |
| 25 | #:use-module (gnu packages hurd) | ||
| 25 | #:use-module (gnu packages ssh) | 26 | #:use-module (gnu packages ssh) |
| 26 | #:use-module (guix platforms x86) | 27 | #:use-module (guix platforms x86) |
| 27 | #:use-module (gnu services) | 28 | #:use-module (gnu services) |
| @@ -97,7 +98,14 @@ | |||
| 97 | #~(lambda* (#:rest args) | 98 | #~(lambda* (#:rest args) |
| 98 | (apply initialize-root-partition | 99 | (apply initialize-root-partition |
| 99 | (append args | 100 | (append args |
| 100 | (list #:make-device-nodes make-hurd-device-nodes | 101 | (list #:make-device-nodes |
| 102 | (lambda device-args | ||
| 103 | (let-keywords (cdr args) #t | ||
| 104 | ((system-directory #f)) | ||
| 105 | (let ((hurd (in-vicinity system-directory | ||
| 106 | "hurd/hurd"))) | ||
| 107 | (apply make-hurd-device-nodes | ||
| 108 | (cons* #:hurd hurd device-args))))) | ||
| 101 | ;; XXX Creating a db.sqlite with journal_mode=WAL | 109 | ;; XXX Creating a db.sqlite with journal_mode=WAL |
| 102 | ;; yields "unable to open database file" on GNU/Hurd | 110 | ;; yields "unable to open database file" on GNU/Hurd |
| 103 | ;; for an sqlite with the hurd-locking-mode.patch; | 111 | ;; for an sqlite with the hurd-locking-mode.patch; |
