Skip to content

Commit ab1c01c

Browse files
committed
Check in centos 6.10 kickstart with updated GRUB_TIMEOUT/GRUB_TIMEOUT_STYLE settings and config for point release builds
1 parent 731a1a2 commit ab1c01c

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

ks/azure/centos610.ks

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ network --bootproto=dhcp
2121
# Use network installation
2222
url --url=http://olcentgbl.trafficmanager.net/centos/6.10/os/x86_64/
2323
repo --name="CentOS-Updates" --baseurl=http://olcentgbl.trafficmanager.net/centos/6.10/updates/x86_64/
24+
repo --name=openlogic --baseurl=http://olcentgbl.trafficmanager.net/openlogic/6/openlogic/x86_64/
2425

2526
# Root password
2627
rootpw --plaintext "to_be_disabled"
@@ -43,9 +44,6 @@ part / --fstype="ext4" --size=1 --grow --asprimary
4344
# System bootloader configuration
4445
bootloader --location=mbr --append="console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 disable_mtrr_trim" --timeout=1
4546

46-
# Add OpenLogic repo
47-
repo --name=openlogic --baseurl=http://olcentgbl.trafficmanager.net/openlogic/6/openlogic/x86_64/
48-
4947
# Firewall configuration
5048
firewall --disabled
5149

@@ -95,15 +93,21 @@ sed -i 's/ rhgb//g' /boot/grub/grub.conf
9593
sed -i 's/ quiet//g' /boot/grub/grub.conf
9694
sed -i 's/ crashkernel=auto//g' /boot/grub/grub.conf
9795

96+
# Set these to the point release baseurls so we can recreate a previous point release without current major version updates
9897
# Set OL repos
99-
curl -so /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/szarkos/AzureBuildCentOS/master/config/azure/CentOS-Base.repo
100-
curl -so /etc/yum.repos.d/OpenLogic.repo https://raw.githubusercontent.com/szarkos/AzureBuildCentOS/master/config/azure/OpenLogic.repo
98+
curl -so /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/CentOS-Base.repo
99+
curl -so /etc/yum.repos.d/OpenLogic.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/OpenLogic.repo
100+
sed -i -e 's/$releasever/6.10/' /etc/yum.repos.d/CentOS-Base.repo
101+
sed -i -e 's/$releasever/6.10/' /etc/yum.repos.d/OpenLogic.repo
101102

102103
# Import CentOS and OpenLogic public keys
103-
curl -so /etc/pki/rpm-gpg/OpenLogic-GPG-KEY https://raw.githubusercontent.com/szarkos/AzureBuildCentOS/master/config/OpenLogic-GPG-KEY
104+
curl -so /etc/pki/rpm-gpg/OpenLogic-GPG-KEY https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/OpenLogic-GPG-KEY
104105
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
105106
rpm --import /etc/pki/rpm-gpg/OpenLogic-GPG-KEY
106107

108+
# Enforce GRUB_TIMEOUT=1 and remove any existing GRUB_TIMEOUT_STYLE and append GRUB_TIMEOUT_STYLE=countdown after GRUB_TIMEOUT
109+
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
110+
107111
# Enable SSH keepalive
108112
sed -i 's/^#\(ClientAliveInterval\).*$/\1 180/g' /etc/ssh/sshd_config
109113

@@ -138,6 +142,36 @@ chkconfig cups off
138142
echo "http_caching=packages" >> /etc/yum.conf
139143
yum clean all
140144

145+
# Disable cloud-init config ... for now [RDA 200427]
146+
if [ 0 = 1 ]
147+
then
148+
# Disable provisioning and ephemeral disk handling in waagent.conf
149+
sed -i 's/Provisioning.Enabled=y/Provisioning.Enabled=n/g' /etc/waagent.conf
150+
sed -i 's/Provisioning.UseCloudInit=n/Provisioning.UseCloudInit=y/g' /etc/waagent.conf
151+
sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
152+
sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
153+
154+
# Update the default cloud.cfg to move disk setup to the beginning of init phase
155+
sed -i '/ - mounts/d' /etc/cloud/cloud.cfg
156+
sed -i '/ - disk_setup/d' /etc/cloud/cloud.cfg
157+
sed -i '/cloud_init_modules/a\\ - mounts' /etc/cloud/cloud.cfg
158+
sed -i '/cloud_init_modules/a\\ - disk_setup' /etc/cloud/cloud.cfg
159+
cloud-init clean
160+
161+
# Enable the Azure datasource
162+
cat > /etc/cloud/cloud.cfg.d/91-azure_datasource.cfg <<-EOF
163+
# This configuration file is used to connect to the Azure DS sooner
164+
datasource_list: [ Azure ]
165+
EOF
166+
fi
167+
168+
fi
169+
170+
# Download these again at the end of the post-install script so we can recreate a previous point release without current major version updates
171+
# Set OL repos
172+
curl -so /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/CentOS-Base.repo
173+
curl -so /etc/yum.repos.d/OpenLogic.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/OpenLogic.repo
174+
141175
# Deprovision and prepare for Azure
142176
/usr/sbin/waagent -force -deprovision
143177

0 commit comments

Comments
 (0)