Skip to content

Commit

Permalink
Add DKMS support
Browse files Browse the repository at this point in the history
  • Loading branch information
parkerlreed authored and berarma committed Nov 26, 2019
1 parent 3dedf72 commit 3dfe622
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
obj-m := hid-logitech-new.o
hid-logitech-new-y := hid-lg.o hid-lgff.o hid-lg2ff.o hid-lg3ff.o hid-lg4ff.o
ccflags-y := -Idrivers/hid
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
ifneq ($(KERNELRELEASE),)
obj-m := hid-logitech-new.o
hid-logitech-new-y := hid-lg.o hid-lgff.o hid-lg2ff.o hid-lg3ff.o hid-lg4ff.o
ccflags-y := -Idrivers/hid
else
KDIR ?= /lib/modules/`uname -r`/build

default:
Expand All @@ -21,4 +16,6 @@ unload:
rmmod hid-logitech-new
modprobe hid-logitech

endif
clean:
$(MAKE) -C $(KDIR) M=$$PWD clean

27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,29 @@ This module adds the following features:

## Build and install

The module can be installed with DKMS or manually. Follow just one of the
following procedures.

If you want to use DKMS but the module was previously installed with the manual
method delete the module by hand:

`$ sudo rm /lib/modules/$(uname -r)/extra/hid-logitech-new.ko`

### DKMS

This installs the module to the system `src` directory and allows the module to
be rebuilt any time the kernel updates.

From your package manager of choice, install the package providing the `dkms` command.

Download the project to `/usr/src/new-lg4ff`.

Run the command:

`$ sudo dkms install /usr/src/new-lg4ff`

### Manual method

```
$ make
$ sudo make install
Expand All @@ -39,7 +62,9 @@ Unload the module (restoring the in-kernel module):

`$ sudo make unload`

Check that the driver is loaded:
### Check that the driver is loaded

Run:

`sudo dmesg`

Expand Down
8 changes: 8 additions & 0 deletions dkms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PACKAGE_NAME="new-lg4ff"
PACKAGE_VERSION="0.1"
MAKE[0]="make"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="hid-logitech-new"
DEST_MODULE_NAME[0]="hid-logitech"
DEST_MODULE_LOCATION[0]="/kernel/drivers/hid"
AUTOINSTALL="yes"

0 comments on commit 3dfe622

Please sign in to comment.