Skip to content

Commit 3afac81

Browse files
committed
Check in centos-hpc 7.7 and centos-hpc 8.1 kickstart with updated GRUB_TIMEOUT/GRUB_TIMEOUT_STYLE settings, config for point release builds and bind-utils (only on 8.1) per CentOS/sig-cloud-instance-build#173
1 parent 2d391f9 commit 3afac81

File tree

2 files changed

+52
-3
lines changed

2 files changed

+52
-3
lines changed

ks/azure/centos77-hpc-sriov.ks

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,24 @@ nfs-utils
9797
# Disable the root account
9898
usermod root -p '!!'
9999

100+
# Set these to the point release baseurls so we can recreate a previous point release without current major version updates
100101
# Set OL repos
101-
curl -so /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/szarkos/AzureBuildCentOS/master/config/azure/CentOS-Base-7.repo
102-
curl -so /etc/yum.repos.d/OpenLogic.repo https://raw.githubusercontent.com/szarkos/AzureBuildCentOS/master/config/azure/OpenLogic.repo
102+
curl -so /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/CentOS-Base-7.repo
103+
curl -so /etc/yum.repos.d/OpenLogic.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/OpenLogic.repo
104+
sed -i -e 's/$releasever/7.7.1908/' /etc/yum.repos.d/CentOS-Base.repo
105+
#sed -i -e 's/$releasever/7.7.1908/' /etc/yum.repos.d/OpenLogic.repo
103106

104107
# Import CentOS and OpenLogic public keys
105-
curl -so /etc/pki/rpm-gpg/OpenLogic-GPG-KEY https://raw.githubusercontent.com/szarkos/AzureBuildCentOS/master/config/OpenLogic-GPG-KEY
108+
curl -so /etc/pki/rpm-gpg/OpenLogic-GPG-KEY https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/OpenLogic-GPG-KEY
106109
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
107110
rpm --import /etc/pki/rpm-gpg/OpenLogic-GPG-KEY
108111

109112
# Set the kernel cmdline
110113
sed -i 's/^\(GRUB_CMDLINE_LINUX\)=".*"$/\1="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0 scsi_mod.use_blk_mq=y"/g' /etc/default/grub
111114

115+
# Enforce GRUB_TIMEOUT=1 and remove any existing GRUB_TIMEOUT_STYLE and append GRUB_TIMEOUT_STYLE=countdown after GRUB_TIMEOUT
116+
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
117+
112118
# Enable grub serial console
113119
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >> /etc/default/grub
114120
sed -i 's/^GRUB_TERMINAL_OUTPUT=".*"$/GRUB_TERMINAL="serial console"/g' /etc/default/grub
@@ -147,6 +153,9 @@ cat << EOF > /etc/modprobe.d/blacklist-nouveau.conf
147153
blacklist nouveau
148154
options nouveau modeset=0
149155
EOF
156+
cat << EOF > /etc/modprobe.d/blacklist-floppy.conf
157+
blacklist floppy
158+
EOF
150159

151160
# Ensure Hyper-V drivers are built into initramfs
152161
echo '# Ensure Hyper-V drivers are built into initramfs' >> /etc/dracut.conf.d/azure.conf
@@ -233,6 +242,34 @@ yum clean all
233242
# Set tuned profile
234243
echo "virtual-guest" > /etc/tuned/active_profile
235244

245+
# Disable cloud-init config ... for now [RDA 200427]
246+
if [ 0 = 1 ]
247+
then
248+
# Disable provisioning and ephemeral disk handling in waagent.conf
249+
sed -i 's/Provisioning.Enabled=y/Provisioning.Enabled=n/g' /etc/waagent.conf
250+
sed -i 's/Provisioning.UseCloudInit=n/Provisioning.UseCloudInit=y/g' /etc/waagent.conf
251+
sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
252+
sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
253+
254+
# Update the default cloud.cfg to move disk setup to the beginning of init phase
255+
sed -i '/ - mounts/d' /etc/cloud/cloud.cfg
256+
sed -i '/ - disk_setup/d' /etc/cloud/cloud.cfg
257+
sed -i '/cloud_init_modules/a\\ - mounts' /etc/cloud/cloud.cfg
258+
sed -i '/cloud_init_modules/a\\ - disk_setup' /etc/cloud/cloud.cfg
259+
cloud-init clean
260+
261+
# Enable the Azure datasource
262+
cat > /etc/cloud/cloud.cfg.d/91-azure_datasource.cfg <<-EOF
263+
# This configuration file is used to connect to the Azure DS sooner
264+
datasource_list: [ Azure ]
265+
EOF
266+
fi
267+
268+
# Download these again at the end of the post-install script so we can recreate a previous point release without current major version updates
269+
# Set OL repos
270+
curl -so /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/CentOS-Base-7.repo
271+
#curl -so /etc/yum.repos.d/OpenLogic.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/OpenLogic.repo
272+
236273
# Deprovision and prepare for Azure
237274
/usr/sbin/waagent -force -deprovision
238275
rm -f /etc/resolv.conf 2>/dev/null # workaround old agent bug

ks/azure/centos81-hpc.ks

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ rng-tools
9090
cracklib
9191
cracklib-dicts
9292
centos-release
93+
bind-utils
9394
python3
9495

9596
# pull firmware packages out
@@ -137,21 +138,27 @@ gdisk
137138
# Disable the root account
138139
usermod 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
141143
sed -i 's/mirror.centos.org/olcentgbl.trafficmanager.net/' /etc/yum.repos.d/CentOS-AppStream.repo
142144
sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-AppStream.repo
143145
sed -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

145148
sed -i 's/mirror.centos.org/olcentgbl.trafficmanager.net/' /etc/yum.repos.d/CentOS-Base.repo
146149
sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-Base.repo
147150
sed -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
150154
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
151155

152156
# Set the kernel cmdline
153157
sed -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
156163
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >> /etc/default/grub
157164
sed -i 's/^GRUB_TERMINAL_OUTPUT=".*"$/GRUB_TERMINAL="serial console"/g' /etc/default/grub
@@ -251,6 +258,11 @@ dnf clean all
251258
# Set tuned profile
252259
echo "virtual-guest" > /etc/tuned/active_profile
253260

261+
262+
# Unset point release at the end of the post-install script so we can recreate a previous point release without current major version updates
263+
sed -i -e 's/8.1.1911/$releasever/' /etc/yum.repos.d/CentOS-Base.repo
264+
sed -i -e 's/8.1.1911/$releasever/' /etc/yum.repos.d/CentOS-AppStream.repo
265+
254266
# Deprovision and prepare for Azure
255267
/usr/sbin/waagent -force -deprovision
256268

0 commit comments

Comments
 (0)