Skip to content

Commit 9542078

Browse files
committed
Add basic DKMS support
Add dkms.conf. Adjust Makefile to support DKMS build. Handle DKMS-installed module location in hid-rebind.
1 parent 0f09d2b commit 9542078

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
ifneq ($(KERNELRELEASE),)
21
obj-m := hid-kye.o hid-uclogic.o hid-polostar.o
3-
else
4-
KDIR := /lib/modules/$(shell uname -r)/build
2+
KVERSION := $(shell uname -r)
3+
KDIR := /lib/modules/$(KVERSION)/build
54
PWD := $(shell pwd)
65
UDEV_RULES := /lib/udev/rules.d/90-hid-rebind.rules
76
DEPMOD_CONF := /etc/depmod.d/digimend.conf
@@ -21,4 +20,3 @@ uninstall:
2120
/lib/modules/*/extra/hid-uclogic.ko
2221
udevadm control --reload
2322
depmod -a
24-
endif

dkms.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
PACKAGE_NAME="digimend"
2+
PACKAGE_VERSION="6"
3+
AUTOINSTALL="yes"
4+
MAKE[0]="make KVERSION=$kernelver"
5+
BUILT_MODULE_NAME[0]="hid-kye"
6+
BUILT_MODULE_NAME[1]="hid-uclogic"
7+
BUILT_MODULE_NAME[2]="hid-polostar"
8+
DEST_MODULE_LOCATION[0]="/extra"
9+
DEST_MODULE_LOCATION[1]="/extra"
10+
DEST_MODULE_LOCATION[2]="/extra"

hid-rebind

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ write_ignore_enodev() {
5151
cur_driver=""
5252
fi
5353

54-
# Choose a matching module installed under .../extra/
54+
# Choose a matching module installed under /extra or /updates
5555
new_module=$(
5656
modprobe -R "$MODALIAS" | tr - _ |
5757
while read -r m; do
58-
if modinfo -F filename "$m" | grep -q /extra/; then
58+
if modinfo -F filename "$m" |
59+
grep -q '/extra/\|/updates/'; then
5960
echo "$m"
6061
break
6162
fi

0 commit comments

Comments
 (0)