gardenlinux / gardenlinux-nvidia-installer

3 stars 7 forks source link

fix: do not rely on apt-cache metapackage #17

Closed Vincinator closed 8 months ago

Vincinator commented 8 months ago

Assuming we are within a driver build container and want the latest kernel headers, this new extract_kernel_version script detects the kernel version by looking for the directory name format inside /usr/lib/modules. Only the version number is extracted using grep and sorted numerically.

Vincinator commented 8 months ago

This fix uncovers a follow up issue for me:

ERROR: Unable to find the kernel source tree for the currently running kernel.  Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed.  If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.

Did not know that the compile script requires the full kernel sources, or did this change from headers only to full source?

kernel sources are not installed in the driver-build container (only headers). retroactively including it is a bit of careful work, because we need to Frankenstein together build dependencies from today repo and kernel specific packages from release apt repos (934.N and 1312.N)

dhague commented 8 months ago

I think the problem here is with the new extract_kernel_version.h.

If I run:

docker build . --build-arg TARGET_ARCH=amd64 --build-arg DRIVER_VERSION=535.86.10 --build-arg GARDENLINUX_VERSION=934.10

with the original extract_kernel_version.h script, it runs fine. With the version in this PR it gives the error you mention above. By adding --progress=plain to the docker build command I can see that the original script gives the kernel version as 5.15.125-gardenlinux-cloud-amd64, but the new script gives the kernel version as 5.15.125

Vincinator commented 8 months ago

ah.. the new extract_kernel_version.sh is complete foobar :) thanks for checking.

mbhagdev commented 8 months ago

My apologies, What is the fix to get this to work with the latest gardenlinux 1312.3 ? @Vincinator

Vincinator commented 8 months ago

Hi @mbhagdev we are working on it. The issue is in the driver-build container. Will open a new PR with the correct fix