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