[projects/geninitrd] Another way for findings usb keyboard drivers that works on newer kernels.

arekm arekm at pld-linux.org
Mon Jul 15 20:01:09 CEST 2019


commit 662fd5a3adac2080640fa4eacd34d72504526175
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Jul 15 19:59:46 2019 +0200

    Another way for findings usb keyboard drivers that works on newer kernels.

 mod-usbkbd.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
index 0dd0d20..ff8f442 100644
--- a/mod-usbkbd.sh
+++ b/mod-usbkbd.sh
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/geninitrd.git/commitdiff/662fd5a3adac2080640fa4eacd34d72504526175



More information about the pld-cvs-commit mailing list