Page 1 of 1

Linux Driver 8.5.1 using DMKS

Posted: Thu 19. Jul 2018, 12:37
by pevsonic
Hi all,

It's a shame that the driver source doesn't automatically set up DKMS... I've been following the following process to set up DKMS for the peak driver 8.5.1 on Ubuntu 16.04 test boxes to save my sanity which I hope will be of use to others if I share it.

Make sure dkms and headers are installed :

Code: Select all

sudo apt install -y dkms build-essential linux-headers-$(uname -r)
Install and test build the driver :

Code: Select all

# Must be root for all of this
sudo su -

# Get and unpack
cd /usr/src
wget http://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-8.5.1.tar.gz
tar -xf peak-linux-driver-8.5.1.tar.gz

# Test build.
# We need to do this at least once as it automatically blacklists the 
# standard kernel driver for us.
cd /usr/src/peak-linux-driver-8.5.1
make NET=NETDEV_SUPPORT 
sudo make install

# Remove the installed module (not needed)
sudo rm -f /lib/modules/$(uname -r)/misc/pcan.ko
Create a new dkms conf file e.g. using emacs :

Code: Select all

emacs /usr/src/peak-linux-driver-8.5.1/dkms.conf
Create the file with the following content :

Code: Select all

PACKAGE_NAME="peak-linux-driver-dkms"
PACKAGE_VERSION="8.5.1"
CLEAN="make clean"
MAKE[0]="make NET=NETDEV_SUPPORT all  VERSION=${kernelver} KERNEL_LOCATION=/usr/src/linux-headers-${kernelver}"
BUILT_MODULE_NAME[0]="pcan"
BUILT_MODULE_LOCATION[0]="driver/"
DEST_MODULE_LOCATION[0]="/extra"
AUTOINSTALL="yes"
Install and build the driver using DKMS :

Code: Select all

sudo dkms add peak-linux-driver/8.5.1
sudo dkms build peak-linux-driver/8.5.1
sudo dkms install peak-linux-driver/8.5.1

sudo dkms status | grep peak

modinfo pcan
If required, this can be manually removed via :

Code: Select all

sudo dkms remove -m peak-linux-driver -v 8.5.1 --all

It'd be grand if the driver install Makefile could do something similar as well...!

~Pev

Re: Linux Driver 8.5.1 using DMKS

Posted: Thu 19. Jul 2018, 15:15
by PEAK-Support
Thank you for your post - we have notice it and our developers will see if we could include the DMKS feature in the future.

Re: Linux Driver 8.5.1 using DMKS

Posted: Wed 9. Oct 2019, 10:22
by tomtom
It seems that the driver's Makefile now takes the `DKMS_CONF` option. When set, a corresponding DKMS configuration will be generated in the driver directory.

Code: Select all

wget https://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-8.9.0.tar.gz
tar -xvf peak-linux-driver-8.9.0.tar.gz
sudo mv peak-linux-driver-8.9.0/driver /usr/src/peak-linux-driver-8.9.0
sudo make -C /usr/src/peak-linux-driver-8.9.0 do_dkms_conf DKMS_CONF=dkms.conf

sudo dkms add peak-linux-driver/8.9.0
sudo dkms build peak-linux-driver/8.9.0
sudo dkms install peak-linux-driver/8.9.0