I'm searching for a possibility to find the correct kernel source of an Ubuntu system based on the information which is available for the dkms system.
Background:
I'm using a system with an Atheros network adapter supported by the alx driver.
In my previous installation Wake On Lan worked like a charm on this interface.
Now I want to use Ubuntu 22.04 and WOL doesn't work out of the box.
I already created a dkms for getting it working again (will be published soon).
But my point is:
I already found out that there are several branches and release tags in the Ubuntu kernel git repo
https://code.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
I would prefer to deliver the dkms without the driver code itself. My current dkms contains the original kernel source of one specific version. My idea is to pull the sources from the original repo instead. But to do so I need a possibility to match the information available during dkms run to the correct tag in the kernel source.
First question is:
is this a good or bad idea?
Optimum would be a short explanation why it is good or bad :-)
Second question:
How can this match be done?
Example:
My current system reports "5.15.0-52-generic" as $kernelver.
I'm even not 100% sure but I think that the tag "Ubuntu-5.15.0-52.58" is used for that.
Is there any possibility to get that information in an "official" way?
Reason why I think that this is important is that I already found that my patch will not apply on future kernel releases and I would like to deliver different patches but not the sources. If that kind of matching is not possible I have to add the sources to my dkms package.
Thanks in advance for answers.
And in the case someone searches urgently for alx with wol in Ubuntu 22.04 I am preparing the publishing of one solution :-)
Kind regards, Andreas W.