Enhance DKMS package with new upstream version and debian directory updates, including autotests and improved installation scripts
Some checks failed
PikaOS Package Build & Release (amd64-v3) / build (push) Failing after 35s

This commit is contained in:
ferreo 2024-11-20 14:25:28 +00:00
parent cf9fe79f7f
commit 5ccb132f8c
38 changed files with 2647 additions and 82 deletions

View File

@ -1 +1 @@
1 2

40
debian/HOWTO.Debian vendored Normal file
View File

@ -0,0 +1,40 @@
HOWTO Build DKMS debs w/ Debian & Ubuntu systems
Copyright 2008 Dell Inc.
Author: Mario Limonciello <Mario_Limonciello@Dell.com>
------------
A dkms deb is a common representation of a DKMS package that can be distributed across multiple machines.
After you have a functional DKMS package, you can follow these steps to build a DKMS deb.
1) Start out by putting together a tree in /usr/src/PACKAGE-VERSION. For our example, we are going to use
the PACKAGE lirc and VERSION 0.8.3~pre1. Create a dkms.conf per the recommendations in the DKMS guide.
2) "Add" the package to the dkms tree system:
dkms add -m lirc -v 0.8.3~pre1
3) "Build" the binary modules for the current kernel:
dkms build -m lirc -v 0.8.3~pre1
4) Make the deb and/or dsc for the package:
dkms mkdeb -m lirc -v 0.8.3~pre1
dkms mkdsc -m lirc -v 0.8.3~pre1
The end result will be a deb and/or dsc in /var/lib/dkms/lirc/0.8.3~pre1/deb or /var/lib/dkms/lirc/0.8.3~pre1/dsc
------------
If you would prefer not to contaminate your system with the changes from building these debs, you should
create a framework.conf that contains these variables (adjust for your use case):
source_tree="/path/to/source/tree"
dkms_tree="/path/to/dkms/tree"
You will then call DKMS with an extra variable, '--dkmsframework'. Here is an example of how this would work
using the same lirc example above:
dkms add -m lirc -v 0.8.3~pre1 --dkmsframework framework.conf
dkms build -m lirc -v 0.8.3~pre1 --dkmsframework framework.conf
dkms mkdeb -m lirc -v 0.8.3~pre1 --dkmsframework framework.conf
dkms mkdsc -m lirc -v 0.8.3~pre1 --dkmsframework framework.conf
The end result will be both a debian binary package and a debian source package that you can use.

1304
debian/changelog vendored

File diff suppressed because it is too large Load Diff

2
debian/clean vendored Normal file
View File

@ -0,0 +1,2 @@
debian/scripts/dh_dkms
debian/scripts/dh_dkms.1

98
debian/control vendored
View File

@ -1,19 +1,87 @@
Source: upstream-name Source: dkms
Section: admin Section: kernel
Priority: optional Priority: optional
Maintainer: name <email> Maintainer: Dynamic Kernel Module System Team <dkms@packages.debian.org>
Standards-Version: 4.6.1 Uploaders: David Paleino <dapal@debian.org>,
Petter Reinholdtsen <pere@debian.org>,
Aron Xu <aron@debian.org>,
Mario Limonciello <Mario_Limonciello@dell.com>,
Andreas Beckmann <anbe@debian.org>,
Build-Depends: debhelper-compat (= 13) Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.7.0
Homepage: https://github.com/dell/dkms
Vcs-Git: https://salsa.debian.org/debian/dkms.git
Vcs-Browser: https://salsa.debian.org/debian/dkms
Rules-Requires-Root: no Rules-Requires-Root: no
Testsuite: autopkgtest-pkg-dkms
Package: pkgname1 Package: dkms
Architecture: linux-any Architecture: all
# Delete any of these lines if un-used Multi-Arch: foreign
Depends: ${misc:Depends}, depends Pre-Depends: lsb-release
Recommends: high priority optdepends Depends: ${misc:Depends},
Conflicts: conflicts kmod,
Suggests: low priority optdepends dpkg-dev,
Breaks: also conflicts!? make | build-essential,
Provides: provides patch,
# Recommends:
Description: pkgdesc gcc | c-compiler,
fakeroot,
sudo,
Suggests: menu, e2fsprogs
Breaks:
# in buster, not in bullseye
sl-modem-dkms (<< 2.9.11~20110321-16.0),
# in stretch, not in buster
blktap-dkms (<< 2.0.93-0.10.0),
# in jessie, not in stretch
oss4-dkms (<< 4.2-build2020-1~),
# in wheezy, not in jessie
blcr-dkms (<< 0.8.6~b3-1.0),
Provides:
dkms-autopkgtest (= ${binary:Version}),
Description: Dynamic Kernel Module System (DKMS)
DKMS is a framework designed to allow individual kernel modules to be upgraded
without changing the whole kernel. It is also very easy to rebuild modules as
you upgrade kernels.
Package: dh-dkms
Architecture: all
Multi-Arch: foreign
Depends:
${perl:Depends},
${misc:Depends},
Breaks:
dkms (<< 3.0.3-3~),
Replaces:
dkms (<< 3.0.3-3~),
Provides:
dh-sequence-dkms,
Description: debhelper addon for the Dynamic Kernel Module System (DKMS)
DKMS is a framework designed to allow individual kernel modules to be upgraded
without changing the whole kernel. It is also very easy to rebuild modules as
you upgrade kernels.
.
This package provides a debhelper add-on 'dkms' that simplifies packaging of
dkms kernel module source packages.
Package: dkms-test-dkms
Architecture: all
Depends:
${misc:Depends},
Description: trivial dkms test kernel module
This package provides the dkms source code for the dkms_test kernel module.
.
This package is only intended for ci tests and not expected to be installed
on regular systems
Package: dkms-noautoinstall-test-dkms
Architecture: all
Depends:
${misc:Depends},
Description: trivial dkms noautoinstall test kernel module
This package provides the dkms source code for the dkms_noautoinstall_test
kernel module.
.
This package is only intended for ci tests and not expected to be installed
on regular systems

37
debian/copyright vendored
View File

