refactor intel-based hypervisor ks file

This commit is contained in:
lukas 2021-07-22 16:25:20 +02:00
parent 4cc06eaeb6
commit b8aba6d850

View File

@ -5,30 +5,23 @@
# / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/
# /_/ /____/
# WHAT ? This Kickstart file bootstraps a minimal GNOME-based desktop-oriented virtual machine.
# 'v' for virtual machine, 'e' for efi, 'm' for minimal, 'd' for desktop, 'h' for hypervisor, 'i' for intel', 'd' for development only.
# What ? This Kickstart file bootstraps a minimal GNOME-based desktop-oriented virtual machine optimized for systems with Intel CPUs.
# 'v' for virtual machine, 'h' for hypervisor', 'i' for intel, 'd' for desktop, 'm' for minimal, 'd' for development only.
# USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string :
# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leafs/vemdhid.cfg
# A shorter URL can also be used :
# inst.ks=https://url.phyllo.me/vemdhid
# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhidmd.cfg
# ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents.
# Bye bye!
%include https://git.phyllo.me/home/kickstart/raw/branch/master/leafs/vemdhd.cfg # Includes vemdhd.cfg, a minimal desktop-oriented nested-host ks file
%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhdmd.cfg # Includes dhd.cfg, a minimal desktop-oriented nested-host ks file
%post # Beginning of %post section
# Load kernel modules in grub. Add `intel_iommu=on intel_iommu=pt` for Intel processors,
sed -i 's/\(quiet\)/\1 intel_iommu=on/i' /etc/default/grub
sed -i 's/\(intel_iommu=on\)/\1 intel_iommu=pt/i' /etc/default/grub
sed -i 's/\(intel_iommu=pt\)/\1 i915.enable_gvt=1/i' /etc/default/grub
# Load specific kernel modules kvmgt and vfio-mdev, for Intel GVT-g and Nvidia
echo "kvmgt" > /etc/modules-load.d/kvmgt.conf
echo "vfio-mdev" > /etc/modules-load.d/vfio-mdev.conf
sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci i915.enable_gvt=1/i' /etc/default/grub
echo "kvmgt" > /etc/modules-load.d/kvmgt.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel GVT-g and Nvidia
echo "vfio-mdev" > /etc/modules-load.d/vfio-mdev.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel GVT-g and Nvidia
dracut --force # Regenerate initramfs
grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub