Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 38f65ea438a86e0d7c0fb045e4c010b1 > files > 247

initng-ifiles-0.1.5-4.fc12.x86_64.rpm

#!/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
	};
}