mirror of
https://github.com/HikariKnight/quickpassthrough
synced 2025-06-28 05:58:00 +02:00
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
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/HikariKnight/ls-iommu/pkg/errorcheck"
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/uname"
|
||||
"github.com/klauspost/cpuid/v2"
|
||||
)
|
||||
|
||||
|
@ -129,7 +130,25 @@ func InitConfigs() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate the kernel arguments
|
||||
set_Cmdline()
|
||||
}
|
||||
|
||||
func vfio_modules() []string {
|
||||
// Make the list of modules
|
||||
modules := []string{
|
||||
"vfio_pci",
|
||||
"vfio",
|
||||
"vfio_iommu_type1",
|
||||
}
|
||||
|
||||
// If we are on a kernel older than 6.2
|
||||
sysinfo := uname.New()
|
||||
kernel_re := regexp.MustCompile(`^(6\.1|6\.0|[1-5]\.)`)
|
||||
if kernel_re.MatchString(sysinfo.Kernel) {
|
||||
// Include the vfio_virqfd module
|
||||
// NOTE: this driver was merged into the vfio module in 6.2
|
||||
modules = append(modules, "vfio_virqfd")
|
||||
}
|
||||
|
||||
// Return the modules
|
||||
return modules
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue