aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/rc.sysinit
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/rc.sysinit')
-rwxr-xr-xrc.d/rc.sysinit37
1 files changed, 37 insertions, 0 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index a6093c70..375e5fe5 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -258,6 +258,43 @@ if [ -f /etc/sysconfig/harddisks ] && [ -x /sbin/hdparm ]; then
fi
fi
+# Initialize USB controller and HID devices
+
+usb=1
+modprobe usb-controller 2>/dev/null || usb=0
+if [ $usb == "0" ] ; then
+ usbpresent=`grep -i usb /proc/pci`
+ ioinfo=`grep -A2 -i usb /proc/pci |tail -n 1`
+ uhci=`echo $ioinfo |grep "I/O at"`
+ if [ -n "$usbpresent" ]; then
+ usb=1
+ if [ -n "$uhci" ]; then
+ modprobe uhci 2>/dev/null || usb=0
+ else
+ modprobe usb-ohci 2>/dev/null || usb=0
+ usbcontroller="usb-ohci"
+ fi
+ fi
+fi
+if [ $usb == "1" ]; then
+ action "Initializing USB controller: " /bin/true
+fi
+
+if [ $usb == "1" ]; then
+ sleep 5
+ action "Mount USB filesystem" mount -t usbdevfs usbdevfs /proc/bus/usb
+ mouseoutput=`cat /proc/bus/usb/devices|grep -E "^I.*Cls=03.*Prot=02"`
+ kbdoutput=`cat /proc/bus/usb/devices|grep -E "^I.*Cls=03.*Prot=01"`
+ if [ -n "$kbdoutput" ] || [ -n "$mouseoutput" ]; then
+ action "Initializing USB HID interface" modprobe hid 2> /dev/null
+ fi
+ if [ -n "$kbdoutput" ]; then
+ action "Initializing USB keyboard:" modprobe keybdev
+ fi
+ if [ -n "$mouseoutput" ]; then
+ action "Initializing USB mouse" modprobe mousedev
+ fi
+fi
# Update quotas if fsck was run on /.
if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then