@@ -192,7 +192,7 @@ phases:
192
192
set -v
193
193
OS='{{ build.OperatingSystemName.outputs.stdout }}'
194
194
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
195
-
195
+ KERNEL_VERSION=$(uname -a)
196
196
if [[ ${!PLATFORM} == RHEL ]]; then
197
197
yum install -y yum-plugin-versionlock
198
198
# listing all the packages because wildcard does not work as expected
@@ -209,8 +209,10 @@ phases:
209
209
elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then
210
210
yum versionlock redhat-release
211
211
fi
212
- echo "Kernel version locked"
212
+ else
213
+ apt-mark hold linux-aws* linux-base* linux-headers* linux-image*
213
214
fi
215
+ echo "Kernel version is ${!KERNEL_VERSION}"
214
216
215
217
# Install prerequisite OS packages
216
218
- name : InstallPrerequisite
@@ -340,7 +342,7 @@ phases:
340
342
set -v
341
343
OS='{{ build.OperatingSystemName.outputs.stdout }}'
342
344
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
343
-
345
+ BEFORE_KERNEL_VERSION='{{ build.PinKernelVersion.output.stdout }}'
344
346
# Remove kernel version lock
345
347
if [[ ${!PLATFORM} == RHEL ]]; then
346
348
yum versionlock delete kernel kernel-core kernel-modules
@@ -352,12 +354,17 @@ phases:
352
354
fi
353
355
354
356
if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then
355
- yum versionlock delete rocky-release
357
+ yum versionlock delete rocky-release rocky-repos
356
358
elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then
357
359
yum versionlock delete redhat-release
358
360
fi
359
- echo "Kernel version unlocked"
361
+ else
362
+ apt-mark unhold linux-aws* linux-base* linux-headers* linux-image*
363
+ fi
364
+ if [[ "$(uname -a)" != ${!BEFORE_KERNEL_VERSION} ]] ; then
365
+ echo "Kernel was upgraded from ${!BEFORE_KERNEL_VERSION} to $(uname -a)"
360
366
fi
367
+ echo "Kernel version unlocked"
361
368
362
369
- name : KeepSSM
363
370
action : ExecuteBash
0 commit comments