Skip to content

Commit

Permalink
Use target kernel dir when building with DKMS
Browse files Browse the repository at this point in the history
Previously DKMS would fail on kernel upgrades since uname -r would still return the running kernel version. DKMS gives us a "kernel_source_dir" so we use that to build the module.
  • Loading branch information
hannesmann committed Oct 21, 2020
1 parent 440a714 commit b15caee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
obj-m += gcadapter_oc.o
ccflags-y := -std=gnu99
KERNEL_SOURCE_DIR := /lib/modules/$(shell uname -r)/build

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
make -C $(KERNEL_SOURCE_DIR) M=$(PWD) modules

clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
make -C $(KERNEL_SOURCE_DIR) M=$(PWD) clean

2 changes: 1 addition & 1 deletion gcadapter_oc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Hannes Mann");
MODULE_DESCRIPTION("Filter kernel module to set the polling rate of the Wii U/Mayflash GameCube Adapter to a custom value.");
MODULE_VERSION("1.3");
MODULE_VERSION("1.4");

static struct usb_device* adapter_device = NULL;

Expand Down
6 changes: 3 additions & 3 deletions packaging/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# Contributor: Hannes Mann <[email protected]>

pkgname=gcadapter-oc-dkms
pkgver=1.3
pkgver=1.4
pkgrel=1
pkgdesc="Kernel module for overclocking the Nintendo Wii U/Mayflash GameCube adapter."
arch=('any')
url="https://github.com/HannesMann/gcadapter-oc-kmod"
license=('GPL2')
depends=('dkms')
source=('https://github.com/HannesMann/gcadapter-oc-kmod/archive/v1.3.tar.gz'
source=('https://github.com/HannesMann/gcadapter-oc-kmod/archive/v1.4.tar.gz'
'dkms.conf')
md5sums=('SKIP'
'75ae8140a90cb150cb3f56cf816d440c')
'aad917366718c6335b1dc6f2e921a539')

prepare() {
echo "gcadapter_oc" > gcadapter-oc.conf
Expand Down
4 changes: 2 additions & 2 deletions packaging/arch/dkms.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PACKAGE_NAME="gcadapter_oc"
PACKAGE_VERSION="@PKGVER@"
MAKE[0]="make"
CLEAN="make clean"
MAKE[0]="make KERNEL_SOURCE_DIR=$kernel_source_dir"
CLEAN="make KERNEL_SOURCE_DIR=$kernel_source_dir clean"
BUILT_MODULE_NAME[0]="gcadapter_oc"
DEST_MODULE_LOCATION[0]="/extramodules"
AUTOINSTALL="yes"

0 comments on commit b15caee

Please sign in to comment.