Without this, make nvidia was failing for me because the kernel version detection code assumes dnf info will only return details of one kernel package, but currently it shows two - the one installed (5.14.0-427.16.1.el9_4), and a newer one available (5.14.0-427.18.1.el9_4)
$ make nvidia FROM=registry.redhat.io/rhel9/rhel-bootc:9.4 REGISTRY=quay.io REGISTRY_ORG=markmc
...
STEP 5/7: RUN if [ "${KERNEL_VERSION}" == "" ]; then RELEASE=$(dnf info kernel-core | grep Release | awk -F: '{print $2}' | tr -d '[:blank:]') && VERSION=$(dnf info kernel-core | grep Version
| awk -F: '{print $2}' | tr -d '[:blank:]') && export KERNEL_VERSION="${VERSION}-${RELEASE}" ; fi && echo "${KERNEL_VERSION}" && dnf -y install dnf-plugin-config-manager && dnf conf
ig-manager --best --nodocs --setopt=install_weak_deps=False --save && dnf -y install kernel-devel-${KERNEL_VERSION} kernel-modules-${KERNEL_VERSION} kernel-modules-extra-${KERNEL_V
ERSION} && if [ "${ENABLE_RT}" ] && [ $(arch) == "x86_64" ]; then dnf -y --enablerepo=rt install kernel-rt-devel-${KERNEL_VERSION} kernel-rt-modules-${KERNEL_VERSION}
kernel-rt-modules-extra-${KERNEL_VERSION}; fi && export INSTALLED_KERNEL=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}" kernel-core-${KERNEL_VERSION}) && export GCC_VERSION=$(cat /lib/module
s/${INSTALLED_KERNEL}/config | grep -Eo "gcc \(GCC\) ([0-9\.]+)" | grep -Eo "([0-9\.]+)") && dnf -y install binutils diffutils elfutils-libelf-devel jq kabi-dw kern
el-abi-stablelists keyutils kmod gcc-${GCC_VERSION} git make mokutil openssl pinentry rpm-build xz && dnf clean all && u
seradd -u 1001 -m -s /bin/bash builder
5.14.0
5.14.0-427.16.1.el9_4
427.18.1.el9_4
...
No match for argument: 5.14.0-427.16.1.el9_4
No match for argument: 427.18.1.el9_4
Package kernel-modules-5.14.0-427.16.1.el9_4.x86_64 is already installed.
Error: Unable to find a match: 5.14.0-427.16.1.el9_4 427.18.1.el9_4
Cherry-picks containers/ai-lab-recipes#488
Without this,
make nvidia
was failing for me because the kernel version detection code assumesdnf info
will only return details of one kernel package, but currently it shows two - the one installed (5.14.0-427.16.1.el9_4
), and a newer one available (5.14.0-427.18.1.el9_4
)