Skip to content

Commit

Permalink
Use --installed to get kernel version for packages to be installed
Browse files Browse the repository at this point in the history
Signed-off-by: Javi Polo <[email protected]>
  • Loading branch information
javipolo committed Jun 25, 2024
1 parent 5e41848 commit 03a3858
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions training/common/driver-toolkit/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ ARG ENABLE_RT=''
USER root

RUN if [ "${KERNEL_VERSION}" == "" ]; then \
NEWER_KERNEL_CORE=$(dnf info kernel-core | awk -F: '/^Source/{gsub(/.src.rpm/, "", $2); print $2}' | sort -n | tail -n1) \
&& RELEASE=$(dnf info ${NEWER_KERNEL_CORE} | awk -F: '/^Release/{print $2}' | tr -d '[:blank:]') \
&& VERSION=$(dnf info ${NEWER_KERNEL_CORE} | awk -F: '/^Version/{print $2}' | tr -d '[:blank:]') \
RELEASE=$(dnf info --installed kernel-core | awk -F: '/^Release/{print $2}' | tr -d '[:blank:]') \
&& VERSION=$(dnf info --installed kernel-core | awk -F: '/^Version/{print $2}' | tr -d '[:blank:]') \
&& export KERNEL_VERSION="${VERSION}-${RELEASE}" ;\
fi \
&& echo "${KERNEL_VERSION}" \
Expand Down
5 changes: 2 additions & 3 deletions training/nvidia-bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ WORKDIR /home/builder
COPY --chown=1001:0 x509-configuration.ini x509-configuration.ini

RUN if [ "${KERNEL_VERSION}" == "" ]; then \
NEWER_KERNEL_CORE=$(dnf info kernel-core | awk -F: '/^Source/{gsub(/.src.rpm/, "", $2); print $2}' | sort -n | tail -n1) \
&& RELEASE=$(dnf info ${NEWER_KERNEL_CORE} | awk -F: '/^Release/{print $2}' | tr -d '[:blank:]') \
&& VERSION=$(dnf info ${NEWER_KERNEL_CORE} | awk -F: '/^Version/{print $2}' | tr -d '[:blank:]') \
RELEASE=$(dnf info --installed kernel-core | awk -F: '/^Release/{print $2}' | tr -d '[:blank:]') \
&& VERSION=$(dnf info --installed kernel-core | awk -F: '/^Version/{print $2}' | tr -d '[:blank:]') \
&& export KERNEL_VERSION="${VERSION}-${RELEASE}" ;\
fi \
&& if [ "${OS_VERSION_MAJOR}" == "" ]; then \
Expand Down

0 comments on commit 03a3858

Please sign in to comment.