Package: dahdi-dkms
Version: 1:3.1.0+git20230717~dfsg-10
Severity: serious

Hi,

I have again a few updates for the -dkms package.

dkms.conf contains a duplicate module definition which can cause subtle
errors with dkms, therefore I'll make dkms error out on such dkms.conf
files in an upcoming dkms upload. Thus the severity serious as that will
break building modules from your package.

Then I'm setting BUILD_EXCLUSIVE_KERNEL_MIN in dkms.conf to the oldest
supported version and fix up some version constraints, that is something
mostly interesting for QA purposes.


Andreas
>From fe296f9dfe6266c6ff241eb45e360a940b5d4c0e Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Thu, 6 Feb 2025 16:48:06 +0100
Subject: [PATCH 1/4] dkms.conf: drop duplicate module

---
 debian/dkms.conf.in | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/debian/dkms.conf.in b/debian/dkms.conf.in
index 089d33c..66d98ee 100644
--- a/debian/dkms.conf.in
+++ b/debian/dkms.conf.in
@@ -21,10 +21,6 @@ BUILT_MODULE_NAME+=("dahdi_dummy")
 BUILT_MODULE_LOCATION+=("drivers/dahdi/")
 DEST_MODULE_LOCATION+=("/kernel/drivers/telephony/dahdi")
 
-BUILT_MODULE_NAME+=("dahdi_dynamic_eth")
-BUILT_MODULE_LOCATION+=("drivers/dahdi/")
-DEST_MODULE_LOCATION+=("/kernel/drivers/telephony/dahdi")
-
 BUILT_MODULE_NAME+=("dahdi_dynamic")
 BUILT_MODULE_LOCATION+=("drivers/dahdi/")
 DEST_MODULE_LOCATION+=("/kernel/drivers/telephony/dahdi")
-- 
2.39.5

>From b40fc82008eec06508695498bfb2e50e304743d7 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Tue, 25 Mar 2025 11:33:57 +0100
Subject: [PATCH 2/4] dkms.conf: declare BUILD_EXCLUSIVE_KERNEL_MIN="4.3"

---
 debian/dkms.conf.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/dkms.conf.in b/debian/dkms.conf.in
index 66d98ee..221b7af 100644
--- a/debian/dkms.conf.in
+++ b/debian/dkms.conf.in
@@ -3,6 +3,9 @@ PACKAGE_VERSION="#CVERSION#"
 # PCI is required for most devices. USB is used by xpp/ and icE1usb.
 BUILD_EXCLUSIVE_CONFIG="CONFIG_PCI CONFIG_USB"
 
+# strscpy() was introduced in Linux v4.3
+BUILD_EXCLUSIVE_KERNEL_MIN="4.3"
+
 # Items below here should not have to change with each driver version
 PACKAGE_NAME="dahdi"
 MAKE[0]="(make modules KVERS=$kernelver MODULES_EXTRA='dahdi_dummy 
dahdi_echocan_oslec'; make KVERS=$kernelver)"
-- 
2.39.5

>From e8e034884318a39fe149b7d44e5c8510f0d2a53e Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Tue, 25 Mar 2025 11:49:45 +0100
Subject: [PATCH 3/4] timer_setup() was introduced in Linux v4.14

but with a slightly different interface than from Linux v4.15 onwards
---
 debian/patches/1190-timer_setup.patch | 41 +++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 debian/patches/1190-timer_setup.patch

diff --git a/debian/patches/1190-timer_setup.patch 
b/debian/patches/1190-timer_setup.patch
new file mode 100644
index 0000000..23875d9
--- /dev/null
+++ b/debian/patches/1190-timer_setup.patch
@@ -0,0 +1,41 @@
+Author: Andreas Beckmann <a...@debian.org>
+Description: timer_setup() was introduced in Linux v4.14
+
+--- a/include/dahdi/kernel.h
++++ b/include/dahdi/kernel.h
+@@ -1410,7 +1410,16 @@ static inline short dahdi_txtone_nextsam
+ #define TIMER_DATA_TYPE unsigned long
+ #endif
+ 
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++
++/* timer_setup and friends in 4.14 had a slightly different interface than in 
4.15+ */
++#define timer_setup(timer, callback, flags) __setup_timer((timer), 
(TIMER_FUNC_TYPE)(callback), (TIMER_DATA_TYPE)(timer), (flags))
++#undef from_timer
++#define from_timer(var, callback_timer, timer_fieldname) \
++      container_of((struct timer_list *)(callback_timer), \
++                   typeof(*var), timer_fieldname)
++
++#else
+ 
+ #ifdef RHEL_RELEASE_VERSION
+ #if RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7, 5)
+@@ -1422,7 +1431,7 @@ static inline short dahdi_txtone_nextsam
+ 
+ #ifndef DAHDI_HAVE_TIMER_SETUP
+ /**
+- * timer_setup - Added in 4.13.0.  We can make a direct translation to the
++ * timer_setup - Added in 4.14.0.  We can make a direct translation to the
+  * setup_timer interface since DAHDI does not pass any flags to any of the
+  * timer_setup functions.
+  *
+@@ -1513,7 +1522,7 @@ static inline void *PDE_DATA(const struc
+ #endif /* 4.0.0 */
+ #endif /* 4.10.0 */
+ #endif /* 4.11.0 */
+-#endif /* 4.13.0 */
++#endif /* 4.14.0 */
+ #else /* >= 4.15.0 */
+ 
+ #ifndef TIMER_DATA_TYPE
diff --git a/debian/patches/series b/debian/patches/series
index 9de7885..02dbdbe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,4 @@
 1160-inline-first.patch
 1170-ascii-source.patch
 1180-UBUNTU-SAUCE-linux-6.11-fix-MAX-redefinition-warning.patch
+1190-timer_setup.patch
-- 
2.39.5

>From 82e58be23b9c0f438a33649de022adbd522898bc Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Tue, 25 Mar 2025 12:02:25 +0100
Subject: [PATCH 4/4] dahdi-dkms: drop superfluous dependencies

---
 debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index ef33f6c..a3fef46 100644
--- a/debian/control
+++ b/debian/control
@@ -43,7 +43,7 @@ Description: DAHDI telephony interface - source code for 
kernel driver
 Package: dahdi-dkms
 Section: kernel
 Architecture: all
-Depends: ${misc:Depends}, dkms (>= 2.8.4-3~), make, libc6-dev, dpkg-dev, gcc, 
gawk
+Depends: ${misc:Depends},
 Recommends: dahdi-linux
 Description: DAHDI telephony interface (dkms kernel driver)
  DAHDI (formerly Zaptel) is an interface for telephony devices used by e.g.
-- 
2.39.5

Reply via email to