Skip to main content

Fedora Build ACS ACS Override Patch Kernel

Add RPM Fusion

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Install the dependencies to start building your own kernel.

sudo dnf install fedpkg fedora-packager rpmdevtools ncurses-devel pesign fedora-packager fedora-review

Set up your home build directory (if you haven't ever built any RPMs before)

rpmdev-setuptree

Install the kernel source and finish installing dependencies.

koji download-build --arch=src kernel-4.18.5-200.fc28
rpm -Uvh kernel-4.18.5-200.fc28.src.rpm
sudo dnf builddep ~/rpmbuild/SOURCES/kernel.spec
vim ~/rpmbuild/SPECS/kernel.spec

Add the two lines near the top of the spec file.

# Set buildid
%define buildid .acs

# ACS override patch
Patch1000: add-acs-override.patch

Download ACS path

cd ~/rpmbuild/SOURCES/
wget https://git.myhypervisor.ca/dave/fedora-acs-override/raw/master/acs/add-acs-override.patch
sudo dnf builddep kernel.spec

Compile! This takes a long time.

rpmbuild -bb kernel.spec

Install the new packages!

cd ~/rpmbuild/RPMS/x86_64
sudo dnf update *.rpm
sudo dnf clean all
sudo dnf update -y

Create or edit /etc/modprobe.d/local.conf, adding the line below:

install vfio-pci /sbin/vfio-pci-override.sh

Create or edit /etc/dracut.conf.d/local.conf, adding the line below:

add_drivers+="vfio vfio_iommu_type1 vfio_pci vfio_virqfd"
install_items+="/sbin/vfio-pci-override.sh /usr/bin/find /usr/bin/dirname"

Create a file /sbin/vfio-pci-override.sh with permissions 755 (file in this directory of the repo).

Rebuild using dracut

sudo dracut -f --kver `uname -r`