2007-03-04 02:16:24 +01:00
|
|
|
{modprobe, doHardwareScan, kernelModules}:
|
2006-11-20 18:28:08 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "hardware-scan";
|
|
|
|
|
2008-02-01 22:50:29 +01:00
|
|
|
job = ''
|
|
|
|
start on udev
|
2006-11-20 18:28:08 +01:00
|
|
|
|
2008-02-01 22:50:29 +01:00
|
|
|
script
|
|
|
|
for i in ${toString kernelModules}; do
|
|
|
|
echo "Loading kernel module $i..."
|
|
|
|
${modprobe}/sbin/modprobe $i || true
|
2006-12-23 00:34:42 +01:00
|
|
|
done
|
|
|
|
|
2008-02-01 22:50:29 +01:00
|
|
|
if test -n "${toString doHardwareScan}" -a ! -e /var/run/safemode; then
|
|
|
|
|
|
|
|
# Try to load modules for all PCI and USB devices.
|
|
|
|
for i in /sys/bus/pci/devices/*/modalias /sys/bus/usb/devices/*/modalias; do
|
|
|
|
echo "Trying to load a module for $(basename $(dirname $i))..."
|
|
|
|
${modprobe}/sbin/modprobe $(cat $i) || true
|
|
|
|
echo ""
|
|
|
|
done
|
2006-11-20 18:28:08 +01:00
|
|
|
|
2008-02-01 22:50:29 +01:00
|
|
|
fi
|
|
|
|
end script
|
|
|
|
'';
|
2006-11-20 18:28:08 +01:00
|
|
|
|
|
|
|
}
|