File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ dep_installer () {
3737 make \
3838 cpio \
3939 kmod
40+
41+ # Download unzboot as kernel images are compressed in the zboot format on RHEL 9 arm64
42+ # unzboot is only available on the EPEL RPM repo
43+ dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
44+ dnf config-manager --enable epel
45+ dnf install -y unzboot
46+
4047 fi
4148 rm -rf /var/cache/yum/*
4249}
Original file line number Diff line number Diff line change @@ -143,19 +143,18 @@ _install_prerequisites() (
143143
144144 echo " Generating Linux kernel version string..."
145145 if [ " $TARGETARCH " = " arm64" ]; then
146- # Download unzboot as kernel images are compressed in the zboot format on RHEL 9 arm64
147- # unzboot is only available on the EPEL RPM repo
148- dnf -q -y --releasever=${DNF_RELEASEVER} install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
149- dnf config-manager --enable epel
150- dnf -q -y --releasever=${DNF_RELEASEVER} install unzboot
151-
152146 if ! unzboot /lib/modules/${KERNEL_VERSION} /vmlinuz vmlinuz.out; then
153147 echo " Could not extract /lib/modules/${KERNEL_VERSION} /vmlinuz" >&2
154148 return 1
155149 fi
156150
157151 < vmlinuz.out strings | grep -E ' ^Linux version' | sed ' s/^\(.*\)\s\+(.*)$/\1/' > version
158- rm vmlinuz.out
152+ rm vmlinuz.out || echo " WARNING: failed to extract /lib/modules/${KERNEL_VERSION} /vmlinuz"
153+
154+ # Fallback to gzip if unzboot fails
155+ if [ -z " $( < version) " ]; then
156+ gunzip -c /lib/modules/${KERNEL_VERSION} /vmlinuz | strings | grep -E ' ^Linux version' | sed ' s/^\(.*\)\s\+(.*)$/\1/' > version
157+ fi
159158 else
160159 extract-vmlinux /lib/modules/${KERNEL_VERSION} /vmlinuz | strings | grep -E ' ^Linux version' | sed ' s/^\(.*\)\s\+(.*)$/\1/' > version
161160 fi
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ nv-ctr-run-with-dtk() {
2626 /usr/local/bin/common.sh \
2727 /usr/local/bin/extract-vmlinux \
2828 /usr/local/bin/vgpu-util \
29+ /usr/bin/unzboot \
2930 /drivers \
3031 /licenses \
3132 " $DRIVER_TOOLKIT_SHARED_DIR /"
@@ -137,6 +138,7 @@ dtk-build-driver() {
137138 " $DRIVER_TOOLKIT_SHARED_DIR /common.sh" \
138139 " $DRIVER_TOOLKIT_SHARED_DIR /extract-vmlinux" \
139140 " $DRIVER_TOOLKIT_SHARED_DIR /vgpu-util" \
141+ " $DRIVER_TOOLKIT_SHARED_DIR /unzboot" \
140142 " ${DRIVER_TOOLKIT_SHARED_DIR} /bin"
141143
142144 ln -s $( which true) ${DRIVER_TOOLKIT_SHARED_DIR} /bin/dnf --force
You can’t perform that action at this time.
0 commit comments