3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/upstart-jobs/hardware-scan.nix
Eelco Dolstra 119df37858 * Generate a wrapper around modprobe that sets MODULE_DIR. This is
important for /proc/sys/kernel/modprobe, i.e., modprobing by the
  kernel.

svn path=/nixos/trunk/; revision=8164
2007-03-04 01:16:24 +00:00

30 lines
634 B
Nix

{modprobe, doHardwareScan, kernelModules}:
{
name = "hardware-scan";
job = "
start on udev
script
for i in ${toString kernelModules}; do
echo \"Loading kernel module $i...\"
${modprobe}/sbin/modprobe $i || true
done
if test -n \"${toString doHardwareScan}\" -a ! -e /var/run/safemode; then
# Try to load modules for all PCI devices.
for i in /sys/bus/pci/devices/*/modalias; do
echo \"Trying to load a module for $(basename $(dirname $i))...\"
${modprobe}/sbin/modprobe $(cat $i) || true
echo \"\"
done
fi
end script
";
}