mirror of
https://github.com/HikariKnight/quickpassthrough.git
synced 2025-06-03 16:48:39 -04:00
add dracut support and make it possible to change your video disable choice
This commit is contained in:
parent
b4abc350e0
commit
18d9d928e5
3 changed files with 50 additions and 8 deletions
17
internal/configs/config_dracut.go
Normal file
17
internal/configs/config_dracut.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package configs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
)
|
||||
|
||||
func Set_Dracut() {
|
||||
config := GetConfig()
|
||||
|
||||
// Write the dracut config file
|
||||
fileio.AppendContent("add_drivers+=\" vfio_pci vfio vfio_iommu_type1 vfio_virqfd \"\n", fmt.Sprintf("%s/vfio.conf", config.Path.DRACUT))
|
||||
|
||||
// Add to our kernel arguments file that vfio_pci should load early (dracut does this using kernel arguments)
|
||||
fileio.AppendContent(" rd.driver.pre=vfio_pci", config.Path.CMDLINE)
|
||||
}
|
|
@ -1,11 +1,20 @@
|
|||
package configs
|
||||
|
||||
import "github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
func DisableVFIOVideo() {
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
)
|
||||
|
||||
func DisableVFIOVideo(i int) {
|
||||
// Get the config
|
||||
config := GetConfig()
|
||||
|
||||
// Add to the kernel arguments that we want to disable VFIO video output on the host
|
||||
fileio.AppendContent(" vfio_pci.disable_vga=1", config.Path.CMDLINE)
|
||||
fileio.AppendContent(
|
||||
fmt.Sprintf(
|
||||
" vfio_pci.disable_vga=%v", i,
|
||||
),
|
||||
config.Path.CMDLINE,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue