Score:1

How to determine the “latest” kernel version for Ubuntu 20.04?

in flag

I am trying to build an automated process to compile a kernel driver, so as new kernels become available, the process can automatically install new kernel headers and build the driver against those.

The driver will eventually run on a machine with Ubuntu 20.04 Server LTS.

One thing I am stuck on is how to determine when new headers are available.

If the build server is also Ubuntu 20.04 Server, then I believe I can do apt update and apt-cache policy linux-headers-generic to find the candidate version and install that? Is that reasonable? (My understanding is Ubuntu 20.04 Server is not on the latest kernel version, but following 5.4.0?)

But, if the build server is a different version of Ubuntu - e.g. 20.10 or 21.04 then I would be potentially getting an incorrect candidate if used apt-cache policy. How would I, in this case, know what the latest kernel version in Ubuntu 20.04 would be?

Thanks.

user535733 avatar
cn flag
Using DKMS for this purpose might be easier.
in flag
@user535733 we have considered that option, but the destination machine is in a restricted environment and having build tools on the machine is strictly a no.
user535733 avatar
cn flag
Were it my system, my build environment would have an LXD container that mirrored the restricted system's Ubuntu version, package list (+ build packages) and /etc/machine-id file -- but no applications running and no data. Apt would provide identical upgrades --for our purposes-- every day, and dkms will build the new kernel modules and then notify you. All you do is await the ping from your container that a new module is ready for you to test and then copy to the restricted system.
Terrance avatar
id flag
Ubuntu Server can install the HWE kernel version on it which allows for the kernel versions from the newer releases like 21.04 and 21.10 to be installed into 20.04 LTS. https://ubuntu.com/kernel/lifecycle
guiverc avatar
cn flag
The default for Ubuntu Server is to use the GA kernel stack (5.4 for 20.04); but that default can be changed during the installation process; and any time after that. You can have both GA & HWE stacks installed; or just one (meaning two *latest* kernels if both GA & HWE is installed)
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.