SVN: geninitrd/trunk/mod-usbkbd.sh

arekm arekm at pld-linux.org
Sat Mar 24 19:27:27 CET 2012


Author: arekm
Date: Sat Mar 24 19:27:27 2012
New Revision: 12511

Modified:
   geninitrd/trunk/mod-usbkbd.sh
Log:
Detect Logitech Unifying Device. Unfortunately I know no way do detect keyboards only.

Modified: geninitrd/trunk/mod-usbkbd.sh
==============================================================================
--- geninitrd/trunk/mod-usbkbd.sh	(original)
+++ geninitrd/trunk/mod-usbkbd.sh	Sat Mar 24 19:27:27 2012
@@ -13,15 +13,28 @@
 	local modules i module bInterfaceClass bInterfaceProtocol
 
 	for i in /sys/class/input/input*; do
-		[ ! -f $i/device/bInterfaceClass -o ! -f $i/device/bInterfaceProtocol ] && continue
-		bInterfaceClass=$(cat $i/device/bInterfaceClass)
-		bInterfaceProtocol=$(cat $i/device/bInterfaceProtocol)
-		if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
+		# standard usb keyboards
+		if [ -f $i/device/bInterfaceClass -a -f $i/device/bInterfaceProtocol ]; then
+			bInterfaceClass=$(cat $i/device/bInterfaceClass)
+			bInterfaceProtocol=$(cat $i/device/bInterfaceProtocol)
+			if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
+				module=$(readlink $i/device/driver/module)
+				module=$(basename $module)
+	
+				if [ -n "$module" ]; then
+					debug "Found USB Keyboard: $(cat $i/name)"
+					modules="$modules $module"
+				fi
+			fi
+		fi
+
+		# logitech unifying receiver (unfortunately I know no way to detect keyboard only)
+		if grep -qil "Logitech Unifying Device" $i/name; then
 			module=$(readlink $i/device/driver/module)
 			module=$(basename $module)
 
 			if [ -n "$module" ]; then
-				debug "Found USB Keyboard: $(cat $i/name)"
+				debug "Found USB Logitech Unifying Device: $(cat $i/name)"
 				modules="$modules $module"
 			fi
 		fi


More information about the pld-cvs-commit mailing list