make generating the module list its own function and fix minor things
This commit is contained in:
parent
8312d8853c
commit
e93d215669
5 changed files with 47 additions and 25 deletions
|
@ -2,6 +2,7 @@ package configs
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
|
@ -21,6 +22,15 @@ func Set_Modprobe(gpu_IDs []string) {
|
|||
vfio_pci_options = append(vfio_pci_options, "disable_vga=1")
|
||||
}
|
||||
|
||||
// Put our config file path into a string
|
||||
conffile := fmt.Sprintf("%s/vfio.conf", config.Path.MODPROBE)
|
||||
|
||||
// If the file exists
|
||||
if fileio.FileExist(conffile) {
|
||||
// Delete the old file
|
||||
os.Remove(conffile)
|
||||
}
|
||||
|
||||
// Write the vfio.conf file to our modprobe config
|
||||
fileio.AppendContent(
|
||||
fmt.Sprint(
|
||||
|
@ -39,9 +49,6 @@ func Set_Modprobe(gpu_IDs []string) {
|
|||
"softdep amdgpu pre: vfio vfio_pci\n",
|
||||
"softdep radeon pre: vfio vfio_pci\n",
|
||||
),
|
||||
fmt.Sprintf(
|
||||
"%s/vfio.conf",
|
||||
config.Path.MODPROBE,
|
||||
),
|
||||
conffile,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue