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

Kleber Souza kleber.souza at canonical.com
Tue Feb 2 15:07:14 UTC 2021


On 02.02.21 14:40, Marcelo Henrique Cerri wrote:
> 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

In bionic we didn't have the grep for "-dkms" part, which is why we were caught up
by surprise with hwe-5.8 in focal. I've tracked this change and it was introduced
on Debian by version 2.7.1-5 (we have 2.3-3 in bionic and 2.8.1 in focal). This change
was made to fix the following bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903588

I have checked the latest version in Debian and it's the same that we have in Hirsute,
so it might make sense to send this change back to Debian as well.

This change looks fine to make, IMO it makes sense to use the same criteria as the
autodep8 detect script.


Thanks for looking into it!

Kleber


>       # 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
> 
> 




More information about the kernel-team mailing list