Add documentation

This commit is contained in:
HikariKnight 2023-04-10 14:36:57 +02:00
parent 639d056abe
commit 798427280b
6 changed files with 11 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
)
// This function writes a dracut configuration file for /etc/dracut.conf.d/
func Set_Dracut() {
config := GetConfig()

View file

@ -10,6 +10,7 @@ import (
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
)
// This function copies the content of /etc/mkinitcpio.conf to the config folder and does an inline replace/insert on the MODULES=() line
func Set_Mkinitcpio() {
// Get the config struct
config := GetConfig()

View file

@ -9,6 +9,7 @@ import (
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
)
// This function generates a modprobe file for /etc/modprobe.d/
func Set_Modprobe(gpu_IDs []string) {
// Get the config
config := GetConfig()

View file

@ -10,6 +10,8 @@ import (
"github.com/HikariKnight/quickpassthrough/internal/logger"
)
// Generates a script file named dump_vbios.sh and places it inside the utils folder.
// This script has to be run without a display manager or display server running
func GenerateVBIOSDumper(vbios_path string) {
// Get the config directories
config := GetConfig()

View file

@ -7,6 +7,8 @@ import (
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
)
// This function adds the disable vfio video output on host option to the config
// The function will use the given int as the value for the option
func DisableVFIOVideo(i int) {
// Get the config
config := GetConfig()

View file

@ -29,6 +29,7 @@ type Config struct {
Path *Path
}
// Gets the path to all the config files
func GetConfigPaths() *Path {
Paths := &Path{
CMDLINE: "config/kernel_args",
@ -44,6 +45,7 @@ func GetConfigPaths() *Path {
return Paths
}
// Gets all the configs and returns the struct
func GetConfig() *Config {
config := &Config{
Bootloader: "unknown",
@ -57,6 +59,7 @@ func GetConfig() *Config {
return config
}
// Constructs the empty config files and folders based on what exists on the system
func InitConfigs() {
config := GetConfig()
@ -152,6 +155,7 @@ func InitConfigs() {
}
}
// Returns a list of modules used for vfio based on the systems kernel version
func vfio_modules() []string {
// Make the list of modules
modules := []string{