@@ -90,6 +90,7 @@ rng-tools
9090cracklib
9191cracklib-dicts
9292centos-release
93+ bind-utils
9394python3
9495
9596# pull firmware packages out
@@ -137,21 +138,27 @@ gdisk
137138# Disable the root account
138139usermod root -p ' !!'
139140
141+ # Set these to the point release baseurls so we can recreate a previous point release without current major version updates
140142# Set Base and AppStream repos to the Azure mirrors
141143sed -i ' s/mirror.centos.org/olcentgbl.trafficmanager.net/' /etc/yum.repos.d/CentOS-AppStream.repo
142144sed -i ' s/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-AppStream.repo
143145sed -i ' s/^#baseurl/baseurl/' /etc/yum.repos.d/CentOS-AppStream.repo
146+ sed -i -e ' s/$releasever/8.1.1911/' /etc/yum.repos.d/CentOS-AppStream.repo
144147
145148sed -i ' s/mirror.centos.org/olcentgbl.trafficmanager.net/' /etc/yum.repos.d/CentOS-Base.repo
146149sed -i ' s/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-Base.repo
147150sed -i ' s/^#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo
151+ sed -i -e ' s/$releasever/8.1.1911/' /etc/yum.repos.d/CentOS-Base.repo
148152
149153# Import CentOS public key
150154rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
151155
152156# Set the kernel cmdline
153157sed -i ' s/^\(GRUB_CMDLINE_LINUX\)=".*"$/\1="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 scsi_mod.use_blk_mq=y"/g' /etc/default/grub
154158
159+ # Enforce GRUB_TIMEOUT=1 and remove any existing GRUB_TIMEOUT_STYLE and append GRUB_TIMEOUT_STYLE=countdown after GRUB_TIMEOUT
160+ sed -i -n -e ' s/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=1/' -e ' /^GRUB_TIMEOUT_STYLE=/!p' -e ' /^GRUB_TIMEOUT=/aGRUB_TIMEOUT_STYLE=countdown' /etc/default/grub
161+
155162# Enable grub serial console
156163echo ' GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >> /etc/default/grub
157164sed -i ' s/^GRUB_TERMINAL_OUTPUT=".*"$/GRUB_TERMINAL="serial console"/g' /etc/default/grub
@@ -242,6 +249,11 @@ dnf clean all
242249# Set tuned profile
243250echo " virtual-guest" > /etc/tuned/active_profile
244251
252+
253+ # Unset point release at the end of the post-install script so we can recreate a previous point release without current major version updates
254+ sed -i -e ' s/8.1.1911/$releasever/' /etc/yum.repos.d/CentOS-Base.repo
255+ sed -i -e ' s/8.1.1911/$releasever/' /etc/yum.repos.d/CentOS-AppStream.repo
256+
245257# Deprovision and prepare for Azure
246258/usr/sbin/waagent -force -deprovision
247259
0 commit comments