diff --git a/leaves/bhamd.cfg b/leaves/bhamd.cfg index 45db3ed..11a1fd4 100644 --- a/leaves/bhamd.cfg +++ b/leaves/bhamd.cfg @@ -8,22 +8,21 @@ # 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 --log=/mnt/sysimage/root/bhamd-post.log # Beginning of %post section. Those commands are executed outside the chroot environment +%post --nochroot --log=/mnt/sysimage/root/bhamd.log # 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. +sed -i 's/\(quiet\)/\1 amd_iommu=on amd_iommu=pt rd.driver.pre=vfio-pci/i' /mnt/sysimage/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 "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 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 +grub2-mkconfig -o /mnt/sysimage/boot/grub2/grub.cfg # Update grub. Does it fail ? /usr/sbin/grub2-probe: error: failed to get canonical path of `LiveOS_rootfs'. %end # End of the %post section \ No newline at end of file diff --git a/leaves/bhimd.cfg b/leaves/bhimd.cfg index be03b1b..0082137 100644 --- a/leaves/bhimd.cfg +++ b/leaves/bhimd.cfg @@ -8,23 +8,27 @@ # What ? This kickstart file configures an hypervisor for Intel(tm) CPUs and Intel(tm) graphic cards # 'b' for basic building block, 'h' for hypervisor', 'i' for intel, 'm' for minimal, 'd' for development only. -%post --nochroot --log=/mnt/sysimage/root/bhimd-post.log # Beginning of %post section. Those commands are executed outside the chroot environment +%post --nochroot --log=/mnt/sysimage/root/bhimd.log # Beginning of %post section. Those commands are executed outside the chroot environment -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. +sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci i915.enable_gvt=1/i' /mnt/sysimage/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 "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) +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 +echo "kvmgt" > /mnt/sysimage/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" > /mnt/sysimage/etc/modules-load.d/vfio-mdev.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel (tm) GVT-g and Nvidia (tm) -echo "options kvm_intel nested=1" >> /etc/modprobe.d/kvm.conf # Add support for nested-virtualization +echo "options kvm_intel nested=1" >> /mnt/sysimage/etc/modprobe.d/kvm.conf # Add support for nested-virtualization dracut --add-drivers " vfio vfio-pci vfio_iommu_type1 vfio_virqfd vfio-mdev kvmgt " --force # Instruct dracut to load the vfio drivers dracut --force # Regenerate initramfs +# Doesn't seem to work +# dracut: Cannot find /usr/lib/dracut/dracut-init.sh. +# dracut: Are you running from a git checkout? +# dracut: Try passing -l as an argument to /mnt/sysimage/usr/bin/dracut -grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub +grub2-mkconfig -o /mnt/sysimage/boot/grub2/grub.cfg # Update grub. Does it fail ? /usr/sbin/grub2-probe: error: failed to get canonical path of `LiveOS_rootfs'. %end # End of the %post section \ No newline at end of file