0

I'm trying to enable a kernel module I've got from a device vendor to work with DKMS. I can successfully build the module and manually install and enable it. But when using DKMS a get an error that doesn't help me in any way:

$ sudo dkms build -m biokernbase -v 3.1.2.1

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.13.0-123-generic all KVERSION=3.13.0-123-generic DKMS=y
....
.ko failed for: 3.13.0-123-generic (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/biokernbase/3.1.2.1/build/ for more information.

make.log

DKMS make.log for biokernbase-3.1.2.1 for kernel 3.13.0-123-generic (x86_64)
Wed Dec 13 17:22:51 CET 2017
make -C /lib/modules/3.13.0-123-generic/build M=/var/lib/dkms/biokernbase/3.1.2.1/build modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-123-generic'
  CC [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/main.o
  CC [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/event.o
  CC [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/usbreader.o
  CC [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/memory.o
  CC [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/misc.o
  CC [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/isa.o
  LD [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/biokernbase.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /var/lib/dkms/biokernbase/3.1.2.1/build/biokernbase.mod.o
  LD [M]  /var/lib/dkms/biokernbase/3.1.2.1/build/biokernbase.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-123-generic'

dkms.conf

PACKAGE_NAME="biokernbase"
PACKAGE_VERSION="3.1.2.1"
CLEAN="make clean DKMS=y"
MAKE[0]="make all KVERSION=$kernelver DKMS=y"
BUILT_MODULE_NAME[0]="biokernbase"
DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
AUTOINSTALL="yes"

Makefile

DRV_NAME := biokernbase
DRV_PATH := daqnavi
KVERSION := $(shell uname -r)
KDIR     := /lib/modules/$(KVERSION)/build
BASE_DIR := /usr/lib/daqnavi

obj-m := $(DRV_NAME).o
$(DRV_NAME)-objs := main.o event.o usbreader.o memory.o misc.o isa.o

EXTRA_CFLAGS += -I$(BASE_DIR)/include -I$(BASE_DIR)/include/hw -I$(BASE_DIR)/include/linux
SYMBOL_PATH = $(BASE_DIR)/modules

all:
    $(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
    $(MAKE) -C $(KDIR) M=$(PWD) clean
    rm -f *.o *~ .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers

Update 1: kernel compatibility

I'm currently on Ubuntu 14.04.5 LTS with kernel 3.13.0-123-generic.

The vendor's documentation states compatibility with Ubuntu 12.04/14.04/15.10, kernel version 3.2/3.13/4.2.

When I manually copy the biokernbase.ko built by dkms to /lib/modules/3.13.0-123-generic/kernel/drivers/misc/, the kernel module seems to be loaded successfully:

$ sudo modprobe biokernbase; echo $?
0

Any ideas or hints are highly appreciated.

  • 1
    What version of Ubuntu are you running? It initially looks like your kernel may be too old for this driver. Did the driver come with any documentation that indicates what kernel versions it's compatible with? What happens if you sudo modprobe biokernbase.ko? – heynnema Dec 13 '17 at 16:52
  • @heynnema sry for the late reply, please see my additions to the question above. – Hurzelchen Dec 15 '17 at 9:48
0

Remove the manually copied biokernbase.ko from /lib/modules/3.13.0-123-generic/kernel/drivers/misc/.

Edit dkms.conf like this... (keep the original as a .bak file)...

PACKAGE_NAME="biokernbase"
PACKAGE_VERSION="3.1.2.1"
CLEAN="make clean"
MAKE[0]="'make' all KVER=${kernelver}"
BUILT_MODULE_NAME[0]="biokernbase"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="yes"

Perform a sudo dkms build again and see if this fixes the problem.

0

I was working with this exact same module (from Advantech). I found that their included dkms.conf has some stray \r carriage returns that caused a check in the dkms script to fail. Try running dos2unix on dkms.conf or otherwise ensure there are no unwanted whitespace characters.

  • 1
    Interesting hint, I will try that when I have the chance. I'm currently running my own integration into the kernel install/uninstall hooks – Hurzelchen Jul 16 '18 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.