#!/sbin/itype # This is a i file, used by initng parsed by install_service # NAME: # DESCRIPTION: # WWW: service system/usb { need = system/bootmisc; script start = { # Make sure we insert usbcore if its a module if [ -f /proc/modules ] then # >/dev/null to hide errors from non-USB users for i in `/bin/grep "driver: .*-hcd" /etc/sysconfig/hwconf|cut -d" " -f2` do /sbin/modprobe ${i} >/dev/null 2>&1 done fi # Check what USB fs the kernel support. Currently # 2.5+ kernels, and later 2.4 kernels have 'usbfs', # while older kernels have 'usbdevfs'. usbfs=`/bin/grep -Eow "usb(dev)?fs" /proc/filesystems` if [ -n "${usbfs}" -a -e /proc/bus/usb -a ! -e /proc/bus/usb/devices ] then usbgid=`/usr/bin/awk -F: '/^usb:/{print $3; exit}' /etc/group` if [ -n "${usbgid}" ] then /bin/mount -t ${usbfs} usbfs /proc/bus/usb ${usbgid:+-o devmode=0664,devgid=${usbgid}} >/dev/null 2>&1 & else /bin/mount -t ${usbfs} usbfs /proc/bus/usb >/dev/null 2>&1 & fi fi }; }