* Removing hardware-scan.nix also removed the loading of the

kernel modules listed in config.boot.kernelModules.  So do
  that in the udev job for lack of a better place.

svn path=/nixos/trunk/; revision=12249
This commit is contained in:
Eelco Dolstra 2008-07-03 10:45:14 +00:00
parent 5f60393ffe
commit 6ed65c2d95
2 changed files with 17 additions and 9 deletions

View File

@ -88,7 +88,7 @@ let
# The udev daemon creates devices nodes and runs programs when
# hardware events occur.
(import ../upstart-jobs/udev.nix {
inherit modprobe;
inherit modprobe config;
inherit (pkgs) stdenv writeText substituteAll udev procps;
inherit (pkgs.lib) cleanSource;
firmwareDirs =
@ -101,7 +101,6 @@ let
extraUdevPkgs =
pkgs.lib.optional config.services.hal.enable pkgs.hal
++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007;
sndMode = config.services.udev.sndMode;
})
# Makes LVM logical volumes available.

View File

@ -1,10 +1,12 @@
{ stdenv, writeText, substituteAll, cleanSource, udev, procps, firmwareDirs, modprobe
, extraUdevPkgs ? []
, sndMode ? "0600"
, config
}:
let
cfg = config.services.udev;
firmwareLoader = substituteAll {
src = ./udev-firmware-loader.sh;
path = "${stdenv.coreutils}/bin";
@ -24,12 +26,12 @@ let
#KERNEL=="sr[0-9]", BUS=="scsi", SYMLINK+="cdrom cdrom-%k"
# ALSA sound devices.
KERNEL=="controlC[0-9]*", NAME="snd/%k", MODE="${sndMode}"
KERNEL=="hwC[D0-9]*", NAME="snd/%k", MODE="${sndMode}"
KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k", MODE="${sndMode}"
KERNEL=="midiC[D0-9]*", NAME="snd/%k", MODE="${sndMode}"
KERNEL=="timer", NAME="snd/%k", MODE="${sndMode}"
KERNEL=="seq", NAME="snd/%k", MODE="${sndMode}"
KERNEL=="controlC[0-9]*", NAME="snd/%k", MODE="${cfg.sndMode}"
KERNEL=="hwC[D0-9]*", NAME="snd/%k", MODE="${cfg.sndMode}"
KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k", MODE="${cfg.sndMode}"
KERNEL=="midiC[D0-9]*", NAME="snd/%k", MODE="${cfg.sndMode}"
KERNEL=="timer", NAME="snd/%k", MODE="${cfg.sndMode}"
KERNEL=="seq", NAME="snd/%k", MODE="${cfg.sndMode}"
# Firmware loading.
SUBSYSTEM=="firmware", ACTION=="add", RUN+="${firmwareLoader}"
@ -87,6 +89,13 @@ in
# Get rid of possible old udev processes.
${procps}/bin/pkill -u root "^udevd$" || true
# Do the loading of additional stage 2 kernel modules.
# Maybe this isn't the best place...
for i in ${toString config.boot.kernelModules}; do
echo "Loading kernel module $i..."
${modprobe}/sbin/modprobe $i || true
done
# Start udev.
${udev}/sbin/udevd --daemon