summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-11-10 16:39:29 +0100
committerDave Reisner <dreisner@archlinux.org>2012-11-24 00:01:34 +0100
commit826562e35278faa7c40b3b78a5d51223bee28d00 (patch)
tree3276860787f538bf93bf517b46d18e93bc8f401a
parent70f54ce9e6898d0f28a6b1d2911eb82ce902d429 (diff)
downloadmkinitcpio-826562e35278faa7c40b3b78a5d51223bee28d00.tar.gz
mkinitcpio-826562e35278faa7c40b3b78a5d51223bee28d00.tar.xz
usbinput: use autodetection on newer kernels
This is a partial "revert" of 822a88700e since kernels as of 3.5 add module aliases for hid devices. Fixes FS#32575. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--install/usbinput15
1 files changed, 13 insertions, 2 deletions
diff --git a/install/usbinput b/install/usbinput
index f427600..a292345 100644
--- a/install/usbinput
+++ b/install/usbinput
@@ -1,9 +1,20 @@
#!/bin/bash
build() {
+ local major minor
+
add_checked_modules -f '(_cs|sl811_hcd|isp116x_hcd)' '/usb/host'
- add_all_modules '/hid/hid-'
- add_module 'usbhid?'
+
+ # As of 3.5, modaliases seem to be exported for HID
+ # devices, so we can leverage autodetection.
+ IFS=.- read major minor _ <<<"$KERNELVERSION"
+ if (( major > 3 || (major == 3 && minor >= 5) )); then
+ add_checked_modules '/hid/hid'
+ else
+ add_all_modules '/hid/hid'
+ fi
+
+ add_module 'usbhid'
}
help() {