From a96de8b994a7c2b562461724294d2a92b5d9443a Mon Sep 17 00:00:00 2001 From: "Dennis E. Mungai" Date: Fri, 29 Jun 2018 00:18:03 +0300 Subject: [PATCH 1/2] Update build instructions With warnings on DKMS builds (mention the potential for vermagic conflicts if step 1 & 2 are done on the same build), and recommend skipping straight to the DKMS option on systems where DKMS is present. Future proposal: Create a makefile to automate the DKMS setup in one step. --- README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7da359f..79bf397 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,23 @@ Additions - linux-headers - dkms (Only when use this module with the DKMS functionality) +## Warning on installing the module: + +Use either method only. Do not combine installation methods, such as starting with the build step below and proceeding to use the same build artifacts with the DKMS module. Otherwise the module built via dkms will fail to load with an `exec_format` error on newer kernels due to a mismatched version magic. + +This is why the DKMS build step begins with a `make clean` step. + +For convenience, on platforms where DKMS is in use, skip to the DKMS section directly. + ## Build the Module ```sh make clean && make ``` -## dkms +## The DKMS route: -### Add as DKMS Module +### Add as DKMS Module: At first point add the Module ```sh @@ -56,7 +64,7 @@ Load the module with modprobe modprobe tuxedo_keyboard ``` -### Remove DKMS Module +### Uninstalling the DKMS Module: Remove the dkms module ```sh @@ -76,7 +84,7 @@ sudo rm -rf /usr/src/tuxedo_keyboard-1 modprobe tuxedo_keyboard ``` -## Load at Boot-Up +## Load the module on boot: Add Module to /etc/modules ```sh @@ -85,12 +93,17 @@ echo tuxedo_keyboard >> /etc/modules ``` Default Parameters at start. -In this example we start the kernel module with + + +In this example, we start the kernel module with the following settings: + - mode 0 (Custom / Default Mode) - red color for the left side of keyboard - green color for the center of keyboard - blue color for the right side of keyboard +Note that we write its' settings to a `.conf` file under `/etc/modprobe.d` named `tuxedo_keyboard.conf`. + ```sh sudo su echo "options tuxedo_keyboard mode=0 color_left=0xFF0000 color_center=0x00FF00 color_right=0x0000FF" > /etc/modprobe.d/tuxedo_keyboard.conf @@ -184,4 +197,4 @@ Value: 5 Value: 6 ## WAVE -Value: 7 \ No newline at end of file +Value: 7 From c5db7b41152781c64baa5d4227dd4a85b0c3053e Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Tue, 17 Jul 2018 16:13:16 +0200 Subject: [PATCH 2/2] Fix DKMS: Variable specified in Makefile is KDIR, not KERNELDIR --- dkms.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkms.conf b/dkms.conf index 9b225c8..e2353f3 100644 --- a/dkms.conf +++ b/dkms.conf @@ -5,6 +5,6 @@ DEST_MODULE_LOCATION=/kernel/lib/ BUILT_MODULE_NAME=tuxedo_keyboard BUILT_MODULE_LOCATION=src/ -MAKE="make -C . KERNELDIR=/lib/modules/${kernelver}/build" +MAKE="make -C . KDIR=/lib/modules/${kernelver}/build" CLEAN="make -C src/ clean" AUTOINSTALL="yes"