Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the retrieval of kernel version, release and dist
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]>
- Loading branch information