2006-11-20 18:28:08 +01:00
|
|
|
# !!! Don't like it that I have to pass the kernel here.
|
2006-12-23 00:34:42 +01:00
|
|
|
{kernel, module_init_tools, doHardwareScan, kernelModules}:
|
2006-11-20 18:28:08 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "hardware-scan";
|
|
|
|
|
|
|
|
job = "
|
2006-12-13 13:17:38 +01:00
|
|
|
start on udev
|
2006-11-20 18:28:08 +01:00
|
|
|
|
|
|
|
script
|
|
|
|
export MODULE_DIR=${kernel}/lib/modules/
|
2006-12-23 00:34:42 +01:00
|
|
|
|
|
|
|
for i in ${toString kernelModules}; do
|
|
|
|
echo \"Loading kernel module $i...\"
|
|
|
|
${module_init_tools}/sbin/modprobe $i || true
|
2006-11-20 18:28:08 +01:00
|
|
|
done
|
2006-12-23 00:34:42 +01:00
|
|
|
|
|
|
|
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))...\"
|
|
|
|
${module_init_tools}/sbin/modprobe $(cat $i) || true
|
|
|
|
echo \"\"
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
2006-11-20 18:28:08 +01:00
|
|
|
end script
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|