2021-08-18 09:50:28 +00:00
|
|
|
# __ ____ ____ _____
|
|
|
|
# ____ / /_ __ __/ / /___ ____ ___ ___ / __ \/ ___/
|
|
|
|
# / __ \/ __ \/ / / / / / __ \/ __ `__ \/ _ \ / / / /\__ \
|
|
|
|
# / /_/ / / / / /_/ / / / /_/ / / / / / / __/ / /_/ /___/ /
|
|
|
|
# / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/
|
|
|
|
# /_/ /____/
|
|
|
|
|
2021-08-19 10:43:31 +00:00
|
|
|
# What ? This kickstart file configures an hypervisor for Intel(tm) CPUs and Intel(tm) graphic cards
|
2021-08-18 09:50:28 +00:00
|
|
|
# 'b' for basic building block, 'h' for hypervisor', 'i' for intel, 'm' for minimal, 'd' for development only.
|
|
|
|
|
2021-08-19 09:59:29 +00:00
|
|
|
%post --nochroot # Beginning of %post section. Those commands are executed outside the chroot environment
|
2021-08-18 09:50:28 +00:00
|
|
|
|
|
|
|
sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci i915.enable_gvt=1/i' /etc/default/grub # Load kernel modules in grub.
|
2021-08-19 08:19:00 +00:00
|
|
|
|
|
|
|
# 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
|
2021-08-18 13:01:51 +00:00
|
|
|
echo "kvmgt" > /etc/modules-load.d/kvmgt.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel (tm) GVT-g and Nvidia (tm)
|
|
|
|
echo "vfio-mdev" > /etc/modules-load.d/vfio-mdev.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel (tm) GVT-g and Nvidia (tm)
|
2021-08-18 09:50:28 +00:00
|
|
|
|
2021-08-19 13:05:46 +00:00
|
|
|
echo "options kvm_intel nested=1" >> /etc/modprobe.d/kvm.conf # Add support for nested-virtualization
|
|
|
|
|
2021-08-19 08:19:00 +00:00
|
|
|
dracut --add-drivers " vfio vfio-pci vfio_iommu_type1 vfio_virqfd vfio-mdev kvmgt " --force # Instruct dracut to load the vfio drivers
|
2021-08-18 09:50:28 +00:00
|
|
|
dracut --force # Regenerate initramfs
|
2021-08-19 08:19:00 +00:00
|
|
|
|
2021-08-18 09:50:28 +00:00
|
|
|
grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub
|
|
|
|
|
|
|
|
%end # End of the %post section
|