]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
Another way for findings usb keyboard drivers that works on newer kernels.
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 15 Jul 2019 17:59:46 +0000 (19:59 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 15 Jul 2019 18:01:02 +0000 (20:01 +0200)
mod-usbkbd.sh

index 0dd0d20f0692b4a0b4d37888cb642c1100f1a51b..ff8f4420f25fbcd4a31e41cf0cd955457d74406e 100644 (file)
@@ -10,6 +10,23 @@ find_modules_usbkbd() {
 
        local modules i module bInterfaceClass bInterfaceProtocol
 
+        for i in /sys/bus/usb/devices/*-*:*; do
+                # standard usb keyboards
+                if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
+                        bInterfaceClass=$(cat $i/bInterfaceClass)
+                        bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
+                        if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
+                                module=$(readlink $i/driver/module)
+                                module=$(basename $module)
+
+                                if [ -n "$module" ]; then
+                                        verbose "Found USB Keyboard driver: $module"
+                                        modules="$modules $module"
+                                fi
+                        fi
+                fi
+        done
+
        for i in /sys/class/input/input*; do
                # standard usb keyboards
                if [ -f $i/device/bInterfaceClass -a -f $i/device/bInterfaceProtocol ]; then
This page took 0.575524 seconds and 4 git commands to generate.