diff --git a/Makefile b/Makefile index 77ad72294..0df19af3f 100644 --- a/Makefile +++ b/Makefile @@ -367,6 +367,8 @@ dpkg: ../scst_$(VERSION).orig.tar.gz [ -z "$$DEBFULLNAME" ] || export DEBFULLNAME="Bart Van Assche" &&\ sed 's/%{scst_version}/$(VERSION)/' \ debian/scst.dkms && \ + sed 's/%{KVER}/$(KVER)/' \ + debian/scst.preinst && \ output_files=( \ ../*_$(VERSION)-$(DEBIAN_REVISION)_*.deb \ ../*_$(VERSION)-$(DEBIAN_REVISION)_*.ddeb \ diff --git a/debian/rules b/debian/rules index 8342862e9..0c49bded8 100755 --- a/debian/rules +++ b/debian/rules @@ -29,7 +29,7 @@ export KDIR=$(DEB_KDIR_SET) clean: dh_testdir && \ dh_prep -Xqla_isp/TAGS -Xdebian/changelog && \ - scripts/clean-source-tree -x debian/changelog -x debian/compat + scripts/clean-source-tree -x debian/changelog -x debian/compat -x debian/scst.preinst build: make 2release && \ diff --git a/debian/scst.preinst b/debian/scst.preinst.in similarity index 94% rename from debian/scst.preinst rename to debian/scst.preinst.in index 4d5af2eaf..199a4e275 100644 --- a/debian/scst.preinst +++ b/debian/scst.preinst.in @@ -17,7 +17,7 @@ set -e case "$1" in install) # Remove any existing ib_srpt.ko kernel modules - find "/lib/modules/$(uname -r)" -name ib_srpt.ko -exec rm {} \; + find "/lib/modules/%{KVER}" -name ib_srpt.ko -exec rm {} \; # Remove files installed by "make install" rm -f /usr/local/man/man5/iscsi-scstd.conf.5 rm -f /usr/local/man/man8/iscsi-scst-adm.8