* hardware-scan: load modules for all supported USB devices
automatically. Of course this should be triggered when a USB device is plugged in (from udev). svn path=/nixos/trunk/; revision=10451
This commit is contained in:
parent
b078ef6c70
commit
9802ed58ee
@ -3,27 +3,26 @@
|
|||||||
{
|
{
|
||||||
name = "hardware-scan";
|
name = "hardware-scan";
|
||||||
|
|
||||||
job = "
|
job = ''
|
||||||
start on udev
|
start on udev
|
||||||
|
|
||||||
script
|
script
|
||||||
for i in ${toString kernelModules}; do
|
for i in ${toString kernelModules}; do
|
||||||
echo \"Loading kernel module $i...\"
|
echo "Loading kernel module $i..."
|
||||||
${modprobe}/sbin/modprobe $i || true
|
${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
|
done
|
||||||
|
|
||||||
fi
|
if test -n "${toString doHardwareScan}" -a ! -e /var/run/safemode; then
|
||||||
end script
|
|
||||||
|
|
||||||
";
|
# 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
|
||||||
|
|
||||||
|
fi
|
||||||
|
end script
|
||||||
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user