Skip to content

Commit

Permalink
Add an explicit step for updated headers installation
Browse files Browse the repository at this point in the history
Signed-off-by: Enrico Usai <[email protected]>
  • Loading branch information
enrico-usai committed Dec 12, 2023
1 parent 4113122 commit 57e14e3
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml
Original file line number Diff line number Diff line change
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,29 @@ 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: InstallUpdatedHeaders
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`
yum -y install kernel-devel
elif [[ ${!PLATFORM} == DEBIAN ]]; then
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

0 comments on commit 57e14e3

Please sign in to comment.