2 # geninitrd mod: usbkbd
4 find_modules_usbkbd() {
5 verbose "Finding USB keyboard modules"
7 if [ "$(echo /sys/class/input/input*)" = "/sys/class/input/input*" ]; then
11 local modules i module bInterfaceClass bInterfaceProtocol
13 for i in /sys/bus/usb/devices/*-*:*; do
14 # standard usb keyboards
15 if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
16 bInterfaceClass=$(cat $i/bInterfaceClass)
17 bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
18 if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
19 module=$(readlink $i/driver/module)
20 module=$(basename $module)
22 if [ -n "$module" ]; then
23 verbose "Found USB Keyboard driver: $module"
24 modules="$modules $module"
30 for i in /sys/class/input/input*; do
31 # standard usb keyboards
32 if [ -f $i/device/bInterfaceClass -a -f $i/device/bInterfaceProtocol ]; then
33 bInterfaceClass=$(cat $i/device/bInterfaceClass)
34 bInterfaceProtocol=$(cat $i/device/bInterfaceProtocol)
35 if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
36 module=$(readlink $i/device/driver/module)
37 module=$(basename $module)
39 if [ -n "$module" ]; then
40 verbose "Found USB Keyboard: $(cat $i/name)"
41 modules="$modules $module"
46 # logitech unifying receiver (unfortunately I know no way to detect keyboard only)
47 if grep -qi "Logitech Unifying Device" $i/name; then
48 module=$(readlink $i/device/driver/module)
49 module=$(basename $module)
51 if [ -n "$module" ]; then
52 verbose "Found USB Logitech Unifying Device: $(cat $i/name)"
53 modules="$modules $module"
58 if [ -n "$modules" ]; then
60 for m in $(find_modules_by_class "0c03"); do