# __ ____ ____ _____ # ____ / /_ __ __/ / /___ ____ ___ ___ / __ \/ ___/ # / __ \/ __ \/ / / / / / __ \/ __ `__ \/ _ \ / / / /\__ \ # / /_/ / / / / /_/ / / / /_/ / / / / / / __/ / /_/ /___/ / # / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/ # /_/ /____/ # What ? This kickstart file configures an hypervisor for AMD (tm) CPUs # 'b' for basic building block, 'a' for amd, 'm' for minimal, 'd' for development only. %post --nochroot # Beginning of %post section. Those commands are executed outside the chroot environment sed -i 's/\(quiet\)/\1 amd_iommu=on amd_iommu=pt rd.driver.pre=vfio-pci/i' /etc/default/grub # Load kernel modules in grub. # Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd echo "vfio" > /etc/modules-load.d/vfio.conf echo "vfio-pci" > /etc/modules-load.d/vfio-pci.conf echo "vfio_iommu_type1" > /etc/modules-load.d/vfio_iommu_type1.conf echo "vfio_virqfd" > /etc/modules-load.d/vfio_virqfd.conf echo "options kvm_amd nested=1" >> /etc/modprobe.d/kvm.conf # Add support for nested-virtualization dracut --add-drivers " vfio vfio-pci vfio_iommu_type1 vfio_virqfd " --force # Instruct dracut to load the vfio drivers dracut --force # Regenerate initramfs dracut --force # Regenerate initramfs. grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub %end # End of the %post section