Skip to content

Commit

Permalink
Add basic DKMS support
Browse files Browse the repository at this point in the history
Add dkms.conf. Adjust Makefile to support DKMS build. Handle
DKMS-installed module location in hid-rebind.
  • Loading branch information
spbnick committed Oct 11, 2015
1 parent 0f09d2b commit 9542078
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 2 additions & 4 deletions Makefile
@@ -1,7 +1,6 @@
ifneq ($(KERNELRELEASE),)
obj-m := hid-kye.o hid-uclogic.o hid-polostar.o
else
KDIR := /lib/modules/$(shell uname -r)/build
KVERSION := $(shell uname -r)
KDIR := /lib/modules/$(KVERSION)/build
PWD := $(shell pwd)
UDEV_RULES := /lib/udev/rules.d/90-hid-rebind.rules
DEPMOD_CONF := /etc/depmod.d/digimend.conf
Expand All @@ -21,4 +20,3 @@ uninstall:
/lib/modules/*/extra/hid-uclogic.ko
udevadm control --reload
depmod -a
endif
10 changes: 10 additions & 0 deletions dkms.conf
@@ -0,0 +1,10 @@
PACKAGE_NAME="digimend"
PACKAGE_VERSION="6"
AUTOINSTALL="yes"
MAKE[0]="make KVERSION=$kernelver"
BUILT_MODULE_NAME[0]="hid-kye"
BUILT_MODULE_NAME[1]="hid-uclogic"
BUILT_MODULE_NAME[2]="hid-polostar"
DEST_MODULE_LOCATION[0]="/extra"
DEST_MODULE_LOCATION[1]="/extra"
DEST_MODULE_LOCATION[2]="/extra"
5 changes: 3 additions & 2 deletions hid-rebind
Expand Up @@ -51,11 +51,12 @@ write_ignore_enodev() {
cur_driver=""
fi

# Choose a matching module installed under .../extra/
# Choose a matching module installed under /extra or /updates
new_module=$(
modprobe -R "$MODALIAS" | tr - _ |
while read -r m; do
if modinfo -F filename "$m" | grep -q /extra/; then
if modinfo -F filename "$m" |
grep -q '/extra/\|/updates/'; then
echo "$m"
break
fi
Expand Down

0 comments on commit 9542078

Please sign in to comment.