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: aws#2597

Signed-off-by: Enrico Usai <[email protected]>
  • Loading branch information
enrico-usai committed Dec 14, 2023
1 parent 552d205 commit 12dc205
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
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
set -e
# 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
wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/$(uname -m)/os/Packages/k/${package}.rpm
Expand Down

0 comments on commit 12dc205

Please sign in to comment.