Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop] Install kernel-devel for Rocky Linux from vault #5935

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ phases:
fi

if [[ ${!OS} == "rocky8" ]] ; then
yum versionlock rocky-release
yum versionlock rocky-release rocky-repos
elif [[ ${!OS} == "rhel8" ]] ; then
yum versionlock redhat-release
fi
Expand Down Expand Up @@ -234,7 +234,6 @@ phases:
set -v
OS='{{ build.OperatingSystemName.outputs.stdout }}'
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
DISABLE_KERNEL_UPDATE='{{ build.DisableKernelUpdate.outputs.stdout }}'

if [[ ${!PLATFORM} == RHEL ]]; then
yum -y update
Expand All @@ -256,15 +255,44 @@ phases:
else
package-cleanup -y --oldkernels --count=1
fi
# Install kernel-devel during OS update, so that headers are aligned with new kernel.
# The same is done for Debian through `apt-get -y install linux-aws`
yum -y install kernel-devel

elif [[ ${!PLATFORM} == DEBIAN ]]; then
DEBIAN_FRONTEND=noninteractive apt-get -y update
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --with-new-pkgs upgrade
apt-get --purge autoremove -y
fi

- name: InstallAdditionalKernelPackages
action: ExecuteBash
inputs:
commands:
- |
set -v
OS='{{ build.OperatingSystemName.outputs.stdout }}'
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
DISABLE_KERNEL_UPDATE='{{ build.DisableKernelUpdate.outputs.stdout }}'

if [[ ${!PLATFORM} == RHEL ]]; then
# Install kernel-devel during OS update, so that headers are aligned with new kernel.
# The same is done for Debian through `apt-get -y install linux-aws`
if [[ ${!OS} == "rocky8" ]] ; then
PACKAGE="kernel-devel-$(uname -r)"
RELEASE_VERSION=$(source /etc/os-release && echo ${!VERSION_ID})

# try to install kernel source for a specific release version
yum install -y ${!PACKAGE} --releasever ${!RELEASE_VERSION}
if [ $? -ne 0 ]; then
yum install -y wget
# 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/${!RELEASE_VERSION}/BaseOS/$(uname -m)/os/Packages/k/${!PACKAGE}.rpm
yum install -y ./${!PACKAGE}.rpm
fi
else
yum -y install kernel-devel
fi

elif [[ ${!PLATFORM} == DEBIAN ]]; then
jdeamicis marked this conversation as resolved.
Show resolved Hide resolved
if [[ ${!DISABLE_KERNEL_UPDATE} != true ]]; then
# already installed to LTS version
apt-get -y install linux-aws linux-headers-aws linux-image-aws
Expand Down
Loading