@@ -182,7 +182,7 @@ phases:
182
182
fi
183
183
fi
184
184
185
- - name : PinKernelVersion
185
+ - name : PinVersion
186
186
action : ExecuteBash
187
187
inputs :
188
188
commands :
@@ -191,7 +191,45 @@ phases:
191
191
OS='{{ build.OperatingSystemName.outputs.stdout }}'
192
192
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
193
193
KERNEL_VERSION=$(uname -a)
194
+ RELEASE_VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}'
194
195
if [[ ${!PLATFORM} == RHEL ]]; then
196
+ if [[ ${!OS} == rhel9 ]] || [[ ${!OS} == rocky9 ]]; then
197
+ if [[ ! -f /etc/yum/vars/releasever ]]; then
198
+ echo "yes" > /opt/parallelcluster/pin_releasesever
199
+ echo ${!RELEASE_VERSION} > /etc/yum/vars/releasever
200
+ yum clean all
201
+ fi
202
+ fi
203
+ PACKAGE_LIST="kernel-headers-$(uname -r) kernel-devel-$(uname -r)"
204
+ if [[ ${!OS} != "rocky8" ]] && [[ ${!OS} != "rhel8" ]]; then
205
+ PACKAGE_LIST+=" kernel-devel-matched-$(uname -r)"
206
+ fi
207
+
208
+ if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then
209
+ if [[ ${!OS} == "rocky8" ]] ; then
210
+ REPOSITORY="BaseOS"
211
+ else
212
+ REPOSITORY="AppStream"
213
+ fi
214
+ for PACKAGE in ${!PACKAGE_LIST}
215
+ do
216
+ # try to install kernel source for a specific release version
217
+ yum install -y ${!PACKAGE}
218
+ if [ $? -ne 0 ]; then
219
+ yum install -y wget
220
+ # Previous releases are moved into a vault area once a new minor release version is available for at least a week.
221
+ # https://wiki.rockylinux.org/rocky/repo/#notes-on-devel
222
+ wget https://dl.rockylinux.org/vault/rocky/${!RELEASE_VERSION}/${!REPOSITORY}/$(uname -m)/os/Packages/k/${!PACKAGE}.rpm
223
+ yum install -y ./${!PACKAGE}.rpm
224
+ fi
225
+ done
226
+ else
227
+ for PACKAGE in ${!PACKAGE_LIST}
228
+ do
229
+ yum -y install ${!PACKAGE}
230
+ done
231
+ fi
232
+
195
233
yum install -y yum-plugin-versionlock
196
234
# listing all the packages because wildcard does not work as expected
197
235
yum versionlock kernel kernel-core kernel-modules
@@ -202,9 +240,24 @@ phases:
202
240
yum versionlock redhat-release
203
241
fi
204
242
else
243
+ apt-get -y install linux-headers-$(uname -r)
205
244
apt-mark hold linux-aws* linux-base* linux-headers* linux-image*
206
245
fi
207
- echo "Kernel version is ${!KERNEL_VERSION}"
246
+ echo "Kernel version is ${!KERNEL_VERSION}"
247
+
248
+ - name : DisableNouveau
249
+ action : ExecuteBash
250
+ inputs :
251
+ commands :
252
+ - |
253
+ set -v
254
+ PLATFORM='{{ build.PlatformName.outputs.stdout }}'
255
+ /bin/sed -r -i -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 rd.driver.blacklist=nouveau nouveau.modeset=0"/' /etc/default/grub
256
+ if [[ ${!PLATFORM} == RHEL ]]; then
257
+ grub2-mkconfig -o /boot/grub2/grub.cfg
258
+ elif [[ ${!PLATFORM} == DEBIAN ]]; then
259
+ update-grub
260
+ fi
208
261
209
262
# Install prerequisite OS packages
210
263
- name : InstallPrerequisite
@@ -215,16 +268,8 @@ phases:
215
268
set -v
216
269
OS='{{ build.OperatingSystemName.outputs.stdout }}'
217
270
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
218
- VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}'
219
271
220
272
if [[ ${!PLATFORM} == RHEL ]]; then
221
- if [[ ${!OS} == rhel9 ]] || [[ ${!OS} == rocky9 ]]; then
222
- if [[ ! -f /etc/yum/vars/releasever ]]; then
223
- echo "yes" > /opt/parallelcluster/pin_releasesever
224
- echo ${!VERSION} > /etc/yum/vars/releasever
225
- yum clean all
226
- fi
227
- fi
228
273
yum -y groupinstall development && sudo yum -y install wget jq
229
274
if [[ ${!OS} != alinux2023 ]]; then
230
275
# Do not install curl on al2023 since curl-minimal-8.5.0-1.amzn2023* is already shipped and conflicts.
@@ -243,6 +288,13 @@ phases:
243
288
apt-get -y install build-essential curl wget jq
244
289
fi
245
290
291
+ - name : RebootStep
292
+ action : Reboot
293
+ onFailure : Abort
294
+ maxAttempts : 2
295
+ inputs :
296
+ delaySeconds : 10
297
+
246
298
# Install Cinc
247
299
- name : InstallCinc
248
300
action : ExecuteBash
0 commit comments