From 93d07f966e479cb86193aedbc6b61c547bd7057f Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Wed, 19 May 2021 15:42:04 +0300 Subject: [PATCH] debian: make sure depmod uses the correct version By default it uses the currently running kernel, which is not necessary the kernel the package was built for. Fix this by generating the path on package creation stage. --- Makefile | 2 ++ debian/rules | 3 ++- debian/{scst.postinst => scst.postinst.in} | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) rename debian/{scst.postinst => scst.postinst.in} (98%) diff --git a/Makefile b/Makefile index 0df19af3f..8becf0947 100644 --- a/Makefile +++ b/Makefile @@ -369,6 +369,8 @@ dpkg: ../scst_$(VERSION).orig.tar.gz debian/scst.dkms && \ sed 's/%{KVER}/$(KVER)/' \ debian/scst.preinst && \ + sed 's/%{KVER}/$(KVER)/' \ + debian/scst.postinst && \ output_files=( \ ../*_$(VERSION)-$(DEBIAN_REVISION)_*.deb \ ../*_$(VERSION)-$(DEBIAN_REVISION)_*.ddeb \ diff --git a/debian/rules b/debian/rules index 0c49bded8..af061fb37 100755 --- a/debian/rules +++ b/debian/rules @@ -29,7 +29,8 @@ 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 -x debian/scst.preinst + scripts/clean-source-tree -x debian/changelog -x debian/compat -x debian/scst.preinst \ + -x debian/scst.postinst build: make 2release && \ diff --git a/debian/scst.postinst b/debian/scst.postinst.in similarity index 98% rename from debian/scst.postinst rename to debian/scst.postinst.in index d1569e33c..f535eebd9 100644 --- a/debian/scst.postinst +++ b/debian/scst.postinst.in @@ -23,7 +23,7 @@ case "$1" in mkdir -p /var/lib/scst/dif_tags mkdir -p /var/lib/scst/pr mkdir -p /var/lib/scst/vdev_mode_pages - depmod;; + depmod "%{KVER}";; abort-upgrade|abort-remove|abort-deconfigure) ;;