#version=RHEL7 # Install OS instead of upgrade install # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # Reboot after installation reboot # Root password rootpw --iscrypted --lock locked # System language lang en_US.UTF-8 # Firewall configuration firewall --disabled # Use text mode install text # SELinux configuration selinux --enforcing # Network information network --bootproto=dhcp --device=eth0 repo --name="koji-override-0" --baseurl=https://koji.cern.ch/kojifiles/repos/cc7-image-7x-build/637954/x86_64 # System timezone timezone Europe/Zurich --isUtc # Use network installation url --url="http://linuxsoft.cern.ch/cern/centos/7/os/x86_64" # System bootloader configuration bootloader --location=none # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part / --fstype="ext4" --size=3000 %post --logfile=/root/ks-post.log # randomize root password and lock root account dd if=/dev/urandom count=50 | md5sum | passwd --stdin root passwd -l root # create necessary devices /sbin/MAKEDEV /dev/console rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-cern rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-kojiv2 # some packages get installed even though we ask for them not to be, # and they don't have any external dependencies that should make # anaconda install them rpm -e kernel yum -y remove bind-libs bind-libs-lite dhclient dhcp-common dhcp-libs \ dracut-network e2fsprogs e2fsprogs-libs ebtables ethtool file \ firewalld freetype gettext gettext-libs groff-base grub2 grub2-tools \ grubby initscripts iproute iptables kexec-tools libcroco libgomp \ libmnl libnetfilter_conntrack libnfnetlink libselinux-python lzo \ libunistring os-prober python-decorator python-slip python-slip-dbus \ snappy sysvinit-tools which linux-firmware yum -y install centos-release-scl yum clean all rm -rf /etc/firewalld rm -rf /boot #delete a few systemd things rm -rf /etc/machine-id rm -rf /usr/lib/systemd/system/multi-user.target.wants/getty.target rm -rf /usr/lib/systemd/system/multi-user.target.wants/systemd-logind.service # Add tsflags to keep yum from installing docs sed -i '/distroverpkg=centos-release/a tsflags=nodocs' /etc/yum.conf #Make it easier for systemd to run in Docker container cp /usr/lib/systemd/system/dbus.service /etc/systemd/system/ sed -i 's/OOMScoreAdjust=-900//' /etc/systemd/system/dbus.service #Mask mount units and getty service so that we don't get login prompt systemctl mask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service getty.target console-getty.service #Generate installtime file record /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME # man pages and documentation find /usr/share/{man,doc,info,gnome/help} \ -type f | xargs /bin/rm # ldconfig rm -rf /etc/ld.so.cache rm -rf /var/cache/ldconfig/* rm -rf /var/cache/yum/* rm -f /tmp/ks-script* rm -f /usr/lib/locale/locale-archive #Setup locale properly localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 # Create repo for systemd-container #cat >/etc/yum.repos.d/systemd.repo < /etc/krb5.conf < /etc/openldap/ldap.conf <