2021-06-04 21:45:53 +00:00
# __ ____ ____ _____
# ____ / /_ __ __/ / /___ ____ ___ ___ / __ \/ ___/
# / __ \/ __ \/ / / / / / __ \/ __ `__ \/ _ \ / / / /\__ \
# / /_/ / / / / /_/ / / / /_/ / / / / / / __/ / /_/ /___/ /
# / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/
# /_/ /____/
2021-06-04 10:17:31 +00:00
# WHAT ? Kickstart file that bootstraps a minimal fedora 34 server, vanilla.
2021-06-10 14:57:21 +00:00
# 'v' for virtual, 's' for server, 'u' for unmodified (aka vanilla), 'b' for bios, 'd' for development.
2021-06-08 07:19:47 +00:00
2021-06-10 14:57:21 +00:00
# USAGE : Press the `tab` key during POST and apend that after the 'quiet' string :
2021-06-08 07:19:47 +00:00
# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/f34/vsub.cfg
2021-06-03 15:42:11 +00:00
2021-06-10 14:57:21 +00:00
# ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents.
2021-06-03 15:42:11 +00:00
# Bye bye!
2021-06-10 14:57:21 +00:00
# ATTENTION : user accounts are password-protected and passwords are encrypted in the file.
2021-06-04 10:17:31 +00:00
# If you really want to hack it, you can reset the root password of the resulting image with the 'virt-sysprep' tool
2021-06-10 14:57:21 +00:00
# Do something like virt-sysprep --root-password password: -a thenameofyourdiskimage.img.
2021-06-04 10:43:05 +00:00
# Your password must be added after the semicolon ":". See here for more information : https://libguestfs.org/virt-sysprep.1.html
2021-06-03 15:42:11 +00:00
2021-06-10 14:57:21 +00:00
# REQUIRES :
2021-06-04 10:17:31 +00:00
# - Requires a 3GB disk image (tested with QCOW2, may works with most virtio-based storage)
# - Expects a BIOS-based virtual machine (no-EFI support). There will be a kickstart file for that (tm)
# - Tested on the Q35 virtual chipset (5.2), but may works on i440fx virtual chipsets.
# TLDR :
# - This kickstart creates two partitions, vda1 for `/boot` and vda2 for `/`
# - It uses the ext4 filesystem
# - It will populate all the available disk space
# - After the installation, it will install updates
2021-06-04 10:43:05 +00:00
# - When installed in a virtual machine, the vanilla version should create a fully-updated system with 614 packages (`dnf list --installed | wc -l`)
2021-06-03 14:42:04 +00:00
2021-06-03 13:30:39 +00:00
# Originally generated by Anaconda 34.24.9
# Orginally generated by pykickstart v3.32
#version=DEVEL
## INSTALLATION SOURCE ##
2021-06-10 14:57:21 +00:00
## TEST ##
2021-06-03 13:30:39 +00:00
# Configure cdrom as installation method
cdrom
2021-06-04 10:43:05 +00:00
# NEEDS TO BE FIXED - Alternatively, use network installation by commenting out 'cdrom' and uncommenting the following : --> Is it really the case ?
2021-06-03 13:30:39 +00:00
url --url = "http://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os"
## INSTALLATION TYPE ##
# Perform Installation in Graphical Mode
graphical
# Alternatively, start the installation in text mode. -> To be tested
# text
## REPOSITORIES ##
# Add repo and mirror
url --mirrorlist = "https://mirrors.fedoraproject.org/metalink?repo=fedora-34&arch=x86_64"
repo --name = fedora-updates --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f34&arch=x86_64" --cost=0
2021-06-10 14:57:21 +00:00
# Add rpmfusion repositories, which provides extra-packages
2021-06-03 13:30:39 +00:00
repo --name = rpmfusion-free --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-34&arch=x86_64" --includepkgs=rpmfusion-free-release
repo --name = rpmfusion-free-updates --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-34&arch=x86_64" --cost=0
# Uncomment to add-nonfree repositories
# repo --name=rpmfusion-nonfree --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-34&arch=x86_64" --includepkgs=rpmfusion-nonfree-release
# repo --name=rpmfusion-nonfree-updates --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-updates-released-34&arch=x86_64" --cost=0
## USER RELATED ##
# Keyboard layouts -> Doesn't seem to survive a reboot
keyboard fr-ch
# Set the system language to American English
lang en_US.UTF-8
2021-06-04 10:43:05 +00:00
# lang fr_CH.UTF-8 # Pour la Romandie !
2021-06-03 13:30:39 +00:00
2021-06-04 10:43:05 +00:00
# System timezone
timezone Europe/Paris --utc # Pour Paris !
2021-06-03 13:30:39 +00:00
# Set root password and activate the account
rootpw --iscrypted $6$2rA58L/SQu5.xMTb$u8.zqBWE5bK1/N983qDpJEp41yg66GwQ3YVTpsRghVhNiZypWyo2Zq2Qwr2tCM3bt50mKMIgHzbPdtSq9ErPz.
# Create user account
user --name = test --password=$6$wlB.n8fvumAXv3xn$clVIswjLUjb7MZoJ2JHi1zk1zmx5ViQuzbVkLYf70SDan5hdqI0tUkc89nHE8pVnHStO4mcl3c1Tk0WJvCet1. --iscrypted --gecos="test"
## NETWORK RELATED ##
# Configure Firewall
firewall --enabled
# Configure Network Interfaces
network --onboot = yes --bootproto=dhcp --hostname=f34-minimal
# Run the Setup Agent on first boot
firstboot --enable
2021-06-04 10:43:05 +00:00
## SYSTEM RELATED
2021-06-03 13:30:39 +00:00
2021-06-04 10:43:05 +00:00
# Services to enable/disable ## To do
2021-06-03 13:30:39 +00:00
# services --disabled=mlocate-updatedb,mlocate-updatedb.timer,geoclue,avahi-daemon
## DISK RELATED ##
# Only use disk labelled as vda
ignoredisk --only-use = vda
# System bootloader configuration
bootloader --location = mbr
2021-06-10 14:57:21 +00:00
# WARNING : Dangerous command ! Will clear the Master Boot Record
2021-06-03 13:30:39 +00:00
zerombr
# Partition clearing information
clearpart --all --initlabel --drives = vda
2021-06-10 14:57:21 +00:00
# Disk partitioning information.
# Will create a boot partition of 350 MiB on disk vda using the ext4 filesystem. The remaining space will be used for root.
2021-06-03 14:37:16 +00:00
part /boot --fstype = "ext4" --ondisk=vda --size=350 --label=boot
part / --fstype = "ext4" --ondisk=vda --grow --label=system
2021-06-03 13:30:39 +00:00
## SOFTWARE ##
2021-06-10 14:57:21 +00:00
# Install packages for the server environment. 'Core' and 'Base' are always selected
2021-06-03 13:30:39 +00:00
%packages
@^server-product-environment
%end
2021-06-08 07:19:47 +00:00
## POST-INSTALLATION SCRIPTS ##
2021-06-03 13:30:39 +00:00
## Start of the %post section with logging into /root/ks-post.log
%post --log = /root/ks-post.log
2021-06-04 10:17:31 +00:00
## Set keymap to ch-fr. ## Doesn't survive a reboot. Or only touches the console
2021-06-03 13:30:39 +00:00
#localectl set-keymap ch-fr
2021-06-04 10:17:31 +00:00
# Set new hostname. ## Doesn't survive a reboot
2021-06-03 13:30:39 +00:00
# hostnamectl set-hostname kickstarted-fedora
# Update the system
dnf update -y
2021-06-08 07:19:47 +00:00
## We also need to install a qemu guest agent, to allow the host to better interact with the guest
2021-06-04 10:20:41 +00:00
dnf install -y spice-vdagent qemu-guest-agent
2021-06-03 13:30:39 +00:00
2021-06-04 16:43:58 +00:00
# set the GRUB_TIMEOUT countdown to 1 instead of 5 seconds.
sed -i 's/5/1/' /etc/default/grub
2021-06-10 14:57:21 +00:00
# Update grub
2021-06-04 16:43:58 +00:00
grub2-mkconfig -o /boot/grub2/grub.cfg
2021-06-03 13:30:39 +00:00
2021-06-04 10:17:31 +00:00
## Reboot the installer (doesn't work (tm))
2021-06-03 13:30:39 +00:00
reboot
## End of the %post section
%end