Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Created July 16, 2017 07:26
Show Gist options
  • Select an option

  • Save ruzickap/324985dbe5ddc965cd1c6d21df0c1caf to your computer and use it in GitHub Desktop.

Select an option

Save ruzickap/324985dbe5ddc965cd1c6d21df0c1caf to your computer and use it in GitHub Desktop.
Fedora 26 kickstart file used by lorax livemedia-creator script to create PXE live
#version=DEVEL
# Firewall configuration
firewall --disabled
# Use network installation
url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
# Root password
rootpw --plaintext xxxxxxxx
# Network information
network --bootproto=dhcp --device=link --activate
# System authorization information
auth --enableshadow --passalgo=sha512
# poweroff after installation
shutdown
# Keyboard layouts
keyboard us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --disabled
# System timezone
timezone --ntpservers=ntp.nic.cz --utc Etc/UTC
# System bootloader configuration
bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8"
# Partition clearing information
zerombr
clearpart --all --initlabel --disklabel=msdos
# Disk partitioning information
part / --size 6000 --fstype ext4
repo --name=my-fedora-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
#My
sshkey --username=root "ssh-rsa AAAAB3N...kxZaCiM="
%packages --excludedocs --instLangs=en_US
ethtool
htop
lshw
lsof
mc
nmap
#postfix
screen
strace
tcpdump
telnet
traceroute
policycoreutils # this is needed for livemedia-creator
dracut-live # this is needed for livemedia-creator
selinux-policy-targeted # this is needed for livemedia-creator
%end
%post
(
set -x
#################
# Configuration
#################
echo " * setting up systemd"
echo "DumpCore=no" >> /etc/systemd/system.conf
echo " * setting up journald"
echo "Storage=volatile" >> /etc/systemd/journald.conf
echo "RuntimeMaxUse=15M" >> /etc/systemd/journald.conf
echo "ForwardToSyslog=no" >> /etc/systemd/journald.conf
echo "ForwardToConsole=no" >> /etc/systemd/journald.conf
#################
# Minimize
#################
# Packages to Remove
dnf remove -y audit cracklib-dicts dnf-yum fedora-logos firewalld grubby kbd parted plymouth polkit sssd-client xkeyboard-config
echo " * purge existing SSH host keys"
rm -f /etc/ssh/ssh_host_*key{,.pub}
echo " * remove KMS DRM video drivers"
rm -rf /lib/modules/*/kernel/drivers/gpu/drm /lib/firmware/{amdgpu,radeon}
echo " * remove unused drivers"
rm -rf /lib/modules/*/kernel/{sound,drivers/media,fs/nls}
echo " * compressing cracklib dictionary"
xz -9 /usr/share/cracklib/pw_dict.pwd
echo " * purging images"
rm -rf /usr/share/backgrounds/* /usr/share/kde4/* /usr/share/anaconda/pixmaps/rnotes/*
echo " * truncating various logfiles"
for log in dnf.log dracut.log lastlog; do
truncate -c -s 0 /var/log/${log}
done
echo " * removing trusted CA certificates"
truncate -s0 /usr/share/pki/ca-trust-source/ca-bundle.trust.crt
update-ca-trust
echo " * cleaning up dnf cache"
dnf clean all
# no more python loading after this step
echo " * removing python precompiled *.pyc files"
find /usr/lib64/python*/ /usr/lib/python*/ -name *py[co] -print0 | xargs -0 rm -f
echo " * remove login banner"
rm /etc/issue
) &> /root/ks.out
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment