migrate predevicecommands to initrd systemd service
This commit is contained in:
@@ -17,9 +17,23 @@
|
||||
boot.extraModprobeConfig = ''
|
||||
options vfio-pci ids=10de:1b81,10de:10f0
|
||||
'';
|
||||
boot.initrd.preDeviceCommands = ''
|
||||
modprobe vfio-pci
|
||||
'';
|
||||
boot.initrd.systemd = {
|
||||
enable = true;
|
||||
services.initrd-vfio-pci-nvidia = {
|
||||
|
||||
description = "vfio-pci predevice init";
|
||||
wantedBy = [ "initrd.target" ];
|
||||
# Match 'preDeviceCommands' by running early
|
||||
before = [ "sysroot.mount" ];
|
||||
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
# Place your original shell commands here
|
||||
script = ''
|
||||
modprobe vfio-pci
|
||||
'';
|
||||
}
|
||||
# # EARLY and deterministic binding
|
||||
# boot.initrd.preDeviceCommands = ''
|
||||
# echo 0000:05:00.0 > /sys/bus/pci/drivers/vfio-pci/bind
|
||||
|
||||
Reference in New Issue
Block a user