[bug#63527,v5,07/11] hurd-boot: Setup pci-arbiter and rumpdisk translators.
Commit Message
* gnu/build/hurd-boot.scm (make-hurd-device-nodes): Create "servers/bus/pci.
(set-hurd-device-translators): Create transators for pci-arbiter, rumpdisk,
and /dev/wd0..4s1..4.
---
gnu/build/hurd-boot.scm | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
Comments
Janneke Nieuwenhuizen writes:
> * gnu/build/hurd-boot.scm (make-hurd-device-nodes): Create "servers/bus/pci.
> (set-hurd-device-translators): Create transators for pci-arbiter, rumpdisk,
> and /dev/wd0..4s1..4.
Of course, that's rather /dev/wd0..3s1..4.
Changed commit message.
Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
> * gnu/build/hurd-boot.scm (make-hurd-device-nodes): Create "servers/bus/pci.
> (set-hurd-device-translators): Create transators for pci-arbiter, rumpdisk,
> and /dev/wd0..4s1..4.
[...]
> + ,@(append-map (lambda (n)
> + (let* ((n (number->string n))
> + (drive (string-append "dev/wd" n))
> + (disk (string-append "@/dev/disk:wd" n)))
> + `((,drive ("/hurd/storeio" ,disk) #o600)
> + ,@(map (lambda (p)
> + (let ((p (number->string p)))
> + `(,(string-append drive "s" p)
> + ("/hurd/storeio"
> + "--store-type=typed"
> + ,(string-append
> + "part:" p ":device:@/dev/disk:wd0"))
Shouldn’t “/dev/disk:wd0” be “,disk” instead?
Ludovic Courtès writes:
> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> * gnu/build/hurd-boot.scm (make-hurd-device-nodes): Create "servers/bus/pci.
>> (set-hurd-device-translators): Create transators for pci-arbiter, rumpdisk,
>> and /dev/wd0..4s1..4.
>
> [...]
>
>> + ,@(append-map (lambda (n)
>> + (let* ((n (number->string n))
>> + (drive (string-append "dev/wd" n))
>> + (disk (string-append "@/dev/disk:wd" n)))
>> + `((,drive ("/hurd/storeio" ,disk) #o600)
>> + ,@(map (lambda (p)
>> + (let ((p (number->string p)))
>> + `(,(string-append drive "s" p)
>> + ("/hurd/storeio"
>> + "--store-type=typed"
>> + ,(string-append
>> + "part:" p ":device:@/dev/disk:wd0"))
>
> Shouldn’t “/dev/disk:wd0” be “,disk” instead?
Oops, yeah sure! This could have been quite a search bug search one
day...
Changed to
,@(append-map (lambda (n)
(let* ((n (number->string n))
(drive (string-append "dev/wd" n))
(disk (string-append "@/dev/disk:wd" n)))
`((,drive ("/hurd/storeio" ,disk) #o600)
,@(map (lambda (p)
(let ((p (number->string p)))
`(,(string-append drive "s" p)
("/hurd/storeio"
"--store-type=typed"
,(string-append
"part:" p ":device:" disk))
#o660)))
(iota 4 1)))))
(iota 4 0))
Greetings,
Janneke
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020-2022 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -105,7 +105,7 @@ (define* (make-hurd-device-nodes #:optional (root "/"))
;; TODO: Set the 'gnu.translator' extended attribute for passive translator
;; settings?
- )
+ (mkdir-p (scope "servers/bus/pci")))
(define (passive-translator-xattr? file-name)
"Return true if FILE-NAME has an extended @code{gnu.translator} attribute
@@ -183,7 +183,8 @@ (define* (set-hurd-device-translators #:optional (root "/"))
(mkdir-p dir))))
(define servers
- '(("servers/crash-dump-core" ("/hurd/crash" "--dump-core"))
+ '(("servers/bus/pci" ("/hurd/pci-arbiter"))
+ ("servers/crash-dump-core" ("/hurd/crash" "--dump-core"))
("servers/crash-kill" ("/hurd/crash" "--kill"))
("servers/crash-suspend" ("/hurd/crash" "--suspend"))
("servers/password" ("/hurd/password"))
@@ -216,6 +217,8 @@ (define* (set-hurd-device-translators #:optional (root "/"))
;; 'fd_to_filename' in libc expects it.
("dev/fd" ("/hurd/magic" "--directory" "fd") #o555)
+ ("dev/rumpdisk"("/hurd/rumpdisk") #o660)
+
;; Create a number of ttys; syslogd writes to tty12 by default.
;; FIXME: Creating /dev/tty12 leads the console client to switch to
;; tty12 when syslogd starts, which is confusing for users. Thus, do
@@ -239,7 +242,22 @@ (define* (set-hurd-device-translators #:optional (root "/"))
("/hurd/term" ,(string-append "/dev/ttyp" n)
"pty-slave" ,(string-append "/dev/ptyp" n))
#o666))))
- (iota 10 0))))
+ (iota 10 0))
+ ,@(append-map (lambda (n)
+ (let* ((n (number->string n))
+ (drive (string-append "dev/wd" n))
+ (disk (string-append "@/dev/disk:wd" n)))
+ `((,drive ("/hurd/storeio" ,disk) #o600)
+ ,@(map (lambda (p)
+ (let ((p (number->string p)))
+ `(,(string-append drive "s" p)
+ ("/hurd/storeio"
+ "--store-type=typed"
+ ,(string-append
+ "part:" p ":device:@/dev/disk:wd0"))
+ #o660)))
+ (iota 4 1)))))
+ (iota 4 0))))
(for-each scope-set-translator servers)
(mkdir* "dev/vcs/1")
@@ -252,6 +270,7 @@ (define* (set-hurd-device-translators #:optional (root "/"))
(false-if-EEXIST (symlink "/dev/fd/1" (scope "dev/stdout")))
(false-if-EEXIST (symlink "/dev/fd/2" (scope "dev/stderr")))
(false-if-EEXIST (symlink "crash-dump-core" (scope "servers/crash")))
+ (false-if-EEXIST (symlink "/dev/rumpdisk" (scope "dev/disk")))
;; Make sure /etc/mtab is a symlink to /proc/mounts.
(false-if-exception (delete-file (scope "etc/mtab")))