I got a binary kernel module provided by 3rd party, which expects version magic
5.4.0-81-generic SMP mod_unload modversions aarch64 of the kernel. It means that I need to grab the exact source tree to build the kernel for using the
.ko, on my own customized SoC platform.
Now I have serveral questions for this task:
5.4.0seems refer to the official kernel version
5.4; what is
81? Is this a patch level (or abi number)?
- Can I obtain the exact source tree by patching the official kernel version
5.4? If so, where can I find the corresponding patch file for patch level
- I can do
apt install linux-source-5.4.0, but there is no patch level on the linux-source pkg name. However, to install the headers, there are patch level on the pkg name, e.g.
apt install linux-header-5.4.0-81? Why the difference?
Ubuntu collects its own patched sources into a source package which you can download.
The version number includes a build version; the upstream sources (the Linux kernel) does not have an Ubuntu build, but each released build has a specific version with a number after the dash and you want exactly the right one.
apt-get install linux-headers-$(uname -r)
If you want the full sources,
apt source linux-generic
though in practice you want to read the instruction it prints and download the sources from Github.
Perhaps see also https://ubuntu.com/kernel and https://linuxhint.com/install-linux-kernel-ubuntu/
Answered By – tripleee