[RFC] dkms: Fix dkms-autopkgtest for packages without -dkms in the name

Marcelo Henrique Cerri marcelo.cerri at canonical.com
Tue Feb 2 13:40:42 UTC 2021


Hey, folks!

This week we had an issue with bcmwl-kernel-source
(6.30.223.271+bdcom-0ubuntu5) failing to build and to install in Focal
with the 5.8 HWE kernel and autopkgtest failed to catch the problem.

Investigating this issue yesterday with Cascardo's help, we found that
dkms-autopkgtest (which is shipped by dkms) skips any binary packages
which their names don't end with "-dkms". Since "bcmwl-kernel-source"
doesn't end with "-dkms", the DKMS test is never run for this package,
even with autodep8 correctly detecting that the DKMS test should be
run.

The solution we are proposing is to use basically the same mechanism
in dkms-autopkgtest that autodep8 uses in
"/usr/share/autodep8/support/dkms/detect" to detect the DKMS test is
needed.

I patched the DKMS package and tested it against the problematic
bcmwl-kernel-source version using Focal and the 5.8 kernel and it was
able to correctly detect the issue during the autopkgtest test.

I'm adding bellow a debdiff to dkms in Hirsute, but the change is
basically the same for Focal as well.

Please let me know your thoughts on this. Thank you.

https://paste.ubuntu.com/p/j68THG2rZw/

Or:

-->8--
diff -Nru dkms-2.8.4/debian/control dkms-2.8.4/debian/control
--- dkms-2.8.4/debian/control	2020-12-22 03:30:16.000000000 -0300
+++ dkms-2.8.4/debian/control	2020-12-22 03:32:22.000000000 -0300
@@ -24,6 +24,7 @@
  make | build-essential,
  coreutils (>= 7.4),
  patch,
+ dctrl-tools,
 Recommends: fakeroot,
  sudo,
  linux-headers-686-pae | linux-headers-amd64 | linux-headers-generic | linux-headers,
diff -Nru dkms-2.8.4/debian/scripts/dkms-autopkgtest dkms-2.8.4/debian/scripts/dkms-autopkgtest
--- dkms-2.8.4/debian/scripts/dkms-autopkgtest	2020-12-22 03:30:16.000000000 -0300
+++ dkms-2.8.4/debian/scripts/dkms-autopkgtest	2020-12-22 03:32:22.000000000 -0300
@@ -107,7 +107,8 @@
 # (This only works if the *-dkms package is not yet installed.)
 touch /etc/dkms/no-autoinstall

-for pkg in $(awk '/^Package:/ { print $2 }' debian/control | grep "\-dkms$"); do
+for pkg in $(grep-dctrl -FBuild-Depends,Build-Depends-Indep,Depends -e '(^| )dkms' \
+			-o -FPackage -e '\-dkms' debian/control -sPackage -n); 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"
-->8--

--
Regards,
Marcelo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20210202/2628f596/attachment.sig>


More information about the kernel-team mailing list