Blame CentOS-8-GenericCloud.ks

Brian Stinson dfa83b
text
Brian Stinson fc821a
auth --enableshadow --passalgo=sha512
Brian Stinson dfa83b
shutdown
Brian Stinson fc821a
firewall --enabled --service=ssh
Brian Stinson fc821a
firstboot --disable
Brian Stinson fc821a
ignoredisk --only-use=vda
Brian Stinson fc821a
keyboard us
Brian Stinson fc821a
# System language
Brian Stinson fc821a
lang en_US.UTF-8
Brian Stinson fc821a
# Network information
Brian Stinson fc821a
network  --bootproto=dhcp --device=link --activate --onboot=on
Brian Stinson fc821a
network  --hostname=localhost.localdomain
Brian Stinson fc821a
# Root password
Brian Stinson fc821a
rootpw --iscrypted thereisnopasswordanditslocked
Brian Stinson fc821a
selinux --enforcing
13eb05
services --disabled="kdump" --enabled="NetworkManager,sshd,rsyslog,chronyd,cloud-init,cloud-init-local,cloud-config,cloud-final,rngd"
Brian Stinson fc821a
timezone UTC --isUtc
Brian Stinson fc821a
# Disk
ed2320
bootloader --append="console=ttyS0,115200n8 no_timer_check crashkernel=auto net.ifnames=0" --location=mbr --timeout=1 --boot-drive=vda
Brian Stinson fc821a
zerombr
Brian Stinson fc821a
clearpart --all --initlabel 
Brian Stinson fc821a
reqpart
Brian Stinson fc821a
part / --fstype="xfs" --ondisk=vda --size=8000
Brian Stinson fc821a
Brian Stinson fc821a
%post --erroronfail
Brian Stinson fc821a
passwd -d root
Brian Stinson fc821a
passwd -l root
Brian Stinson fc821a
Brian Stinson fc821a
# pvgrub support
Brian Stinson fc821a
echo -n "Creating grub.conf for pvgrub"
Brian Stinson fc821a
rootuuid=$( awk '$2=="/" { print $1 };'  /etc/fstab )
Brian Stinson fc821a
mkdir /boot/grub
Brian Stinson fc821a
echo -e 'default=0\ntimeout=0\n\n' > /boot/grub/grub.conf
Brian Stinson fc821a
for kv in $( ls -1v /boot/vmlinuz* |grep -v rescue |sed s/.*vmlinuz-//  ); do
Brian Stinson e0a59e
  echo "title CentOS Linux 8 ($kv)" >> /boot/grub/grub.conf
Brian Stinson fc821a
  echo -e "\troot (hd0)" >> /boot/grub/grub.conf
Brian Stinson fc821a
  echo -e "\tkernel /boot/vmlinuz-$kv ro root=$rootuuid console=hvc0 LANG=en_US.UTF-8" >> /boot/grub/grub.conf
Brian Stinson fc821a
  echo -e "\tinitrd /boot/initramfs-$kv.img" >> /boot/grub/grub.conf
Brian Stinson fc821a
  echo
Brian Stinson fc821a
done
Brian Stinson fc821a
ln -sf grub.conf /boot/grub/menu.lst
Brian Stinson fc821a
ln -sf /boot/grub/grub.conf /etc/grub.conf
Brian Stinson fc821a
Brian Stinson fc821a
# setup systemd to boot to the right runlevel
Brian Stinson fc821a
rm -f /etc/systemd/system/default.target
Brian Stinson fc821a
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
Brian Stinson fc821a
echo .
Brian Stinson fc821a
Brian Stinson 8f780b
dnf -C -y remove linux-firmware
Brian Stinson fc821a
Brian Stinson fc821a
# Remove firewalld; it is required to be present for install/image building.
Brian Stinson fc821a
# but we dont ship it in cloud
Brian Stinson 8f780b
dnf -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
Brian Stinson 8f780b
dnf -C -y remove avahi\* 
Brian Stinson fc821a
sed -i '/^#NAutoVTs=.*/ a\
Brian Stinson fc821a
NAutoVTs=0' /etc/systemd/logind.conf
Brian Stinson fc821a
Brian Stinson fc821a
cat > /etc/sysconfig/network << EOF
Brian Stinson fc821a
NETWORKING=yes
Brian Stinson fc821a
NOZEROCONF=yes
Brian Stinson fc821a
EOF
Brian Stinson fc821a
Johan Guldmyr 3c8301
# Remove build-time resolvers to fix #16948
Johan Guldmyr 3c8301
echo > /etc/resolv.conf
Johan Guldmyr 3c8301
Brian Stinson fc821a
# For cloud images, 'eth0' _is_ the predictable device name, since
Brian Stinson fc821a
# we don't want to be tied to specific virtual (!) hardware
Brian Stinson fc821a
rm -f /etc/udev/rules.d/70*
Brian Stinson fc821a
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
Brian Stinson fc821a
Brian Stinson fc821a
# simple eth0 config, again not hard-coded to the build hardware
Brian Stinson fc821a
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
Brian Stinson fc821a
DEVICE="eth0"
Brian Stinson fc821a
BOOTPROTO="dhcp"
Brian Stinson fc821a
ONBOOT="yes"
Brian Stinson fc821a
TYPE="Ethernet"
Brian Stinson fc821a
USERCTL="yes"
Brian Stinson fc821a
PEERDNS="yes"
Brian Stinson fc821a
IPV6INIT="no"
Brian Stinson fc821a
PERSISTENT_DHCLIENT="1"
Brian Stinson fc821a
EOF
Brian Stinson fc821a
Brian Stinson fc821a
echo "virtual-guest" > /etc/tuned/active_profile
Brian Stinson fc821a
Brian Stinson fc821a
# generic localhost names
Brian Stinson fc821a
cat > /etc/hosts << EOF
Brian Stinson fc821a
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
Brian Stinson fc821a
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
Brian Stinson fc821a
Brian Stinson fc821a
EOF
Brian Stinson fc821a
echo .
Brian Stinson fc821a
Brian Stinson fc821a
systemctl mask tmp.mount
Brian Stinson fc821a
Brian Stinson fc821a
cat <<EOL > /etc/sysconfig/kernel
Brian Stinson fc821a
# UPDATEDEFAULT specifies if new-kernel-pkg should make
Brian Stinson fc821a
# new kernels the default
Brian Stinson fc821a
UPDATEDEFAULT=yes
Brian Stinson fc821a
Brian Stinson fc821a
# DEFAULTKERNEL specifies the default kernel package type
Brian Stinson fc821a
DEFAULTKERNEL=kernel
Brian Stinson fc821a
EOL
Brian Stinson fc821a
Brian Stinson fc821a
# make sure firstboot doesn't start
Brian Stinson fc821a
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
Brian Stinson fc821a
c01513
# centos cloud user
c01513
echo -e 'centos\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
c01513
sed -i 's/name: cloud-user/name: centos/g' /etc/cloud/cloud.cfg
Brian Stinson fc821a
Brian Stinson fc821a
dnf clean all
Brian Stinson fc821a
Brian Stinson fc821a
# XXX instance type markers - MUST match CentOS Infra expectation
Brian Stinson fc821a
echo 'genclo' > /etc/yum/vars/infra
Brian Stinson fc821a
Brian Stinson f324f8
# change dhcp client retry/timeouts to resolve #6866
Brian Stinson fc821a
cat  >> /etc/dhcp/dhclient.conf << EOF
Brian Stinson fc821a
Brian Stinson fc821a
timeout 300;
Brian Stinson fc821a
retry 60;
Brian Stinson fc821a
EOF
Brian Stinson fc821a
Brian Stinson fc821a
Brian Stinson fc821a
rm -rf /var/log/yum.log
Brian Stinson fc821a
rm -rf /var/lib/yum/*
Brian Stinson fc821a
rm -rf /root/install.log
Brian Stinson fc821a
rm -rf /root/install.log.syslog
Brian Stinson fc821a
rm -rf /root/anaconda-ks.cfg
Brian Stinson fc821a
rm -rf /var/log/anaconda*
Brian Stinson fc821a
Brian Stinson fc821a
rm -f /var/lib/systemd/random-seed
Brian Stinson fc821a
Brian Stinson fc821a
cat /dev/null > /etc/machine-id
Brian Stinson fc821a
Brian Stinson fc821a
echo "Fixing SELinux contexts."
Brian Stinson fc821a
touch /var/log/cron
Brian Stinson fc821a
touch /var/log/boot.log
Brian Stinson fc821a
mkdir -p /var/cache/yum
Brian Stinson fc821a
/usr/sbin/fixfiles -R -a restore
Brian Stinson fc821a
Brian Stinson fc821a
# reorder console entries
Brian Stinson fc821a
sed -i 's/console=tty0/console=tty0 console=ttyS0,115200n8/' /boot/grub2/grub.cfg
Brian Stinson fc821a
Marcin Juszkiewicz 289e17
true
Marcin Juszkiewicz 289e17
Brian Stinson fc821a
%end
Brian Stinson fc821a
Brian Stinson fc821a
%packages
Brian Stinson fc821a
@core
Brian Stinson fc821a
chrony
Brian Stinson fc821a
dnf
Brian Stinson fc821a
yum
Brian Stinson fc821a
cloud-init
Brian Stinson fc821a
cloud-utils-growpart
13eb05
NetworkManager
Brian Stinson fc821a
dracut-config-generic
Brian Stinson fc821a
dracut-norescue
Brian Stinson fc821a
firewalld
d3bcf0
gdisk
Brian Stinson fc821a
grub2
Brian Stinson fc821a
kernel
Brian Stinson fc821a
nfs-utils
Brian Stinson fc821a
rsync
Brian Stinson fc821a
tar
Brian Stinson fc821a
dnf-utils
Brian Stinson 8f780b
yum-utils
Brian Stinson fc821a
-aic94xx-firmware
Brian Stinson fc821a
-alsa-firmware
Brian Stinson fc821a
-alsa-lib
Brian Stinson fc821a
-alsa-tools-firmware
Brian Stinson fc821a
-ivtv-firmware
Brian Stinson fc821a
-iwl100-firmware
Brian Stinson fc821a
-iwl1000-firmware
Brian Stinson fc821a
-iwl105-firmware
Brian Stinson fc821a
-iwl135-firmware
Brian Stinson fc821a
-iwl2000-firmware
Brian Stinson fc821a
-iwl2030-firmware
Brian Stinson fc821a
-iwl3160-firmware
Brian Stinson fc821a
-iwl3945-firmware
Brian Stinson fc821a
-iwl4965-firmware
Brian Stinson fc821a
-iwl5000-firmware
Brian Stinson fc821a
-iwl5150-firmware
Brian Stinson fc821a
-iwl6000-firmware
Brian Stinson fc821a
-iwl6000g2a-firmware
Brian Stinson fc821a
-iwl6000g2b-firmware
Brian Stinson fc821a
-iwl6050-firmware
Brian Stinson fc821a
-iwl7260-firmware
Brian Stinson fc821a
-libertas-sd8686-firmware
Brian Stinson fc821a
-libertas-sd8787-firmware
Brian Stinson fc821a
-libertas-usb8388-firmware
Brian Stinson fc821a
-biosdevname
Brian Stinson fc821a
-iprutils
Brian Stinson fc821a
-plymouth
Brian Stinson fc821a
Brian Stinson fc821a
python3-jsonschema
Brian Stinson fc821a
qemu-guest-agent
Brian Stinson fc821a
dhcp-client
Brian Stinson fc821a
cockpit-ws
Brian Stinson fc821a
cockpit-system
Brian Stinson fc821a
-langpacks-*
Brian Stinson fc821a
-langpacks-en
Brian Stinson fc821a
Brian Stinson fc821a
centos-release
Brian Stinson fc821a
rng-tools
Brian Stinson fc821a
%end