Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions rhel9/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ dep_installer () {
cpio \
kmod
fi

# Download unzboot as kernel images are compressed in the zboot format on RHEL 9 arm64
# unzboot is only available on the EPEL RPM repo
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf config-manager --enable epel
dnf install -y unzboot

rm -rf /var/cache/yum/*
}

Expand Down
24 changes: 11 additions & 13 deletions rhel9/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,22 @@ _install_prerequisites() (
depmod ${KERNEL_VERSION}

echo "Generating Linux kernel version string..."
if [ "$TARGETARCH" = "arm64" ]; then
# Download unzboot as kernel images are compressed in the zboot format on RHEL 9 arm64
# unzboot is only available on the EPEL RPM repo
dnf -q -y --releasever=${DNF_RELEASEVER} install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf config-manager --enable epel
dnf -q -y --releasever=${DNF_RELEASEVER} install unzboot

if ! unzboot /lib/modules/${KERNEL_VERSION}/vmlinuz vmlinuz.out; then
echo "Could not extract /lib/modules/${KERNEL_VERSION}/vmlinuz" >&2
return 1
fi
extract-vmlinux /lib/modules/${KERNEL_VERSION}/vmlinuz | strings | grep -E '^Linux version' | sed 's/^\(.*\)\s\+(.*)$/\1/' > version

if [ -z "$(<version)" ]; then
echo "extract-vmlinux image extraction failed. Falling back to unzboot..."
unzboot /lib/modules/${KERNEL_VERSION}/vmlinuz vmlinuz.out
< vmlinuz.out strings | grep -E '^Linux version' | sed 's/^\(.*\)\s\+(.*)$/\1/' > version
rm vmlinuz.out
else
extract-vmlinux /lib/modules/${KERNEL_VERSION}/vmlinuz | strings | grep -E '^Linux version' | sed 's/^\(.*\)\s\+(.*)$/\1/' > version
fi

if [ -z "$(<version)" ]; then
echo "unzboot image extraction failed. Falling back to gunzip..."
gunzip -c /lib/modules/${KERNEL_VERSION}/vmlinuz | strings | grep -E '^Linux version' | sed 's/^\(.*\)\s\+(.*)$/\1/' > version
fi

if [ -z "$(<version)" ]; then
echo "All attempts to extract /lib/modules/${KERNEL_VERSION}/vmlinuz failed"
echo "Could not locate Linux kernel version string" >&2
return 1
fi
Expand Down
2 changes: 2 additions & 0 deletions rhel9/ocp_dtk_entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ nv-ctr-run-with-dtk() {
/usr/local/bin/common.sh \
/usr/local/bin/extract-vmlinux \
/usr/local/bin/vgpu-util \
/usr/bin/unzboot \
/drivers \
/licenses \
"$DRIVER_TOOLKIT_SHARED_DIR/"
Expand Down Expand Up @@ -137,6 +138,7 @@ dtk-build-driver() {
"$DRIVER_TOOLKIT_SHARED_DIR/common.sh" \
"$DRIVER_TOOLKIT_SHARED_DIR/extract-vmlinux" \
"$DRIVER_TOOLKIT_SHARED_DIR/vgpu-util" \
"$DRIVER_TOOLKIT_SHARED_DIR/unzboot" \
"${DRIVER_TOOLKIT_SHARED_DIR}/bin"

ln -s $(which true) ${DRIVER_TOOLKIT_SHARED_DIR}/bin/dnf --force
Expand Down