|
#version=Fedora Linux 38 |
|
#documentation: https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/appendixes/Kickstart_Syntax_Reference/ |
|
|
|
# PRE-INSTALLATION SCRIPT |
|
%pre --interpreter=/usr/bin/bash --log=/root/anaconda-ks-pre.log |
|
%end |
|
|
|
# INSTALL USING TEXT MODE |
|
text |
|
|
|
# KEYBOARDS, LANGUAGES, TIMEZONE |
|
keyboard --vckeymap=us --xlayouts=us |
|
lang en_US.UTF-8 |
|
timezone Etc/UTC --utc |
|
|
|
# NETWORK, SELINUX, FIREWALL |
|
# Hostname must be separate from link config, in either 'host' or 'host.domain.tld' form. |
|
network --hostname='host.domain.tld' |
|
network --device=link --bootproto=dhcp --onboot=on --noipv6 --activate |
|
selinux --enforcing |
|
firewall --enabled --ssh |
|
|
|
# DISKS, PARTITIONS, VOLUME GROUPS, LOGICAL VOLUMES |
|
# Install target is usually sda, vda, or nvme0n1; adjust all references below accordingly. |
|
# The EFI & /boot partitions are explicitly set here, but some people just use `reqpart`. |
|
ignoredisk --only-use=vda |
|
zerombr |
|
clearpart --all --initlabel --disklabel=gpt |
|
bootloader --location=mbr --boot-drive=vda --append='crashkernel=auto' |
|
part /boot/efi --label=FIRMWARE --size=1024 --asprimary --fstype=efi |
|
part /boot --label=BOOT --size=1024 --asprimary --fstype=ext4 |
|
part pv.01 --label=VOLUMES --size=1024 --grow --asprimary |
|
volgroup volgroup0 pv.01 |
|
logvol swap --label=SWAP --size=8192 --vgname=volgroup0 --name=swap |
|
logvol / --label=ROOT --size=1024 --grow --vgname=volgroup0 --name=root --fstype=xfs |
|
|
|
# INSTALLATION SOURCE, EXTRA REPOSITOROIES, PACKAGE GROUPS, PACKAGES |
|
url --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch" |
|
repo --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-cisco-openh264-$releasever&arch=$basearch" --name=fedora-cisco-openh264 --cost=0 |
|
repo --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-modular-$releasever&arch=$basearch" --name=fedora-modular --cost=0 |
|
repo --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch" --name=updates --cost=0 |
|
repo --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-modular-f$releasever&arch=$basearch" --name=updates-modular --cost=0 |
|
# Remove @guest-agents if this is not a VM. |
|
%packages --retries=5 --timeout=20 --inst-langs=en |
|
@^minimal-environment |
|
@guest-agents |
|
kernel-devel |
|
openssh-server |
|
%end |
|
|
|
# GROUPS, USERS, ENABLE SSH, FINISH INSTALL |
|
rootpw --lock |
|
# Create user 'myuser' and group 'mygroup' (with GID 3000), make it myuser's primary group, and add myuser to administrative 'wheel' group. |
|
user --name=myuser --password='1st-password-change-asap!' --plaintext --gecos='Michael Y. User' --groups='wheel,mygroup(3000)' --gid=3000 |
|
sshkey --username=myuser 'publickeygoeshere' |
|
services --enabled='sshd.service' |
|
reboot --eject |
|
|
|
# ENABLE EMERGENCY KERNEL DUMPS FOR DEBUGGING |
|
%addon com_redhat_kdump --reserve-mb=auto --enable |
|
%end |
|
|
|
# POST-INSTALLATION SCRIPT |
|
%post --interpreter=/usr/bin/bash --log=/root/anaconda-ks-post.log --erroronfail |
|
# Enable CodeReady Builder repo (requires `epel-release` package). |
|
/usr/bin/dnf config-manager --set-enabled crb |
|
%end |