@ -0,0 +1,37 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://github.com/dell/dkms
Files: *
Copyright: © 2003-2022, Dell, Inc. <dkms-devel@lists.us.dell.com>
License: GPL-2+
Files: debian/*
Copyright: © 2008-2009, David Paleino <d.paleino@gmail.com>
© 2005-2008, Matt Domsch <Matt_Domsch@dell.com>
© 2008-2009, Mario Limonciello <Mario_Limonciello@dell.com>
© 2008-2009, Giuseppe Iuculano <giuseppe@iuculano.it>
© 2019-2023, Gianfranco Costamagna <locutusofborg@debian.org>
© 2020-2024, Andreas Beckmann <anbe@debian.org>
License: GPL-2+
Files: debian/HOWTO.Debian
Copyright: © 2008-2020, Dell, Inc. <dkms-devel@lists.us.dell.com>
License: GPL-2+
License: GPL-2+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-2 file.

4
debian/dh-dkms.install vendored Normal file
View File

@ -0,0 +1,4 @@
debian/scripts/dh_dkms usr/bin
debian/scripts/dh_dkms.1 usr/share/man/man1/
debian/scripts/*-dkms usr/share/debhelper/autoscripts/
debian/scripts/dkms.pm usr/share/perl5/Debian/Debhelper/Sequence/

View File

@ -0,0 +1 @@
test/dkms_noautoinstall_test-1.0/dkms.conf

View File

@ -0,0 +1 @@
test/dkms_noautoinstall_test-1.0 usr/src/

1
debian/dkms-test-dkms.dkms vendored Normal file
View File

@ -0,0 +1 @@
test/dkms_test-1.0/dkms.conf

1
debian/dkms-test-dkms.install vendored Normal file
View File

@ -0,0 +1 @@
test/dkms_test-1.0 usr/src/

1
debian/dkms.docs vendored Normal file
View File

@ -0,0 +1 @@
debian/HOWTO.Debian

1
debian/dkms.install vendored Normal file
View File

@ -0,0 +1 @@
debian/scripts/dkms-autopkgtest usr/lib/dkms/

5
debian/dkms.lintian-overrides vendored Normal file
View File

@ -0,0 +1,5 @@
# dependency is provided by apport
python3-script-but-no-python3-dep python3 (does not satisfy python3:any | python3-minimal:any) [usr/share/apport/package-hooks/dkms_packages.py]
# this location is used by multiple external scripts to find dkms bits
executable-in-usr-lib

22
debian/dkms.maintscript vendored Normal file
View File

@ -0,0 +1,22 @@
rm_conffile /etc/bash_completion.d/dkms 3.0.3-2~
rm_conffile /etc/dkms/kernel_install.d_dkms 3.0.3-2~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/rules 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/prerm 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/postinst 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/dirs 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/copyright 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/control 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/compat 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/changelog 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/debian/README.Debian 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkdeb/Makefile 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkbmdeb/debian/rules 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkbmdeb/debian/copyright 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkbmdeb/debian/control 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkbmdeb/debian/compat 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkbmdeb/debian/changelog 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkbmdeb/debian/README.Debian 3.0.3-3~
rm_conffile /etc/dkms/template-dkms-mkbmdeb/Makefile 3.0.3-3~
rm_conffile /etc/dkms/sign_helper.sh 3.0.10-8~
mv_conffile /etc/kernel/install.d/dkms /etc/kernel/install.d/40-dkms.install 3.0.12-1~
rm_conffile /etc/kernel/install.d/dkms 3.0.12-2~

4
debian/dkms.modprobe vendored Normal file
View File

@ -0,0 +1,4 @@
# modprobe information used for DKMS modules
#
# This is a stub file, should be edited when needed,
# used by default by DKMS.

57
debian/dkms.postinst vendored Normal file
View File

@ -0,0 +1,57 @@
#!/bin/sh
set -e
#DEBHELPER#
if dpkg --compare-versions "$2" lt-nl "3.0.3-3~" ; then
for d in /etc/dkms/template-dkms-mkdeb/debian /etc/dkms/template-dkms-mkdeb /etc/dkms/template-dkms-mkbmdeb/debian /etc/dkms/template-dkms-mkbmdeb
do
test ! -d $d || rmdir --ignore-fail-on-non-empty $d
done
fi
if dpkg --compare-versions "$2" lt-nl "3.0.10-8~" ; then
for f in /boot/*.old-dkms
do
test ! -f "$f" || rm -fv "$f"
done
fi
if dpkg --compare-versions "$2" lt-nl "3.0.12" ; then
for d in /lib/modules/*
do
# clean up leftover depmod files if modules.dep is empty
# i.e. dkms called depmod after removing the last kernel module
if [ -f "$d/modules.dep" ] && [ ! -s "$d/modules.dep" ]; then
rm -fv \
"$d/modules.alias" \
"$d/modules.dep" \
"$d/modules.devname" \
"$d/modules.softdep" \
"$d/modules.symbols" \
"$d"/modules.*.bin
rmdir --ignore-fail-on-non-empty "$d"
test -d "$d" || echo "removed directory $d"
fi
done
fi
if dpkg --compare-versions "$2" lt-nl "3.0.12-2~" ; then
# missing $arch in the path, #1036033
rm -rfv /var/lib/dkms/*/*/[1-6].*/module/
rm -rfv /var/lib/dkms/*/*/[1-6].*/log/
# /usr/src/$module-$version was already removed,
# but /var/lib/dkms/$module/$version/source still points there
for source in /var/lib/dkms/*/*/source
do
test -h "$source" || continue
test -f "$source/dkms.conf" || rm -fv "$source"
done
for mdir in /var/lib/dkms/*/
do
test -d "$mdir" || continue
find "$mdir" -depth -type d -exec sh -c 'd="{}"; rmdir --ignore-fail-on-non-empty "$d" ; test -d "$d" || echo "removed directory $d"' \;
done
fi

4
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
debian-branch = main
pristine-tar = True
upstream-vcs-tag = v%(version)s

View File

@ -0,0 +1,29 @@
From 8c502778eb2277b2f16b215f0820545909bf1833 Mon Sep 17 00:00:00 2001
From: Simone Caronni <negativo17@gmail.com>
Date: Sat, 5 Oct 2024 17:06:59 +0200
Subject: [PATCH 1/2] Remove last remnants of log_action_msg from
dkms_autoinstaller.in
---
dkms_autoinstaller.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dkms_autoinstaller.in b/dkms_autoinstaller.in
index 31c382e..358e3d1 100755
--- a/dkms_autoinstaller.in
+++ b/dkms_autoinstaller.in
@@ -59,9 +59,9 @@ case "$1" in
kernel=$(uname -r)
fi
if [ -f /etc/dkms/no-autoinstall ]; then
- log_action_msg "Automatic installation of modules has been disabled."
+ echo "Automatic installation of modules has been disabled."
elif ! _check_kernel_dir $kernel; then
- log_action_msg "Automatic installation of modules for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed."
+ echo "Automatic installation of modules for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed."
else
dkms autoinstall --kernelver $kernel
res=$?
--
2.39.5

View File

@ -0,0 +1,151 @@
From cf6973e4e09fea041df3832300861d4ecd4c8760 Mon Sep 17 00:00:00 2001
From: Simone Caronni <negativo17@gmail.com>
Date: Sat, 5 Oct 2024 17:14:06 +0200
Subject: [PATCH 2/2] Drop GNU/kFreeBSD
---
dkms.in | 16 ++--------------
dkms_autoinstaller.in | 11 ++---------
dkms_common.postinst.in | 11 ++---------
kernel_postinst.d_dkms.in | 23 ++++-------------------
4 files changed, 10 insertions(+), 51 deletions(-)
diff --git a/dkms.in b/dkms.in
index 1cd55b1..a8f2c6a 100644
--- a/dkms.in
+++ b/dkms.in
@@ -55,10 +55,7 @@ readonly mv_re='^([^/]*)/(.*)$'
_get_kernel_dir() {
if [[ -z $ksourcedir_fromcli ]]; then
KVER=$1
- case ${current_os} in
- Linux) DIR="$install_tree/$KVER/build" ;;
- GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;;
- esac
+ DIR="$install_tree/$KVER/build"
echo $DIR
else
echo $kernel_source_dir
@@ -67,11 +64,7 @@ _get_kernel_dir() {
_check_kernel_dir() {
DIR=$(_get_kernel_dir $1)
- case ${current_os} in
- Linux) test -e $DIR/include ;;
- GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;;
- *) return 1 ;;
- esac
+ test -e $DIR/include
return $?
}
@@ -406,11 +399,6 @@ override_dest_module_location()
local orig_location="$1"
[[ ${addon_modules_dir} ]] && echo "/${addon_modules_dir}" && return
- if [[ $current_os = GNU/kFreeBSD ]] ; then
- # Does not support subdirs, regardless of distribution
- echo "" && return
- fi
-
case "$running_distribution" in
fedora* | rhel* | ovm*)
echo "/extra" && return
diff --git a/dkms_autoinstaller.in b/dkms_autoinstaller.in
index 358e3d1..eee0352 100755
--- a/dkms_autoinstaller.in
+++ b/dkms_autoinstaller.in
@@ -34,20 +34,13 @@ uname_s=$(uname -s)
_get_kernel_dir() {
KVER=$1
- case ${uname_s} in
- Linux) DIR="@MODDIR@/$KVER/build" ;;
- GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;;
- esac
+ DIR="@MODDIR@/$KVER/build"
echo $DIR
}
_check_kernel_dir() {
DIR=$(_get_kernel_dir $1)
- case ${uname_s} in
- Linux) test -e $DIR/include ;;
- GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;;
- *) return 1 ;;
- esac
+ test -e $DIR/include
return $?
}
diff --git a/dkms_common.postinst.in b/dkms_common.postinst.in
index fe5d037..2c54058 100644
--- a/dkms_common.postinst.in
+++ b/dkms_common.postinst.in
@@ -10,20 +10,13 @@ uname_s=$(uname -s)
_get_kernel_dir() {
KVER=$1
- case ${uname_s} in
- Linux) DIR="@MODDIR@/$KVER/build" ;;
- GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;;
- esac
+ DIR="@MODDIR@/$KVER/build"
echo $DIR
}
_check_kernel_dir() {
DIR=$(_get_kernel_dir $1)
- case ${uname_s} in
- Linux) test -e $DIR/include ;;
- GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;;
- *) return 1 ;;
- esac
+ test -e $DIR/include
return $?
}
diff --git a/kernel_postinst.d_dkms.in b/kernel_postinst.d_dkms.in
index f4ccc95..d73fcb7 100755
--- a/kernel_postinst.d_dkms.in
+++ b/kernel_postinst.d_dkms.in
@@ -7,32 +7,17 @@ uname_s=$(uname -s)
_get_kernel_dir() {
KVER=$1
- case ${uname_s} in
- Linux) DIR="@MODDIR@/$KVER/build" ;;
- GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;;
- esac
+ DIR="@MODDIR@/$KVER/build"
echo "$DIR"
}
_check_kernel_dir() {
DIR=$(_get_kernel_dir "$1")
- case ${uname_s} in
- Linux) test -e "$DIR/include" ;;
- GNU/kFreeBSD) test -e "$DIR/kern" && test -e "$DIR/conf/kmod.mk" ;;
- *) false ;;
- esac
+ test -e "$DIR/include"
}
-case "${uname_s}" in
- Linux)
- header_pkg="linux-headers-$inst_kern"
- kernel="Linux"
- ;;
- GNU/kFreeBSD)
- header_pkg="kfreebsd-headers-$inst_kern"
- kernel="kFreeBSD"
- ;;
-esac
+header_pkg="linux-headers-$inst_kern"
+kernel="Linux"
if [ -x @LIBDIR@/dkms_autoinstaller ]; then
exec @LIBDIR@/dkms_autoinstaller start "$inst_kern"
--
2.39.5

View File

@ -0,0 +1,84 @@
From 0ed79841a3898fde8bbab673563ee672974c468b Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Fri, 18 Oct 2024 01:45:04 +0200
Subject: [PATCH] remove trailing whitespace
---
dkms.8.in | 4 ++--
dkms.in | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dkms.8.in b/dkms.8.in
index 5c829d9..634c697 100644
--- a/dkms.8.in
+++ b/dkms.8.in
@@ -333,8 +333,8 @@ combinations on the other kernel.
.TP
.B \-\-force
This option can be used in conjunction with
-.B build, install
-and
+.B build, install
+and
.B ldtarball
to force copying over existing files.
.TP
diff --git a/dkms.in b/dkms.in
index a8f2c6a..371290a 100644
--- a/dkms.in
+++ b/dkms.in
@@ -96,19 +96,19 @@ invoke_command()
local cmd_mode="$4"
local exitval=0
local progresspid
-
+
[[ $verbose ]] && echo -e "$cmd" || echo -en "$cmd_description..."
if [[ $cmd_mode == background && ! $verbose && $package_name != dkms*_test ]]; then
- while true ; do
+ while true ; do
sleep 3
echo -n "."
done &
progresspid=$!
fi
- if [[ -n "$cmd_output_file" ]]; then
- ( eval "$cmd" ) >> "$cmd_output_file" 2>&1
+ if [[ -n "$cmd_output_file" ]]; then
+ ( eval "$cmd" ) >> "$cmd_output_file" 2>&1
exitval=$?
elif [[ -z "$cmd_output_file" && $cmd_mode == background && ! $verbose ]]; then
( eval "$cmd" ) >/dev/null 2>&1
@@ -119,15 +119,15 @@ invoke_command()
fi
[ -n "$progresspid" ] && kill "$progresspid" >/dev/null 2>&1
-
- if (( exitval > 0)); then
+
+ if (( exitval > 0 )); then
echo -en "(bad exit status: $exitval)"
# Print the failing command without the clunky redirection
[[ ! $verbose ]] && echo -en "\nFailed command:\n$1"
else
echo " done."
fi
-
+
return "$exitval"
}
@@ -1941,7 +1941,7 @@ make_tarball()
die 6 "Failed to make tarball."
fi
- eval "$make_tarball_rm_temp_dir_name"
+ eval "$make_tarball_rm_temp_dir_name"
unset make_tarball_rm_temp_dir_name
}
--
2.39.5

View File

@ -0,0 +1,24 @@
From 4bc1a61cc942fe2d54462f2afc121064c11dd781 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Fri, 18 Oct 2024 02:14:25 +0200
Subject: [PATCH] initially clear variables that can contain cleanup code
---
dkms.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/dkms.in b/dkms.in
index 371290a..2815b53 100644
--- a/dkms.in
+++ b/dkms.in
@@ -81,6 +81,7 @@ on_exit()
exit $exitcode_on_exit
}
+unset make_tarball_rm_temp_dir_name load_tarball_rm_temp_dir_name
trap on_exit EXIT
# Run a command that we may or may not want to be detailed about.
--
2.39.5

View File

@ -0,0 +1,51 @@
From 8521870c3c0b97f3d0648648e9e199f9e1d0fbad Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Fri, 18 Oct 2024 02:23:02 +0200
Subject: [PATCH] add --help / -h options
---
dkms.8.in | 3 +++
dkms.in | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dkms.8.in b/dkms.8.in
index 634c697..30e28e7 100644
--- a/dkms.8.in
+++ b/dkms.8.in
@@ -292,6 +292,9 @@ Quiet.
.B \-V, \-\-version
Prints the currently installed version of dkms and exits.
.TP
+.B \-h, \-\-help
+Prints a short usage message and exits.
+.TP
.B \-c <dkms.conf\-location>
The location of the
.I dkms.conf
diff --git a/dkms.in b/dkms.in
index 2815b53..93a080f 100644
--- a/dkms.in
+++ b/dkms.in
@@ -190,7 +190,7 @@ show_usage()
echo " [--kernelsourcedir=source-location] [--rpm_safe_upgrade]"
echo " [--dkmstree path] [--sourcetree path] [--installtree path]"
echo " [--binaries-only] [--source-only] [--verbose]"
- echo " [--no-depmod] [--modprobe-on-install] [-j number] [--version]"
+ echo " [--no-depmod] [--modprobe-on-install] [-j number] [--version] [--help]"
}
VER()
@@ -2532,6 +2532,10 @@ while (($# > 0)); do
-j)
read_arg parallel_jobs "$1" "$2" || shift
;;
+ --help|-h)
+ show_usage
+ exit 0
+ ;;
-*)
error " Unknown option: $1"
show_usage
--
2.39.5

View File

@ -0,0 +1,32 @@
From f56a77d7bcd06a968eb37f64bffc599b67f39766 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Fri, 18 Oct 2024 02:33:42 +0200
Subject: [PATCH] common.postinst: source /etc/dkms/framework.conf.d/*.conf,
too
---
dkms_common.postinst.in | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dkms_common.postinst.in b/dkms_common.postinst.in
index 2c54058..e290028 100644
--- a/dkms_common.postinst.in
+++ b/dkms_common.postinst.in
@@ -114,9 +114,11 @@ if [ -f /etc/dkms/no-autoinstall ]; then
fi
# read framework configuration options
-if [ -r /etc/dkms/framework.conf ]; then
- . /etc/dkms/framework.conf
-fi
+for fwcf in /etc/dkms/framework.conf /etc/dkms/framework.conf.d/*.conf ; do
+ if [ -f "$fwcf" ] && [ -r "$fwcf" ]; then
+ . "$fwcf"
+ fi
+done
KERNELS=$(ls -dv @MODDIR@/*/build 2>/dev/null | cut -d/ -f4 || true)
CURRENT_KERNEL=$(uname -r)
--
2.39.5

