Fix the retrieval of kernel version, release and dist #735
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During the build of the out-of-tree drivers, the base image will always have the
kernel-core
package installed. And theMakefile
doesn't pass theKERNEL_VERSION
argument to the build command. So, it's simpler to rely on thekernel-core
package info.The commands to get the
KREL
andKDIST
were not working with RHEL 9.4 kernel. The new set of commands has been tested withubi9/ubi:9.4
andcentos/centos:stream9
based driver toolkit image and they return the correct value. For example, the values returned for the following kernels are:5.14.0-427.28.1.el9_4
(ubi9:ubi:9.4
):KVER
:5.14.0
KREL
:427.28.1
KDIST
:.el9_4
5.14.0-427.el9
(centos/centos:stream9
):KVER
:5.14.0
KREL
:427
KDIST
:.el9
The
OS_VERSION_MAJOR
argument is also not passed by theMakefile
, but we can get it from the/etc/os-release
file. I'm switching to grep+sed, because I don't want to load all the other variables.