Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the retrieval of kernel version, release and dist #735

Merged

Conversation

fabiendupont
Copy link
Contributor

During the build of the out-of-tree drivers, the base image will always have the kernel-core package installed. And the Makefile doesn't pass the KERNEL_VERSION argument to the build command. So, it's simpler to rely on the kernel-core package info.

The commands to get the KREL and KDIST were not working with RHEL 9.4 kernel. The new set of commands has been tested with ubi9/ubi:9.4 and centos/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 the Makefile, 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.

During the build of the out-of-tree drivers, the base image will always
have the `kernel-core` package installed. And the `Makefile` doesn't
pass the `KERNEL_VERSION` argument to the build command. So, it's
simpler to rely on the `kernel-core` package info.

The commands to get the `KREL` and `KDIST` were not working with RHEL
9.4 kernel. The new set of commands has been tested with `ubi9/ubi:9.4`
and `centos/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 the `Makefile`,
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.

Signed-off-by: Fabien Dupont <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Aug 7, 2024

LGTM

@rhatdan rhatdan merged commit ec7de55 into containers:main Aug 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants