Skip to content

Commit

Permalink
fix(pkg/driver): properly fixup KernelVersion before executing driver…
Browse files Browse the repository at this point in the history
…kit kernel download script template.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Apr 2, 2024
1 parent 1bda127 commit 8f246a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/driver/distro/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ func Build(ctx context.Context,
// try to load kernel headers urls from driverkit.
if _, found := env[drivertype.KernelDirEnv]; !found {
printer.Logger.Debug("Trying to automatically fetch kernel headers.")
kernelHeadersPath, cleaner, err := loadKernelHeadersFromDk(d.String(), kr)
// KernelVersion needs to be fixed up; it is only used by driverkit Ubuntu builder
// and we must ensure that it is correctly set.
fixedKr := d.FixupKernel(kr)
kVerFixedKr := kr
kVerFixedKr.KernelVersion = fixedKr.KernelVersion
kernelHeadersPath, cleaner, err := loadKernelHeadersFromDk(d.String(), kVerFixedKr)
if cleaner != nil {
defer cleaner()
}
Expand Down

0 comments on commit 8f246a6

Please sign in to comment.