smooge / centos / kickstarts

Forked from centos/kickstarts 4 years ago
Clone

Blame CentOS-8-Minimal.ks

9d489c
# This is a minimal CentOS kickstart designed for and ISO.
9d489c
# To use this kickstart, run the following command
9d489c
#
9d489c
# README: Todo put in how to make this.
9d489c
9d489c
#version=RHEL8
b8c88f
9d489c
# License Agreement
9d489c
eula --agreed
9d489c
# Keyboard 
9d489c
keyboard --vckeymap=us --xlayouts='us'
9d489c
# System language
9d489c
lang en_US.UTF-8
9d489c
# System timezone (No NTP since maybe no network)
9d489c
timezone --isUtc --nontp Etc/UTC  --nontp
9d489c
# System authorization information
9d489c
auth --enableshadow --passalgo=sha512
9d489c
# Root password
9d489c
rootpw --lock --iscrypted locked
b8c88f
9d489c
# Selinux Policy
9d489c
selinux --enforcing
9d489c
# System Firewall
9d489c
firewall --enabled --service=mdns
9d489c
# Service Setup
b8c88f
services --enabled=sshd,NetworkManager
9d489c
9d489c
9d489c
# Repositories
b8c88f
url --url=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/kickstart/
9d489c
repo --name="AppStream" --baseurl=http://mirror.centos.org/centos-8/8/AppStream/x86_64/kickstart/
9d489c
repo --name="PowerTools" --baseurl=http://mirror.centos.org/centos-8/8/PowerTools/x86_64/kickstart/
9d489c
b8c88f
9d489c
# Disk layout
9d489c
zerombr
9d489c
clearpart --all --initlabel --disklabel=msdos
b8c88f
# Disk partitioning information
b8c88f
part / --fstype="ext4" --size=1700
b8c88f
part swap --size=512
b8c88f
# Set up bootloader
b8c88f
bootloader --timeout=10  --location=mbr
9d489c
# Network Layout
9d489c
network --bootproto=dhcp --device=link --activate
9d489c
9d489c
# Setup firstboot
9d489c
firstboot --reconfig
9d489c
9d489c
# Shutodown versus reboot on install
9d489c
shutdown
9d489c
9d489c
%packages
9d489c
@core
b8c88f
# Below is taken from RHEL-minimal ks in lorax.
b8c88f
kernel
b8c88f
b8c88f
# Make sure that DNF doesn't pull in debug kernel to satisfy kmod()
b8c88f
# requires dracut needs these included
b8c88f
kernel-modules
b8c88f
kernel-modules-extra
b8c88f
b8c88f
dracut-live
b8c88f
dracut-network
b8c88f
grub2
b8c88f
grub2-efi
b8c88f
memtest86+
b8c88f
shim
b8c88f
syslinux
b8c88f
tar
b8c88f
centos-logos
b8c88f
anaconda-tui
b8c88f
tmux
b8c88f
9d489c
%end
9d489c
9d489c
%post
9d489c
b8c88f
# enable tmpfs for /tmp
b8c88f
systemctl enable tmp.mount
b8c88f
b8c88f
# make it so that we don't do writing to the overlay for things which
b8c88f
# are just tmpdirs/caches
b8c88f
# note https://bugzilla.redhat.com/show_bug.cgi?id=1135475
b8c88f
cat >> /etc/fstab << EOF
b8c88f
vartmp   /var/tmp    tmpfs   defaults   0  0
b8c88f
EOF
b8c88f
9d489c
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
9d489c
echo "Packages within this disk image"
9d489c
rpm -qa | tee /root/RPM-LIST
9d489c
# Note that running rpm recreates the rpm db files which aren't needed or wanted
9d489c
rm -f /var/lib/rpm/__db*
9d489c
9d489c
# remove random seed, the newly installed instance should make it's own
9d489c
rm -f /var/lib/systemd/random-seed
9d489c
9d489c
# Remove machine-id on pre generated images
9d489c
rm -f /etc/machine-id
9d489c
touch /etc/machine-id
9d489c
b8c88f
# go ahead and pre-make the man -k cache (#455968)
b8c88f
/usr/bin/mandb
b8c88f
b8c88f
# make sure there aren't core files lying around
b8c88f
rm -f /core*
b8c88f
b8c88f
# Remove the rescue kernel and image to save space
b8c88f
# Installation will recreate these on the target
b8c88f
rm -f /boot/*-rescue*
b8c88f
9d489c
# setup systemd to boot to the right runlevel
b8c88f
echo -n "Setting default runlevel to anaconda text mode"
9d489c
rm -f /etc/systemd/system/default.target
b8c88f
ln -s /lib/systemd/system/anaconda.target /etc/systemd/system/default.target
9d489c
echo .
9d489c
b8c88f
b8c88f
9d489c
%end