From e315b9db4a3abc7d0c587f3b44a812bac4cc2938 Mon Sep 17 00:00:00 2001 From: xaizek Date: Wed, 18 Jun 2025 20:43:11 +0300 Subject: [PATCH] Revert "Makefile: don't install the file as is for DKMS" This reverts commit ebbe59b205c971457139ff512a89a424ee80fe3f. It caused difficulties with packaging the module which require relevant knowledge to resolve. So far it seems simpler to revert this modification. --- Makefile | 11 ++++------- dkms.conf | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a8063f8..08ff1b7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -makefile := obj-m += nct6687.o +obj-m += nct6687.o curpwd := $(shell pwd) kver ?= $(shell uname -r) @@ -10,8 +10,7 @@ fedoraver := $(shell sed -n 's/.*Fedora release \([^ ]*\).*/\1/p' /etc/fedora- build: rm -rf ${curpwd}/${kver} mkdir -p ${curpwd}/${kver} - cp ${curpwd}/nct6687.c ${curpwd}/${kver} - echo '${makefile}' > ${curpwd}/${kver}/Makefile + cp ${curpwd}/Makefile ${curpwd}/nct6687.c ${curpwd}/${kver} cd ${curpwd}/${kver} make -C /lib/modules/${kver}/build M=${curpwd}/${kver} modules install: build @@ -31,8 +30,7 @@ akmod/build: fi sudo dnf install -y rpmdevtools kmodtool mkdir -p ${curpwd}/.tmp/nct6687d-1.0.${commitcount}/nct6687d - cp LICENSE nct6687.c ${curpwd}/.tmp/nct6687d-1.0.${commitcount}/nct6687d - echo '${makefile}' > ${curpwd}/.tmp/nct6687d-1.0.${commitcount}/nct6687d/Makefile + cp LICENSE Makefile nct6687.c ${curpwd}/.tmp/nct6687d-1.0.${commitcount}/nct6687d cd .tmp && tar -czvf nct6687d-1.0.${commitcount}.tar.gz nct6687d-1.0.${commitcount} && cd - mkdir -p ${curpwd}/.tmp/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} cp ${curpwd}/.tmp/nct6687d-1.0.${commitcount}.tar.gz ${curpwd}/.tmp/rpmbuild/SOURCES/ @@ -56,8 +54,7 @@ dkms/build: dkms/install: rm -rf ${curpwd}/dkms mkdir -p ${curpwd}/dkms - cp ${curpwd}/dkms.conf ${curpwd}/nct6687.c ${curpwd}/dkms - echo '${makefile}' > ${curpwd}/dkms/Makefile + cp ${curpwd}/dkms.conf ${curpwd}/Makefile ${curpwd}/nct6687.c ${curpwd}/dkms sudo rm -rf /usr/src/nct6687d-1 sudo cp -rT dkms /usr/src/nct6687d-1 sudo dkms install nct6687d/1 diff --git a/dkms.conf b/dkms.conf index dd07512..d8fc2b1 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,6 @@ PACKAGE_NAME="nct6687d" PACKAGE_VERSION="1" +MAKE[0]="make kver=${kernelver} dkms/build" BUILT_MODULE_NAME[0]="nct6687" DEST_MODULE_LOCATION[0]="/kernel/drivers/hwmon/" AUTOINSTALL="yes"