move vbios_dumper into configs
This commit is contained in:
parent
42a017a58b
commit
86b5ce77e6
3 changed files with 19 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
||||||
package internal
|
package configs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -7,15 +7,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/HikariKnight/ls-iommu/pkg/errorcheck"
|
"github.com/HikariKnight/ls-iommu/pkg/errorcheck"
|
||||||
"github.com/HikariKnight/quickpassthrough/internal/configs"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func generateVBIOSDumper(m model) {
|
func GenerateVBIOSDumper(vbios_path string) {
|
||||||
// Get the vbios path
|
|
||||||
m.vbios_path = getIOMMU("-g", "-i", m.gpu_group, "--rom")[0]
|
|
||||||
|
|
||||||
// Get the config directories
|
// Get the config directories
|
||||||
config := configs.GetConfigPaths()
|
config := GetConfig()
|
||||||
|
|
||||||
// Get the program directory
|
// Get the program directory
|
||||||
exe, _ := os.Executable()
|
exe, _ := os.Executable()
|
||||||
|
@ -37,11 +33,11 @@ func generateVBIOSDumper(m model) {
|
||||||
|
|
||||||
vbios_script := fmt.Sprintf(
|
vbios_script := fmt.Sprintf(
|
||||||
vbios_script_template,
|
vbios_script_template,
|
||||||
m.vbios_path,
|
vbios_path,
|
||||||
m.vbios_path,
|
vbios_path,
|
||||||
scriptdir,
|
scriptdir,
|
||||||
config.QUICKEMU,
|
config.Path.QUICKEMU,
|
||||||
m.vbios_path,
|
vbios_path,
|
||||||
)
|
)
|
||||||
|
|
||||||
scriptfile, err := os.Create("utils/dump_vbios.sh")
|
scriptfile, err := os.Create("utils/dump_vbios.sh")
|
|
@ -32,8 +32,11 @@ func (m *model) processSelection() bool {
|
||||||
m.focused++
|
m.focused++
|
||||||
|
|
||||||
case GPU_GROUP:
|
case GPU_GROUP:
|
||||||
|
// Get the vbios path
|
||||||
|
m.vbios_path = getIOMMU("-g", "-i", m.gpu_group, "--rom")[0]
|
||||||
|
|
||||||
// Generate the VBIOS dumper script once the user has selected a GPU
|
// Generate the VBIOS dumper script once the user has selected a GPU
|
||||||
generateVBIOSDumper(*m)
|
configs.GenerateVBIOSDumper(m.vbios_path)
|
||||||
|
|
||||||
// Change focus to the next view
|
// Change focus to the next view
|
||||||
m.focused++
|
m.focused++
|
||||||
|
|
|
@ -73,11 +73,17 @@ func (m model) View() string {
|
||||||
"Passing a VBIOS rom to the card used for passthrough is required for some cards, but not all.\n",
|
"Passing a VBIOS rom to the card used for passthrough is required for some cards, but not all.\n",
|
||||||
"Some cards also requires you to patch your VBIOS romfile, check online if this is neccessary for your card!\n",
|
"Some cards also requires you to patch your VBIOS romfile, check online if this is neccessary for your card!\n",
|
||||||
"The VBIOS will be read from:\n",
|
"The VBIOS will be read from:\n",
|
||||||
"%s\n\n",
|
fmt.Sprintf(
|
||||||
|
"%s\n\n",
|
||||||
|
m.vbios_path,
|
||||||
|
),
|
||||||
"The script to extract the vbios has to be run as sudo and without a displaymanager running for proper dumping!\n",
|
"The script to extract the vbios has to be run as sudo and without a displaymanager running for proper dumping!\n",
|
||||||
"\n",
|
"\n",
|
||||||
"You can run the script with:\n",
|
"You can run the script with:\n",
|
||||||
"%s/utils/dump_vbios.sh",
|
fmt.Sprintf(
|
||||||
|
"%s/utils/dump_vbios.sh",
|
||||||
|
scriptdir,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue