smooge / centos / kickstarts

Forked from centos/kickstarts 5 years ago
Clone
Blob Blame History Raw
# This is a minimal CentOS kickstart designed for and ISO.
# To use this kickstart, run the following command
#
# README: Todo put in how to make this.

#version=RHEL8

# License Agreement
eula --agreed
# Keyboard 
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# System timezone (No NTP since maybe no network)
timezone --isUtc --nontp Etc/UTC  --nontp
# System authorization information
auth --enableshadow --passalgo=sha512
# Root password
rootpw --lock --iscrypted locked

# Selinux Policy
selinux --enforcing
# System Firewall
firewall --enabled --service=mdns
# Service Setup
services --enabled=sshd,NetworkManager


# Repositories
url --url=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/kickstart/
repo --name="AppStream" --baseurl=http://mirror.centos.org/centos-8/8/AppStream/x86_64/kickstart/
repo --name="PowerTools" --baseurl=http://mirror.centos.org/centos-8/8/PowerTools/x86_64/kickstart/


# Disk layout
zerombr
clearpart --all --initlabel --disklabel=msdos
# Disk partitioning information
part / --fstype="ext4" --size=1700
part swap --size=512
# Set up bootloader
bootloader --timeout=10  --location=mbr
# Network Layout
network --bootproto=dhcp --device=link --activate

# Setup firstboot
firstboot --reconfig

# Shutodown versus reboot on install
shutdown

%packages
@core
# Below is taken from RHEL-minimal ks in lorax.
kernel

# Make sure that DNF doesn't pull in debug kernel to satisfy kmod()
# requires dracut needs these included
kernel-modules
kernel-modules-extra

dracut-live
dracut-network
grub2
grub2-efi
memtest86+
shim
syslinux
tar
centos-logos
anaconda-tui
tmux

%end

%post

# enable tmpfs for /tmp
systemctl enable tmp.mount

# make it so that we don't do writing to the overlay for things which
# are just tmpdirs/caches
# note https://bugzilla.redhat.com/show_bug.cgi?id=1135475
cat >> /etc/fstab << EOF
vartmp   /var/tmp    tmpfs   defaults   0  0
EOF

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
echo "Packages within this disk image"
rpm -qa | tee /root/RPM-LIST
# Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db*

# remove random seed, the newly installed instance should make it's own
rm -f /var/lib/systemd/random-seed

# Remove machine-id on pre generated images
rm -f /etc/machine-id
touch /etc/machine-id

# go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb

# make sure there aren't core files lying around
rm -f /core*

# Remove the rescue kernel and image to save space
# Installation will recreate these on the target
rm -f /boot/*-rescue*

# setup systemd to boot to the right runlevel
echo -n "Setting default runlevel to anaconda text mode"
rm -f /etc/systemd/system/default.target
ln -s /lib/systemd/system/anaconda.target /etc/systemd/system/default.target
echo .



%end