Score:0

finding correct kernel source based on dkms infos

vu flag

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.

David avatar
cn flag
5.15.0-52-generic This is the kernel info from your question. This will get updated regularly so any fix to this file will be gone by an update to the OS in the future, a few weeks from now. Not really sure from your question what it is you are trying to accomplish.
Pilot6 avatar
cn flag
It unclear what you are trying to achieve. You can take the source from 5.15.0-52-generic and use it for your dkms package. So what is the problem? The package will be rebuilt on kernel upgrades.
Andreas W. avatar
vu flag
Thanks for the comments. My point is:; If I take a look into the Ubuntu Kernel git repo there is no tag 5.15.52-generic. Instead there are the tags (just some examples) Ubuntu-5.15.0-52.58 (which I think is the one used for the *-generic), Ubuntu-hwe-5.19-5.19.0-18.18_22.04.3 and Ubuntu-lowlatency-5.15.0-52.58. I would LOVE to know how to get one of the tags based on the "5.15.0-52-generic". Because then I can pull the exact matching sources out of the git repo.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.