Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


fedora_20_on_apu_-_kickstart_file

PC Engines APU - Fedora 20 KickStart

  • I Used a 16GB mSATA SSD, all data on disk will be cleared!
  • Add your own password hash below at PUTYOURHASHHERE. Generate it with:
    grub-crypt --sha-512

tftp config

serial 0 115200
default fedora
prompt 0
timeout 0

label fedora
  kernel http://repo.mgmt.yourdomain.com/fedora20/fedora-base/images/pxeboot/vmlinuz
  append initrd=http://repo.mgmt.yourdomain.com/fedora20/fedora-base/images/pxeboot/initrd.img ks.device=bootif ip=dhcp ks=http://pxe.mgmt.yourdomain.com/apu-fedora.ks console=ttyS0,115200

KickStart file

####
#### PC Engines APU KickStart installation
####
install
skipx
text

# Base repo
url --url=http://repo/fedora20/fedora-base/
# Configure updates repo
repo --name="Fedora-updates"  --baseurl=http://repo/fedora20/fedora-updates/

network --onboot yes --bootproto dhcp
lang en_US.UTF-8
keyboard --vckeymap=us --xlayouts='us','us'
rootpw --iscrypted PUTYOURHASHHERE
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc Europe/Amsterdam

# Set serial console and change disk elevator to noop for SSD.
bootloader --location=mbr --driveorder=sda --append="console=tty0 console=ttyS0,115200 elevator=noop rd_NO_PLYMOUTH"

# Any disks whose formatting is unrecognized are initialized.
zerombr

# Erases all partitions from the system.
clearpart --all --drives=sda --initlabel

# Initialize boot partition.
part /boot --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60" --size=512 --asprimary

# Create LVM pv and vg.
part pv.01 --size=1000 --grow --asprimary
volgroup vg pv.01

# Create lv's, set discard, noatime and commit time. Leave some space left in the VG for later use.
logvol swap  --vgname=vg --size=512  --name=lv_swap --fstype=swap 
logvol /     --vgname=vg --size=4096 --name=lv_root --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60"
logvol /var  --vgname=vg --size=4096 --name=lv_var  --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60"
logvol /home --vgname=vg --size=512  --name=lv_home --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60"

# Create non administrative user
user --name=benst --homedir=/home/benst --password=PUTYOURHASHHERE --iscrypted

# Reboot after installation.
reboot

# Install minimal, exclude @Base, exclude documentation
%packages --nobase --excludedocs
@Core           #default
bind-utils      #dig, host, nslookup
openssh-clients #ssh client, key agent, sftp, scp
nc              #nc (netcat)
%end

%post
# Disable SSH root login
/bin/sed -i.bak 's/#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config

# Mount /tmp as tmpfs.
echo "tmpfs /tmp tmpfs size=64m 0 0" >> /etc/fstab

# Enable LVM to issue discards.
/bin/sed -i.bak 's/issue_discards = 0/issue_discards = 1/g' /etc/lvm/lvm.conf

# Reduce swappiness.
echo "vm.swappiness=1" >> /etc/sysctl.d/swappiness.conf
echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.d/swappiness.conf

# Set chassis name and icon
/bin/hostnamectl set-chassis "server"

exit 0
%end
fedora_20_on_apu_-_kickstart_file.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1