From 518f710547b92c3f3a5ef7fdf55be1e8cb66bea1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 17 Apr 2014 12:22:24 +0200 Subject: [PATCH] Fix module loading in systemd-udevd --- nixos/modules/services/hardware/udev.nix | 5 +++++ nixos/modules/system/boot/systemd.nix | 2 +- nixos/tests/misc.nix | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index d218aa1e5e16..875de55b6c6d 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -243,5 +243,10 @@ in fi ''; + systemd.services.systemd-udevd = + { baseUnit = "${config.systemd.package}/example/systemd/system/systemd-udevd.service"; + environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; + }; + }; } diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index a35c3224db2a..36d273564083 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -50,7 +50,7 @@ let # Udev. "systemd-udevd-control.socket" "systemd-udevd-kernel.socket" - "systemd-udevd.service" + #"systemd-udevd.service" "systemd-udev-settle.service" "systemd-udev-trigger.service" diff --git a/nixos/tests/misc.nix b/nixos/tests/misc.nix index 0f57b9f61261..76298f1abd47 100644 --- a/nixos/tests/misc.nix +++ b/nixos/tests/misc.nix @@ -63,6 +63,12 @@ import ./make-test.nix { $machine->succeed('[ "`hostname`" = machine ]'); $machine->succeed('[ "`hostname -s`" = machine ]'); }; + + # Test whether systemd-udevd automatically loads modules for our hardware. + subtest "udev-auto-load", sub { + $machine->waitForUnit('systemd-udev-settle.service'); + $machine->succeed('lsmod | grep psmouse'); + }; ''; }