Skip to content

Commit

Permalink
Fix kernel-devel package name for rhel8
Browse files Browse the repository at this point in the history
When using `wget`, the package name must contain the architecture too.
By redefining the `kernel_source_package_version` we're avoiding to `chomp` the architecture from kernel version.

Then, use `node['kernel']['machine']` rather than `uname -m`.

### Tests

Verified that both `dnf install` and `wget` commands are working when passing architecture.

### References

* https://github.com/chef/ohai/blob/17-stable/lib/ohai/plugins/kernel.rb#L34

Signed-off-by: Enrico Usai <[email protected]>
  • Loading branch information
enrico-usai committed Dec 14, 2023
1 parent 6a74396 commit 2d90eaa
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@
# Previous releases are moved into a vault area once a new minor release version is available for at least a week.
# https://wiki.rockylinux.org/rocky/repo/#notes-on-devel
set -e
wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/$(uname -m)/os/Packages/k/${package}.rpm
wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm
dnf install -y ./${package}.rpm
fi
dnf clean all
INSTALL_KERNEL_SOURCE
end unless on_docker?
end

def kernel_source_package_version
node['kernel']['release']
end

def default_packages
# environment-modules required by EFA, Intel MPI and ARM PL
# iptables needed for IMDS setup
Expand Down

0 comments on commit 2d90eaa

Please sign in to comment.