#1042392 wireguard-dkms refuses to build on kernel 6.x

#1042392#5
Date:
2023-07-27 10:19:58 UTC
From:
To:
Dear Maintainer,

It seems that the BUILD_EXCLUSIVE directive on the dkms.conf contained
in the wireguard-dkms package prevents the module from being built on
kernels 6.x as the regex only contemplates kernel 5.x or earlier.

The problematic part seems to be:

```
if ls /lib/modules/5.5*/source/include/uapi/linux/wireguard.h >/dev/null 2>&1 ; then
    # debian backported wireguard into the 5.5 release:
    BUILD_EXCLUSIVE_KERNEL="^((5\.[0-4]($|[.-]))|(4\.)|(3\.1[0-9]))"
else
    # upstream requires kernel 3.10 - 5.5, inclusive:
    BUILD_EXCLUSIVE_KERNEL="^((5\.[0-5]($|[.-]))|(4\.)|(3\.1[0-9]))"
fi
```

Given that Debian 12 now ships with kernel 6.x, it might be worth
updating the regex appropriately.

Thank you very much in advance!

Kind Regards,
Jonas.

#1042392#10
Date:
2023-07-27 15:51:10 UTC
From:
To:
Hi,

I noticed that since wireguard has been included in kernels from 5.4 onwards,
if I am not mistaken, it makes sense for wireguard-dkms to not be built for
kernels 6.x.

However, maybe the DKMS error should be handled in some way or a notice be
printed if DKMS attempts to build the module for kernels >5.4, instead of just failing,
which results in a dpkg error with no additional information.

Sorry if this bug should not have been raised (as it is expected wireguard-
dkms should not be used with kernels > 5.4), but maybe the suggestion of
making it clearer is useful.

Thanks,
Jonas.