Skip to content

Commit

Permalink
kernel-matched
Browse files Browse the repository at this point in the history
  • Loading branch information
hgreebe committed Dec 13, 2024
1 parent 40c2d54 commit 2cf32fb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@
user 'root'
code <<-INSTALL_KERNEL_SOURCE
package="#{kernel_source_package}-#{kernel_source_package_version}"
matched="kernel-matched-#{kernel_source_package_version}"
# try to install kernel source for a specific release version
dnf install -y ${package} --releasever #{node['platform_version']}
dnf install -y ${package} ${matched} --releasever #{node['platform_version']}
if [ $? -ne 0 ]; then
# 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
base_os_package_url="https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm"
appstream_package_url="https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/AppStream/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm"
base_os_matched_url="https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${matched}.rpm"
appstream_matched_url="https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/AppStream/#{node['kernel']['machine']}/os/Packages/k/${matched}.rpm"
base_os_status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null ${base_os_package_url})
appstream_status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null ${appstream_package_url})
set -e
if [ $base_os_status_code != 404 ]; then
dnf install -y ${base_os_package_url}
dnf install -y ${base_os_matched_url}
elif [ $appstream_status_code != 404 ]; then
dnf install -y ${appstream_package_url}
dnf install -y ${appstream_matched_url}
fi
fi
dnf clean all
Expand Down

0 comments on commit 2cf32fb

Please sign in to comment.