From 66a99a06761b2cf0aa3fa6d70e97e767ab237fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 13 Sep 2014 10:53:47 +0200 Subject: [PATCH] services: udev: Allow the use of eudev. * gnu/services/base.scm (udev-service): Adjust 'start' method to support eudev in addition to udev. --- gnu/services/base.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 2ff89a575f..320a58697d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -527,8 +527,16 @@ extra rules from the packages listed in @var{rules}." (documentation "Populate the /dev directory, dynamically.") (start #~(lambda () + (define find + (@ (srfi srfi-1) find)) + (define udevd - (string-append #$udev "/libexec/udev/udevd")) + ;; Choose the right 'udevd'. + (find file-exists? + (map (lambda (suffix) + (string-append #$udev suffix)) + '("/libexec/udev/udevd" ;udev + "/sbin/udevd")))) ;eudev (define (wait-for-udevd) ;; Wait until someone's listening on udevd's control @@ -548,7 +556,9 @@ extra rules from the packages listed in @var{rules}." (setenv "LINUX_MODULE_DIRECTORY" "/run/booted-system/kernel/lib/modules") + ;; The first one is for udev, the second one for eudev. (setenv "UDEV_CONFIG_FILE" #$udev.conf) + (setenv "EUDEV_RULES_DIRECTORY" #$rules) (let ((pid (primitive-fork))) (case pid