From d346d2ec33fc53a7731bf5f5a547db3c8c4ac2c1 Mon Sep 17 00:00:00 2001 From: Jeff Palmer Date: Mon, 31 Jul 2017 11:21:30 -0400 Subject: [PATCH] Add DKMS support This will add dkms support, and make installations easier. Especially when upgrading the system from one kernel version to another. DKMS will handle kernel upgrades automatically. --- drivers/linux/Makefile | 20 ++++++++++++++++---- drivers/linux/README.md | 14 ++++++++++++++ drivers/linux/dkms.conf | 6 ++++++ 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 drivers/linux/README.md create mode 100644 drivers/linux/dkms.conf diff --git a/drivers/linux/Makefile b/drivers/linux/Makefile index 33bdb3f..e5b1ec4 100644 --- a/drivers/linux/Makefile +++ b/drivers/linux/Makefile @@ -1,6 +1,18 @@ +VERSION=0.0.1 obj-m+=panda.o -all: - make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules -clean: - make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean +link: + sudo dkms add `pwd` + +build: + sudo dkms build panda/$(VERSION) + +install: + sudo dkms install panda/$(VERSION) + +all: build install + +uninstall: + sudo dkms uninstall panda/$(VERSION) + sudo dkms remove panda/$(VERSION) --all + diff --git a/drivers/linux/README.md b/drivers/linux/README.md new file mode 100644 index 0000000..26019d6 --- /dev/null +++ b/drivers/linux/README.md @@ -0,0 +1,14 @@ +Installs the panda linux kernel driver using DKMS. + +This will allow the panda to work with tools such as `can-utils` + + +installation: + - make link + - make all + - make install + +uninstall: + - make uninstall + + diff --git a/drivers/linux/dkms.conf b/drivers/linux/dkms.conf new file mode 100644 index 0000000..da9cba0 --- /dev/null +++ b/drivers/linux/dkms.conf @@ -0,0 +1,6 @@ +PACKAGE_NAME="panda" +PACKAGE_VERSION="0.0.1" +BUILT_MODULE_NAME[0]="panda" +DEST_MODULE_LOCATION[0]="/kernel/drivers/net/panda/" +AUTOINSTALL="yes" +