How to modify initramfs and dracut in Universal Blue

Adding modprobe files to initramfs

Should you need to add files to initramfs (lets say a modprobe file) then you will need to add that as a dracut.conf file.

For this example we will use /etc/modprobe.d/hid_apple.conf as the modprobe file we want to add, this contains

options hid_apple fnmode=0

To get this to work, we need it included in initramfs so we will make a dracut config file for it /etc/dracut.conf.d/hid_apple.conf
This file has the content

install_items+=" /etc/modprobe.d/hid_apple.conf "

Once both those files are made we can now issue a rebuild with
rpm-ostree initramfs --enable
and reboot

Enabling kernel modules through dracut

NOTE: If you need to add a new driver to the system, then you will need to make a custom image, this is about enabling drivers/modules that are disabled by default

Enabling kernel modules that exists on the system image, you will need to make a dracut.conf file in /etc/dracut.conf.d/.
For this example we will use our /etc/dracut.conf.d/vfio.conf file generated by
ujust setup-virtualization vfio-on on bazzite

add_drivers+=" vfio vfio_iommu_type1 vfio-pci "

Once we save that file, you can issue an initramfs rebuild with
rpm-ostree initramfs --enable

Do not rebuild using the dracut command directly when using an atomic system!