Skip to content

Commit

Permalink
Avoid to exit while trying to install a specific kernel-devel version
Browse files Browse the repository at this point in the history
This code has been created to try to install using `--releasever` parameter
and if this command fails try to install the package from vault,
anyway the `set -e` at the top of the failing was causing all the build to fail.

Manually tested in a Rocky-8-EC2-Base-8.8-20230518.0.x86_64

Related to: #2598

Signed-off-by: Enrico Usai <[email protected]>
  • Loading branch information
enrico-usai committed Dec 14, 2023
1 parent 8b869b5 commit 362633a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
bash "Install kernel source" do
user 'root'
code <<-INSTALL_KERNEL_SOURCE
set -e
package="#{kernel_source_package}-#{kernel_source_package_version}"
# try to install kernel source for a specific release version
dnf install -y ${package} --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
set -e
wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/$(uname -m)/os/Packages/k/${package}.rpm
dnf install -y ./${package}.rpm
fi
Expand Down

0 comments on commit 362633a

Please sign in to comment.