From 1c92d2785d80bfd5be917eac6c53fbd3da1a3a66 Mon Sep 17 00:00:00 2001 From: Umer Saleem Date: Fri, 3 Feb 2023 19:47:29 +0500 Subject: [PATCH] Update packaging bits to build scst-dbg package This commits updates the Debian packaging bits to build scst-dbg package for kernel modules linked with debug kernel. SCST kernel modules linked with debug kernel need to packaged differently so that they can co-exist with SCST package for modules built for production kernel. The updates in packaging bits are minimal would only apply if KVERS environment variable is configured for debug kernel for TrueNAS SCALE. Signed-off-by: Umer Saleem --- Makefile | 14 ++++++++++---- debian/control.dbgmodules | 18 ++++++++++++++++++ debian/rules | 9 +++++++-- 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 debian/control.dbgmodules diff --git a/Makefile b/Makefile index bdcca8243..d4374f7e0 100644 --- a/Makefile +++ b/Makefile @@ -429,10 +429,16 @@ dpkg: ../scst_$(VERSION).orig.tar.gz echo "KVER=$(KVER)" && \ sed 's/%{scst_version}/$(VERSION)/' \ debian/scst.dkms && \ - sed 's/%{KVER}/$(KVER)/' \ - debian/scst.preinst && \ - sed 's/%{KVER}/$(KVER)/' \ - debian/scst.postinst && \ + if echo "$(KVER)" | grep -q "debug+truenas"; then \ + mv debian/scst.install debian/scst-dbg.install && \ + sed 's/%{KVER}/$(KVER)/' \ + debian/scst-dbg.postinst; \ + else \ + sed 's/%{KVER}/$(KVER)/' \ + debian/scst.preinst && \ + sed 's/%{KVER}/$(KVER)/' \ + debian/scst.postinst; \ + fi && \ output_files=( \ ../*_$(VERSION)-$(DEBIAN_REVISION)_*.deb \ ../*_$(VERSION)-$(DEBIAN_REVISION)_*.ddeb \ diff --git a/debian/control.dbgmodules b/debian/control.dbgmodules new file mode 100644 index 000000000..eb17723bb --- /dev/null +++ b/debian/control.dbgmodules @@ -0,0 +1,18 @@ +Source: scst +Section: net +Priority: optional +Maintainer: Vladislav Bolkhovitin +Build-Depends: debhelper (>= 9), + quilt, + dpkg-dev (>= 1.13.19) +Standards-Version: 4.1.1 +Homepage: http://scst.sourceforge.net + +Package: scst-dbg +Architecture: any +Depends: ${misc:Depends} +Conflicts: scst-dkms +Description: Generic SCSI target framework + SCST is a SCSI target framework that allows local block device data to be + accessed over a storage network via the iSCSI, FC, SRP or FCoE protocol. + This package contains the SCST kernel modules. diff --git a/debian/rules b/debian/rules index 8424310e4..ba515b7a3 100755 --- a/debian/rules +++ b/debian/rules @@ -33,8 +33,13 @@ VERSION:=$(shell head -n1 debian/changelog | sed 's/.*(\([0-9.]*\).*).*/\1/') clean: dh_testdir && \ dh_prep -Xqla_isp/TAGS -Xdebian/changelog && \ - scripts/clean-source-tree -x debian/changelog -x debian/compat -x debian/scst.preinst \ - -x debian/scst.postinst + if echo "$(KVER)" | grep -q "debug+truenas"; then \ + scripts/clean-source-tree -x debian/changelog -x debian/compat -x debian/scst-dbg.install \ + -x debian/scst-dbg.postinst ; \ + else \ + scripts/clean-source-tree -x debian/changelog -x debian/compat -x debian/scst.preinst \ + -x debian/scst.postinst ; \ + fi build: [ -n "$(QLA_INI_DIR)" ] && \