View File

@ -0,0 +1,50 @@
From 0e69615135244378ade7063ea6da76c7d68474ba Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Wed, 19 Apr 2023 17:37:54 +0200
Subject: [PATCH] do not perform rpm queries on Debian/Ubuntu/Arch based
distributions
Closes #329
---
dkms.in | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- a/dkms.in
+++ b/dkms.in
@@ -312,6 +312,11 @@ setup_kernels_arches()
kernelver[0]=$(uname -r)
fi
if [[ ! $arch ]]; then
+ case "$running_distribution" in
+ debian* | ubuntu* | arch*)
+ arch[0]=$(uname -m)
+ ;;
+ *)
kernelver_rpm=$(rpm -qf "$install_tree/$kernelver" 2>/dev/null | \
grep -v "not owned by any package" | grep kernel | head -n 1)
if ! arch[0]=$(rpm -q --queryformat "%{ARCH}" "$kernelver_rpm" 2>/dev/null); then
@@ -320,6 +325,8 @@ setup_kernels_arches()
arch[0]="ia32e"
fi
fi
+ ;;
+ esac
fi
if [[ ! $arch ]]; then
die 12 "Could not determine architecture."
@@ -1557,7 +1564,15 @@ do_uninstall()
while [[ ${dir_to_remove} != ${dir_to_remove#/} ]]; do
dir_to_remove="${dir_to_remove#/}"
done
+
+ case "$running_distribution" in
+ debian* | ubuntu* | arch*)
+ (if cd "$install_tree/$1"; then rmdir -p --ignore-fail-on-non-empty "${dir_to_remove}"; fi || true)
+ ;;
+ *)
(if cd "$install_tree/$1"; then rpm -qf "${dir_to_remove}" >/dev/null 2>&1 || rmdir -p --ignore-fail-on-non-empty "${dir_to_remove}"; fi || true)
+ ;;
+ esac
else
echo "Module was not found within $install_tree/$1/"
fi

View File

@ -0,0 +1,16 @@
--- a/dkms_common.postinst.in
+++ b/dkms_common.postinst.in
@@ -155,6 +155,13 @@ if [ -z "$autoinstall" ]; then
exit 0
fi
+dkms_conf="/var/lib/dkms/$NAME/$VERSION/source/dkms.conf"
+autoinstall=$(bash -c 'AUTOINSTALL=; . "'"$dkms_conf"'" >/dev/null 2>&1; echo $AUTOINSTALL')
+if [ -z "$autoinstall" ]; then
+ echo "Not building the $NAME module which does not have AUTOINSTALL enabled."
+ exit 0
+fi
+
# On 1st installation, let us look for a directory
# in @MODDIR@ which matches $(uname -r). If none
# is found it is possible that buildd is being used

View File

@ -0,0 +1,22 @@
--- a/kernel_postinst.d_dkms.in
+++ b/kernel_postinst.d_dkms.in
@@ -19,6 +19,19 @@ _check_kernel_dir() {
header_pkg="linux-headers-$inst_kern"
kernel="Linux"
+case $0 in *header_postinst.d*)
+ # unbuild all autoinstalled modules for this kernel to ensure they get
+ # rebuilt against the updated headers by the next autoinstall below
+ for mod_ver in $(dkms status -k "$inst_kern" 2>/dev/null | grep ': installed' | cut -d, -f1 | sort -u)
+ do
+ dkms_conf="/var/lib/dkms/$mod_ver/source/dkms.conf"
+ autoinstall=$(bash -c 'AUTOINSTALL=; . "'"$dkms_conf"'" >/dev/null 2>&1; echo $AUTOINSTALL')
+ test -n "$autoinstall" || continue
+ dkms unbuild -k "$inst_kern" "$mod_ver"
+ done
+ ;;
+esac
+
if [ -x @LIBDIR@/dkms_autoinstaller ]; then
exec @LIBDIR@/dkms_autoinstaller start "$inst_kern"
fi

10
debian/patches/series vendored Normal file
View File

@ -0,0 +1,10 @@
0001-Remove-last-remnants-of-log_action_msg-from-dkms_aut.patch
0002-Drop-GNU-kFreeBSD.patch
1001-remove-trailing-whitespace.patch
1002-initially-clear-variables-that-can-contain-cleanup-c.patch
1003-add-help-h-options.patch
1004-common.postinst-source-etc-dkms-framework.conf.d-.co.patch
2001-do-not-perform-rpm-queries-on-Debian-Ubuntu-Arch-bas.patch
rebuild-modules-on-header-upgrade.patch
only-autobuild-AUTOINSTALL-yes-modules.patch

83
debian/rules vendored
View File

@ -1,67 +1,26 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# -*- makefile -*-
## See debhelper(7) (uncomment to enable). include /usr/share/dpkg/pkg-info.mk
## Output every command that modifies files on the build system.
export DH_VERBOSE = 1
export PIKA_BUILD_ARCH = $(shell cat ../pika-build-arch)
## === the chain of command ===
## debuild runs a chain of dh functions in the following order:
## dh_testdir
## dh_clean
## dh_auto_clean
## dh_update_autotools_config
## dh_autoreconf
## dh_auto_configure
## dh_prep
## dh_build
## dh_auto_build
## dh_install
## dh_auto_install
## dh_installdocs
## dh_installchangelogs
## dh_perl
## dh_link
## dh_strip_nondeterminism
## dh_compress
## dh_fixperms
## dh_missing
## dh_dwz
## dh_strip
## dh_makeshlibs
## dh_shlibdeps
## dh_installdeb
## dh_gencontrol
## but you are most likely to only need to override the following:
## dh_clean
## dh_auto_configure
## dh_build
## dh_install
## === End end of region ===
## === overriding dh functions ===
## by default all dh functions will run a specific command based on the build system selected by "dh $@"
## if you have a makefile that does everything you need this is fine,
## but most likely you have no MakeFile and you want to add your own commands
## Note : overrides must be places above %:
## So here's a few examples:
## overriding dh_clean to make it not delete rust vendor files:
#override_dh_clean:
# echo "disabled"
## overriding dh_auto_configure to add custom configs:
#override_dh_auto_configure:
# $(srcdir)/configure -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_DATADIR=/usr/share -DCMAKE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu -DBUILD_PLUGIN=OFF
## overriding dh_install to install files to a package:
#override_dh_auto_configure:
# mkdir -p debian/pikman/usr/bin
# cp pikman debian/pikman/usr/bin/
## === End end of region ===
## This here will start the build:
%: %:
dh $@ dh $@
debian/scripts/dh_dkms: debian/scripts/dh_dkms.in
sed -r "s,^#VERSION#,our \$$VERSION = \"$(DEB_VERSION)\";," $< > $@
chmod +x $@
debian/scripts/dh_dkms.1: debian/scripts/dh_dkms
pod2man \
--center "DKMS Debhelper" \
--release $(DEB_VERSION_UPSTREAM) \
$< > $@
override_dh_auto_build: debian/scripts/dh_dkms
override_dh_auto_build: debian/scripts/dh_dkms.1
override_dh_auto_install:
$(MAKE) install-debian DESTDIR=$(CURDIR)/debian/dkms
execute_after_dh_install:
DH_AUTOSCRIPTDIR=debian/scripts debian/scripts/dh_dkms

192
debian/scripts/dh_dkms.in vendored Executable file
View File

@ -0,0 +1,192 @@
#!/usr/bin/perl -w
=head1 NAME
dh_dkms - correctly handle DKMS usage by a kernel module package
=cut
use strict;
use Debian::Debhelper::Dh_Lib;
=head1 SYNOPSIS
B<dh_dkms> [S<I<debhelper options>>] [S<B<-l>>] [S<B<-V>[I<version>]>] [S<B<--> I<file>>]
=head1 DESCRIPTION
dh_dkms is a debhelper program that is responsible for correctly setting
postinst, postrm and dependencies in kernel module packages using DKMS.
If a file named debian/package.dkms exists, then different actions are
performed, depending on its contents.
=head1 FILES
=over 4
=item debian/I<package>.dkms
=item debian/dkms
It can be a proper configuration file, and in this case it would be installed
in the proper directory as dkms.conf.
It can also point to another file (this should be used when the configuration
is provided by upstream), and in this case that file will be installed as dkms.conf
in the proper directory.
This file can only miss if a filename is provided when calling dh_dkms.
=back
=head1 OPTIONS
=over 4
=item B<-l>, B<--legacy>
Add code to also support DKMS versions < 2.1.0.0.
=item B<-V>, B<-V> I<version>
If C<PACKAGE_VERSION> in F<dkms.conf> is set to C<#MODULE_VERSION#>, set it to
the given I<version> or, if none is given, default to the upstream version of
the current package. Otherwise, leave the value specified in F<dkms.conf>.
=item B<--> I<file>
Don't look for debian/I<package>.dkms or debian/dkms, but install I<file> as dkms.conf.
=back
=head1 NOTES
Note that this command is not idempotent. L<dh_prep(1)> should be called
between invocations of this command. Otherwise, it may cause multiple
instances of the same text to be added to maintainer scripts.
=cut
# placeholder substituted at build time
# is shown along generated autoscripts
#VERSION#
init(options => {
"l|legacy" => \$dh{LEGACY_DKMS},
});
foreach my $package (@{$dh{DOPACKAGES}}) {
#next if is_udeb($package);
my $tmp = tmpdir($package);
my $dkms_dir = "/usr/lib/dkms/";
my $dkms_conf = pkgfile($package, "dkms");
my $is_snippet = 0;
my @other_conf;
my $name;
my $package_name;
my $package_version;
my $build_exclusive_config;
if ($dkms_conf) {
# let's see if it's a proper snippet
open(IN, "< $dkms_conf");
while (my $l = <IN>) {
$l =~ /PACKAGE_NAME=(["'])(.*)\1/ && ($is_snippet = 1);
}
close(IN);
if ($is_snippet) {
$name = $dkms_conf;
}
else {
my @search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package));
@other_conf = filearray($dkms_conf, \@search_dirs);
if ($#other_conf > 1) {
error "cannot list more than one file in $dkms_conf!";
}
else {
$name = $other_conf[0];
}
}
}
elsif ($#ARGV == 0) {
$name = $ARGV[0];
}
else {
next;
}
verbose_print "installing $name as dkms.conf";
# now, parse our configuration file
open(IN, "< $name") || error("cannot read $name: $!");
while (my $l = <IN>) {
$l =~ /PACKAGE_NAME=(["']?)(.*)\1/ && ($is_snippet = 1 && $package_name = $2);
$l =~ /PACKAGE_VERSION=(["']?)(.*)\1/ && ($package_version = $2);
$l =~ /BUILD_EXCLUSIVE_CONFIG=(["']?)(.*)\1/ && ($build_exclusive_config = $2);
$l =~ /BUILD_EXCLUSIVE_KERNEL_MIN=(["']?)(.*)\1/ && ($build_exclusive_config = "yes");
$l =~ /BUILD_EXCLUSIVE_KERNEL_MAX=(["']?)(.*)\1/ && ($build_exclusive_config = "yes");
}
close(IN);
#$ENV{DH_AUTOSCRIPTDIR} = "debian/scripts/";
if ($build_exclusive_config) {
addsubstvar($package, "misc:Depends", "dkms", ">= 3.0.11");
}
elsif ($dh{LEGACY_DKMS}) {
doit("install", "-p", "-D", "-m755", "$dkms_dir/common.postinst", "$tmp/usr/share/$package/postinst");
addsubstvar($package, "misc:Depends", "dkms");
}
else {
addsubstvar($package, "misc:Depends", "dkms", ">= 2.1.0.0");
}
if ($dh{V_FLAG_SET} || $package_version eq "#MODULE_VERSION#") {
$package_version = $dh{V_FLAG} || "";
if ($package_version eq "") {
# Call isnative because it sets $dh{VERSION}
# as a side effect.
isnative($package);
$package_version = $dh{VERSION};
# Remove the Debian revision
$package_version =~ s/-[^-]+$//;
# Remove the Debian epoch
$package_version =~ s/^\d+://;
}
my $old_name = $name;
$name = "debian/".pkgext($package)."dkms.debhelper";
doit("cp", "-a", $old_name, $name);
doit("sed", "-i", "s/#MODULE_VERSION#/$package_version/g", $name);
}
error "could not determine package name"
unless defined($package_name);
error "could not determine package version"
unless defined($package_version);
error "invalid package version '$package_version'"
unless $package_version =~ /^[-+.~:0-9a-zA-Z]+$/;
autoscript($package, "prerm", "prerm-dkms",
"s/#MODULE_NAME#/$package_name/;s/#MODULE_VERSION#/$package_version/");
autoscript($package, "postinst", "postinst-dkms",
"s/#MODULE_NAME#/$package_name/;s/#MODULE_VERSION#/$package_version/");
doit("install", "-p", "-D", "-m644", "$name", "$tmp/usr/src/$package_name-$package_version/dkms.conf");
}
=head1 SEE ALSO
L<debhelper(1)>
This program is part of the Debian DKMS package.
L<dkms(8)>
=head1 AUTHOR
David Paleino <dapal@debian.org>
=cut

229
debian/scripts/dkms-autopkgtest vendored Executable file
View File

@ -0,0 +1,229 @@
#!/bin/sh
# Common autopkgtest script for testing a dkms source package.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
# Copyright: (C) 2014 Canonical Ltd.
set -eu
export DEBIAN_FRONTEND=noninteractive
result=0
summary=
crlf="
"
header_packages=
check_for_linux_headers() {
# Act only on the first run.
if [ -n "$header_packages" ]; then
return
fi
# Which Linux header packages are installed?
header_packages=$(dpkg-query -f '${Status} ${Package}\n' -W 'linux-headers-*' 2>/dev/null | sed -r -n 's/^install ok installed //p')
if [ -n "$header_packages" ]; then
echo "I: Using the following Linux header packages that were already installed:"
for p in $header_packages ; do
echo "I: $p"
done
return
fi
# Which Linux header packages could be installed?
# linux-doc is a dependency generated by autodep8 for autopkgtest-pkg-dkms
# install only linux-headers-* matching the source version of linux-doc
wanted_source_version=$(dpkg-query -f '${source:Version}' -W linux-doc 2>/dev/null || true)
candidates=$(apt-cache search --names-only '^linux-headers-' | awk '{print $1}' | grep -v -E -e '-common(-rt)?$')
echo "I: No Linux header packages are installed."
echo "I: Installing all available ones from src:linux $wanted_source_version:"
for p in $candidates ; do
if [ -z "$wanted_source_version" ]; then
echo "I: $p"
header_packages="$header_packages $p"
continue
fi
source_versions=$(apt-cache show $p | perl -ne 'if (/^$/) { print $s || $v, "\n"; $s=$v=""; } $s=$1 if /^Source: .* \((.*)\)$/; $v=$1 if /^Version: (.*)$/;')
for sv in $source_versions ; do
if [ "$sv" = "$wanted_source_version" ]; then
echo "I: install $p"
header_packages="$header_packages $p"
continue 2
fi
done
echo "I: skip $p"
done
RC=0
apt-get install --no-install-recommends -yq $header_packages </dev/null 2>&1 || RC=$?
if [ "$RC" -ne 0 ]; then
echo "E: Linux headers failed to install." >&2
exit 1
fi
}
run_pkg() {
pkg="$1"
test -x /usr/bin/openssl || apt-get install --no-install-recommends -yq openssl </dev/null 2>&1
echo "I: Removing binary package $pkg, to get clean state."
apt-get purge -yq $pkg </dev/null 2>&1 >/dev/null || true
echo "I: Installing binary package $pkg"
RC=0
apt-get install --no-install-recommends -yq $pkg </dev/null 2>&1 || RC=$?
if [ "$RC" -ne 0 ]; then
echo "E: Package $pkg failed to install." >&2
result=1
return
fi
# Try and remove dkms to spot packages which miss a dkms dependency
echo "I: Checking for missing dkms dependency by trying to deinstall dkms"
dpkg --remove dkms || true
if ! dkms_conf=$(dpkg -L $pkg | grep '/usr/src' | grep '/dkms.conf$'); then
echo "I: Package $pkg has no dkms.conf, skipping."
return
fi
check_for_linux_headers
echo "I: Testing binary package $pkg"
dkms_pkg=$(bash -c ". $dkms_conf > /dev/null; echo \$PACKAGE_NAME" 2>/dev/null)
dkms_ver=$(bash -c ". $dkms_conf > /dev/null; echo \$PACKAGE_VERSION" 2>/dev/null)
build_depends=$(bash -c ". $dkms_conf > /dev/null; echo \$BUILD_DEPENDS" 2>/dev/null)
versioned_build_depends=
for bd in $build_depends
do
bdpath=$(ls -d /usr/src/${bd}-*)
versioned_build_depends="$versioned_build_depends ${bd}/${bdpath#/usr/src/${bd}-}"
done
for k in $(ls -dv /lib/modules/*/build)
do
test -d "$k" || continue
kver="${k%/build}"
kver="${kver#/lib/modules/}"
# If any linux-meta is in triggers, only test abistems that
# match triggers otherwise continue. This helps integration
# with adt-matrix which specifically requests test results
# against each individual linux-meta and tracks unique results
# per kernel abi.
abistem=$(echo $kver | sed 's/-[a-z]*$//')
case "${ADT_TEST_TRIGGERS-}" in
*linux-meta*)
case "$ADT_TEST_TRIGGERS" in
*"$abistem"*)
;;
*)
continue
;;
esac
esac
for bdv in $versioned_build_depends
do
echo "I: Trying to install build dependency $bdv for $kver"
dkms install "$bdv" -k "$kver" || test $? = 77
done
echo "I: Trying to build $dkms_pkg/$dkms_ver for $kver"
res=0
dkms build -m "$dkms_pkg" -v "$dkms_ver" -k "$kver" || res=$?
if [ "$res" = 77 ]; then
echo "I: $dkms_pkg/$dkms_ver is not supported on $kver (BUILD_EXCLUSIVE directive), skipping."
summary="${summary}I: SKIP $dkms_pkg/$dkms_ver $kver${crlf}"
continue
fi
if [ "$res" != 0 ]; then
echo "E: $dkms_pkg/$dkms_ver failed to build for $kver" >&2
makelog="/var/lib/dkms/$dkms_pkg/$dkms_ver/build/make.log"
echo "========== $makelog ==========" >&2
cat "$makelog" >&2 || true
echo "====================" >&2
summary="${summary}I: FAIL $dkms_pkg/$dkms_ver $kver${crlf}"
result=1
continue
fi
if ! dkms install --force -m "$dkms_pkg" -v "$dkms_ver" -k "$kver" ; then
echo "E: $dkms_pkg/$dkms_ver failed to install for $kver" >&2
summary="${summary}I: FAIL $dkms_pkg/$dkms_ver $kver${crlf}"
result=1
continue
fi
echo "I: Testing if $dkms_pkg modules are correctly installed."
dkmsstatus="$(dkms status $dkms_pkg -k $kver)"
echo "$dkmsstatus"
if [ -z "$dkmsstatus" ]; then
echo "E: dkms status output is empty!" >&2
summary="${summary}I: FAIL $dkms_pkg/$dkms_ver $kver${crlf}"
result=1
continue
fi
if ! echo "$dkmsstatus" | grep -q "installed$"; then
echo "E: not installed" >&2
summary="${summary}I: FAIL $dkms_pkg/$dkms_ver $kver${crlf}"
result=1
continue
fi
summary="${summary}I: PASS $dkms_pkg/$dkms_ver $kver${crlf}"
done
# collect build logs as artifacts
if [ -d /var/lib/dkms ]; then
(cd /var/lib/dkms; find $dkms_pkg -name "make.log" -print0 | xargs -r -0 tar cvz) > "${AUTOPKGTEST_ARTIFACTS:-.}/$pkg-make-logs.tar.gz"
fi
# skip modprobing for now; this fails too often (needs particular
# hardware/firmware/etc)
# for mod in $(awk -F '"' '/^BUILT_MODULE_NAME/ {print $2}' $dkms_conf); do
# echo "I: modprobe $mod"
# if ! modprobe $mod; then
# echo "E: Failed to modprobe module $mod" >&2
# exit 1
# else
# echo "I: $modname loaded"
# fi
# done
}
# Do not (fail to) build the modules upon linux-header-* and *-dkms package
# installation, which can cause apt-get to fail. We will do this later with
# improved error reporting.
# (This only works if the *-dkms package is not yet installed.)
touch /etc/dkms/no-autoinstall
pkg_list="$*"
if [ -z "$pkg_list" ]; then
test -x /usr/bin/grep-dctrl || apt-get install --no-install-recommends -yq dctrl-tools </dev/null 2>&1
pkg_list="$(grep-dctrl -FDepends -e '(^| )dkms' -o -FPackage -e '\-dkms' debian/control -sPackage -n)"
fi
for pkg in $pkg_list; do
# package might be arch: restriction or udeb etc.
if ! apt-cache show $pkg >/dev/null 2>&1; then
echo "I: Skipping unavailable package $pkg"
continue
fi
run_pkg $pkg
done
if [ -n "$summary" ]; then
echo "I: Summary:"
echo -n "$summary"
fi
rm -f /etc/dkms/no-autoinstall
exit $result
# vim: sw=4:ts=4:et

8
debian/scripts/dkms.pm vendored Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/perl
use warnings;
use strict;
use Debian::Debhelper::Dh_Lib;
insert_before("dh_installinit", "dh_dkms");
1;

24
debian/scripts/postinst-dkms vendored Normal file
View File

@ -0,0 +1,24 @@
DKMS_NAME=#MODULE_NAME#
DKMS_PACKAGE_NAME=$DKMS_NAME-dkms
DKMS_VERSION=#MODULE_VERSION#
postinst_found=0
case "$1" in
configure)
for DKMS_POSTINST in /usr/lib/dkms/common.postinst /usr/share/$DKMS_PACKAGE_NAME/postinst; do
if [ -f $DKMS_POSTINST ]; then
$DKMS_POSTINST $DKMS_NAME $DKMS_VERSION /usr/share/$DKMS_PACKAGE_NAME "" $2
postinst_found=1
break
fi
done
if [ "$postinst_found" -eq 0 ]; then
echo "ERROR: DKMS version is too old and $DKMS_PACKAGE_NAME was not"
echo "built with legacy DKMS support."
echo "You must either rebuild $DKMS_PACKAGE_NAME with legacy postinst"
echo "support or upgrade DKMS to a more current version."
exit 1
fi
;;
esac

10
debian/scripts/prerm-dkms vendored Normal file
View File

@ -0,0 +1,10 @@
DKMS_NAME=#MODULE_NAME#
DKMS_VERSION=#MODULE_VERSION#
case "$1" in
remove|upgrade|deconfigure)
if [ "$(dkms status -m $DKMS_NAME -v $DKMS_VERSION)" ]; then
dkms remove -m $DKMS_NAME -v $DKMS_VERSION --all
fi
;;
esac

99
debian/tests/control vendored Normal file
View File

@ -0,0 +1,99 @@
Test-Command: sh debian/tests/run_test_wrapper.sh
Features: test-name=run_test.sh
Depends:
dkms,
openssl,
linux-headers-generic
| linux-headers-rpi [armel]
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
skip-not-installable,
# install some-dkms after linux-headers
Test-Command: apt-get install -yf dkms-test-dkms && dkms status
Features: test-name=install_some-dkms_after_linux-headers
Architecture: amd64
Depends:
dkms,
linux-headers-generic,
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
# install linux-headers after some-dkms
Test-Command: apt-get install -yf linux-headers-generic && dkms status
Features: test-name=install_linux-headers_after_some-dkms
Architecture: amd64
Depends:
dkms-test-dkms,
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
# install some-dkms after linux-image w/o linux-headers
Test-Command: apt-get install -yf dkms-test-dkms && dkms status
Features: test-name=install_some-dkms_after_linux-image_without_linux-headers
Architecture: amd64
Depends:
dkms,
linux-image-generic,
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
# install linux-image after some-dkms w/o linux-headers
Test-Command: apt-get install -yf linux-image-generic && dkms status
Features: test-name=install_linux-image_after_some-dkms_without_linux-headers
Architecture: amd64
Depends:
dkms-test-dkms,
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
# install some-noautoinstall-dkms after linux-headers
Test-Command: apt-get install -yf dkms-noautoinstall-test-dkms && dkms status
Features: test-name=install_some-noautoinstall-dkms_after_linux-headers
Architecture: amd64
Depends:
dkms,
linux-headers-generic,
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
# install linux-headers after some-noautoinstall-dkms
Test-Command: apt-get install -yf linux-headers-generic && dkms status
Features: test-name=install_linux-headers_after_some-noautoinstall-dkms
Architecture: amd64
Depends:
dkms-noautoinstall-test-dkms,
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
# 32-bit userspace with 64-bit kernel
# cf. https://bugs.debian.org/1042993
# workaround: apt-get install -yf linux-compiler-gcc-13-x86:amd64
Test-Command:
dpkg --add-architecture amd64 &&
apt-get update &&
apt-get install -yf linux-headers-amd64 &&
/usr/lib/dkms/dkms-autopkgtest dkms-test-dkms
Features: test-name=32-bit_userspace_with_64-bit_kernel
Architecture: i386
Depends:
dkms,
Restrictions:
allow-stderr,
needs-root,
breaks-testbed,
flaky,

17
debian/tests/run_test_wrapper.sh vendored Normal file
View File

@ -0,0 +1,17 @@
#!/bin/sh
KERNEL_VER=
NO_SIGNING_TOOL=
for kver in $(dpkg-query -W -f '${Package}\n' 'linux-headers-*' | sed s/linux-headers-//)
do
if [ -d "/lib/modules/$kver/build" ]
then
KERNEL_VER=$kver
grep -q "^CONFIG_MODULE_SIG_HASH=" "/lib/modules/$kver/build/.config" ||
NO_SIGNING_TOOL="--no-signing-tool"
break
fi
done
export KERNEL_VER
bash ./run_test.sh $NO_SIGNING_TOOL

4
debian/upstream/metadata vendored Normal file
View File

@ -0,0 +1,4 @@
Bug-Database: https://github.com/dell/dkms/issues
Bug-Submit: https://github.com/dell/dkms/issues/new
Repository: https://github.com/dell/dkms.git
Repository-Browse: https://github.com/dell/dkms

7
debian/watch vendored Normal file
View File

@ -0,0 +1,7 @@
version=4
#we no longer are hosted on linux.dell.com
#http://linux.dell.com/dkms/permalink/dkms-(.*)\.tar\.gz
https://github.com/dell/dkms/tags \
.*[^n]/(?:|v|version-|r|REL_|rel-|dkms(?:_|-))(\d[^\s/]*)\.(?:tar\.xz|txz|tar\.bz2|tbz2|tar\.gz|tgz)