]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
Detect Logitech Unifying Device. Unfortunately I know no way do detect keyboards...
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 24 Mar 2012 18:27:27 +0000 (18:27 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 24 Mar 2012 18:27:27 +0000 (18:27 +0000)
svn-id: @12511

mod-usbkbd.sh

index afd1e06e1cef76222d909cf8933bd59cfd3a82dd..0595b5058638f7a62a82d3023e90f3614b819c98 100644 (file)
@@ -13,15 +13,28 @@ find_modules_usbkbd() {
        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
This page took 0.113986 seconds and 4 git commands to generate.