summary refs log tree commit diff
path: root/gnu/services/base.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-06-29 22:06:29 +0200
committerLudovic Courtès <ludo@gnu.org>2014-06-29 22:06:29 +0200
commit081c5b2d66b6f9bdd1b966a96640b7ec4df8d5a6 (patch)
tree3c17551221c9760e35bde103c1c971d0b2796f43 /gnu/services/base.scm
parent62f0a4792b89a0a734a06ad5667ae109ef4b4d83 (diff)
downloadguix-081c5b2d66b6f9bdd1b966a96640b7ec4df8d5a6.tar.gz
services: udev: Make sure modules are found, and use "udevadm settle".
* gnu/services/base.scm (udev-service): Set $LINUX_MODULE_DIRECTORY.  In
  the parent, invoke "udevadm settle" before "udevadm trigger".
Diffstat (limited to 'gnu/services/base.scm')
-rw-r--r--gnu/services/base.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 0df4f652da..bab07aa4b7 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -409,6 +409,10 @@ hydra.gnu.org are used by default."
              (requirement '(root-file-system))
              (documentation "Populate the /dev directory.")
              (start #~(lambda ()
+                        ;; Allow udev to find the modules.
+                        (setenv "LINUX_MODULE_DIRECTORY"
+                                "/run/booted-system/kernel/lib/modules")
+
                         (let ((pid (primitive-fork)))
                           (case pid
                             ((0)
@@ -421,6 +425,9 @@ hydra.gnu.org are used by default."
                              (execl (string-append #$udev "/libexec/udev/udevd")
                                     "udevd"))
                             (else
+                             ;; Wait for things to settle down.
+                             (system* (string-append #$udev "/bin/udevadm")
+                                      "settle")
                              ;; Create a bunch of devices.
                              (system* (string-append #$udev "/bin/udevadm")
                                       "trigger")