From 5255ad26cec9842ffbdf89365639d73933b6c6df Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Fri, 28 Oct 2016 12:54:50 +0200 Subject: [PATCH] Added fix for archlinux --- Makefile | 2 +- README.md | 10 ++++++++-- install.sh | 29 ++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 91fb7b3..0715a46 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ dkms: clean rm -rf /usr/src/$(MODULE_NAME)-$(MODULE_VER) mkdir /usr/src/$(MODULE_NAME)-$(MODULE_VER) -p cp . /usr/src/$(MODULE_NAME)-$(MODULE_VER) -a - rm -rf /usr/src/$(MODULE_NAME)-$(MODULE_VER)/.hg + rm -rf /usr/src/$(MODULE_NAME)-$(MODULE_VER)/.git $(REMOVE_MODULE) dkms add -m $(MODULE_NAME) -v $(MODULE_VER) dkms build -m $(MODULE_NAME) -v $(MODULE_VER) diff --git a/README.md b/README.md index 8dc5b9b..4506c28 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The kernel reports the chipset as `Microdia` Written for the Perixx PX-1800 USB Keyboard: [Perixx PX-1800 Keyboard](http://www.perixx.com/en/service/Perixx_Manual/GAMING/PX-1800.pdf) -Original base: swoogan.blogspot.de/2014/09/azio-l70-keyboard-linux-driver.html +Original base: http://swoogan.blogspot.de/2014/09/azio-l70-keyboard-linux-driver.html, https://bitbucket.org/Swoogan/aziokbd > NOTE: Makefile and instructions are only tested on Ubuntu 16.04 and Archlinux 2016.10 (Kernel 4.8.4) @@ -40,7 +40,7 @@ Original base: swoogan.blogspot.de/2014/09/azio-l70-keyboard-linux-driver.html **NOTE: install.sh attempts to blacklist the driver for you. You shouldn't need to do anything manually. These instructions are to explain the process, in the event something goes wrong.** -You need to blacklist the device from the generic USB hid driver in order for the aziokbd driver to control it. +You need to blacklist the device from the generic USB hid driver in order for the perixxkbd driver to control it. ## Kernel Module ## If the USB hid driver is compiled as a kernel module you will need to create a quirks file and blacklist it there. @@ -68,3 +68,9 @@ Then run `sudo update-grub` and reboot. Again, if you find that `0x4` doesn't work, try `0x7`. + +## Add to initramfs ## +On Archlinux the module has to be added to `/etc/mkinitcpio.conf`. Otherwise usbhid will fetch the keyboard before perixxkbd is loaded. + +Therefor add "perixxkbd" to the MODULES section and rebuild the initramfs with `sudo mkinitcpio -p linux` + diff --git a/install.sh b/install.sh index a42e9a7..017fa4f 100755 --- a/install.sh +++ b/install.sh @@ -6,12 +6,29 @@ if [[ $1 != 'dkms' ]]; then echo '## Installing package ##' make install + + if [[ $1 -ne 4 ]]; then + quirk='0x0c45:0x7603:0x0007' + echo '## Quirk set to 0007 ##' + else + quirk='0x0c45:0x7603:0x0004' + echo '## Quirk set to 0004 ##' + fi else echo '## Installing package with DKMS ##' make dkms + + if [[ $2 -ne 4 ]]; then + quirk='0x0c45:0x7603:0x0007' + echo '## Quirk set to 0007 ##' + else + quirk='0x0c45:0x7603:0x0004' + echo '## Quirk set to 0004 ##' + fi fi -quirk='0x0c45:0x7603:0x0007' + + modquirk="options usbhid quirks=$quirk" grubquirk="usbhid.quirks=$quirk" @@ -37,6 +54,7 @@ if (lsmod | grep 'usbhid'); then echo '## Attempting to reload usbhid module ##' rmmod usbhid && modprobe usbhid quirks=$quirk echo '## Reload done. Please reboot if the keyboard is not working yet! ##' + echo '## If the keyboard does not work after reboot, try reinstalling the script with ./install.sh [dkms] 4 ##' else echo '## usbhid is compiled into kernel ##' @@ -59,5 +77,14 @@ else fi echo '## You must reboot to load the module ##' + echo '## If the keyboard does not work after reboot, try reinstalling the script with ./install.sh [dkms] 4 ##' fi +if [ -f /etc/mkinitcpio.conf ]; then + echo '## Enabling module in initramfs ##' + + if ! (cat /etc/mkinitcpio.conf | grep "perixxkbd"); then + sed -i 's|^MODULES="|MODULES="perixxkbd |g' /etc/mkinitcpio.conf + fi + mkinitcpio -p linux +fi \ No newline at end of file