summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-04-07 09:47:36 +0200
committerLudovic Courtès <ludo@gnu.org>2020-04-11 20:59:20 +0200
commitac61e876a4594af763994f0d5d4681ee5284f1f0 (patch)
treebefc9ffa763c03e9e4fe1594ced59766c28a0474 /gnu
parent683cba75ea529c7390a79826124d7798d47d65cd (diff)
downloadguix-ac61e876a4594af763994f0d5d4681ee5284f1f0.tar.gz
linux-boot: Add 'make-hurd-device-nodes'.
* gnu/build/linux-boot.scm (make-hurd-device-nodes): New procedure.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/build/linux-boot.scm31
1 files changed, 31 insertions, 0 deletions
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 787665e320..d1c9f47f33 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -40,6 +40,7 @@
             find-long-option
             find-long-options
             make-essential-device-nodes
+            make-hurd-device-nodes
             make-static-device-nodes
             configure-qemu-networking
 
@@ -323,6 +324,36 @@ one specific hardware device. These we have to create."
   ;; File systems in user space (FUSE).
   (mknod (scope "dev/fuse") 'char-special #o666 (device-number 10 229)))
 
+(define* (make-hurd-device-nodes #:optional (root "/"))
+  "Make some of the nodes needed on GNU/Hurd."
+  (define (scope dir)
+    (string-append root
+                   (if (string-suffix? "/" root)
+                       ""
+                       "/")
+                   dir))
+
+  (mkdir (scope "dev"))
+  (for-each (lambda (file)
+              (call-with-output-file (scope file)
+                (lambda (port)
+                  (chmod port #o666))))
+            '("dev/null"
+              "dev/zero"
+              "dev/full"
+              "dev/random"
+              "dev/urandom"))
+  ;; Don't create /dev/console, /dev/vcs, etc.: they are created by
+  ;; console-run on first boot.
+
+  (mkdir (scope "servers"))
+  (mkdir (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
+  ;; settings?
+  )
+
 (define %host-qemu-ipv4-address
   (inet-pton AF_INET "10.0.2.10"))