migrate predevicecommands to initrd systemd service
This commit is contained in:
@@ -17,9 +17,23 @@
|
|||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
options vfio-pci ids=10de:1b81,10de:10f0
|
options vfio-pci ids=10de:1b81,10de:10f0
|
||||||
'';
|
'';
|
||||||
boot.initrd.preDeviceCommands = ''
|
boot.initrd.systemd = {
|
||||||
modprobe vfio-pci
|
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
|
# # EARLY and deterministic binding
|
||||||
# boot.initrd.preDeviceCommands = ''
|
# boot.initrd.preDeviceCommands = ''
|
||||||
# echo 0000:05:00.0 > /sys/bus/pci/drivers/vfio-pci/bind
|
# echo 0000:05:00.0 > /sys/bus/pci/drivers/vfio-pci/bind
|
||||||
|
|||||||
Reference in New Issue
Block a user