Skip to content

Commit df27c63

Browse files
committed
Fix kernel-devel package name for rhel8
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 `dnf install` is working on both the cases 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]>
1 parent 024a18c commit df27c63

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,20 @@
2828
# try to install kernel source for a specific release version
2929
dnf install -y ${package} --releasever #{node['platform_version']}
3030
if [ $? -ne 0 ]; then
31-
set -e
3231
# Previous releases are moved into a vault area once a new minor release version is available for at least a week.
3332
# https://wiki.rockylinux.org/rocky/repo/#notes-on-devel
34-
wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/$(uname -m)/os/Packages/k/${package}.rpm
35-
dnf install -y ./${package}.rpm
33+
set -e
34+
dnf -y install https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm
3635
fi
3736
dnf clean all
3837
INSTALL_KERNEL_SOURCE
3938
end unless on_docker?
4039
end
4140

41+
def kernel_source_package_version
42+
node['kernel']['release']
43+
end
44+
4245
def default_packages
4346
# environment-modules required by EFA, Intel MPI and ARM PL
4447
# iptables needed for IMDS setup

0 commit comments

Comments
 (0)