2021-11-04 12:09:12 +00:00
# __ ____ ____ _____
# ____ / /_ __ __/ / /___ ____ ___ ___ / __ \/ ___/
# / __ \/ __ \/ / / / / / __ \/ __ `__ \/ _ \ / / / /\__ \
# / /_/ / / / / /_/ / / / /_/ / / / / / / __/ / /_/ /___/ /
# / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/
# /_/ /____/
# What ? This kickstart file provides a basic, generic building block to build a virtualization host.
2022-01-11 13:49:58 +00:00
services --enabled = "NetworkManager,libvirtd" # Without libvirtd here, it appears it won't automatically start
2021-11-26 15:17:13 +00:00
2021-11-04 12:09:12 +00:00
%packages --exclude-weakdeps # Beginning of the packages section. Does not include weak dependencies.
qemu-kvm
libvirt
libvirt-daemon-config-network
libvirt-daemon-kvm
virt-install
virt-top
2022-01-11 13:49:58 +00:00
libguestfs-tools # Complementary tools useful for interacting with vith guest systems. Could probablby be removed for production-use
python3-libguestfs # Complementary tools useful for interacting with vith guest systems. Could probablby be removed for production-use
guestfs-tools # Complementary tools useful for interacting with vith guest systems. Could probablby be removed for production-use
2021-11-04 12:09:12 +00:00
%end # End of the packages section
2022-01-03 17:01:34 +00:00
%post --nochroot --log = /mnt/sysimage/opt/base-hypervisor.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting
2021-11-04 12:09:12 +00:00
2021-12-12 17:23:28 +00:00
# Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd
echo "vfio" > /mnt/sysimage/etc/modules-load.d/vfio.conf
echo "vfio-pci" > /mnt/sysimage/etc/modules-load.d/vfio-pci.conf
echo "vfio_iommu_type1" > /mnt/sysimage/etc/modules-load.d/vfio_iommu_type1.conf
echo "vfio_virqfd" > /mnt/sysimage/etc/modules-load.d/vfio_virqfd.conf
2021-11-04 12:09:12 +00:00
mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images
2022-01-03 17:01:34 +00:00
wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso and store it to the newly created iso directory
2021-11-04 12:09:12 +00:00
2021-11-08 16:10:11 +00:00
# fetch custom script and make it executable
2022-01-11 13:49:58 +00:00
wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-user-vms.sh -P /mnt/sysimage/usr/sbin/
2021-12-12 17:23:28 +00:00
chmod +x /mnt/sysimage/usr/sbin/create-user-vms.sh
2021-11-08 16:10:11 +00:00
# fetch custom script and make it executable
2022-01-11 13:49:58 +00:00
wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-system-vms.sh -P /mnt/sysimage/usr/sbin/
chmod +x /mnt/sysimage/usr/sbin/create-system-vms.sh
# fetch custom script and make it executable
wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/
2021-11-08 16:10:11 +00:00
chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh
2021-11-07 17:48:01 +00:00
%end # End of the %post section