mirror of
https://github.com/HikariKnight/quickpassthrough
synced 2025-06-27 21:48:01 +02:00
Implement Set_Kernelstub and attempt to elevate to sudo using STDIN and then attempt to remove the password from the program memory
This commit is contained in:
parent
ca992bf864
commit
7081bfa8d7
5 changed files with 81 additions and 13 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/HikariKnight/quickpassthrough/internal/logger"
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/command"
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
"github.com/klauspost/cpuid/v2"
|
||||
|
@ -63,5 +64,15 @@ func Set_Cmdline(gpu_IDs []string) {
|
|||
// TODO2: look into grubby
|
||||
// TODO3: if unknown bootloader, tell user what to add a kernel arguments
|
||||
func Set_KernelStub() {
|
||||
// Get the config
|
||||
config := GetConfig()
|
||||
|
||||
// Get the kernel args
|
||||
kernel_args := fileio.ReadFile(config.Path.CMDLINE)
|
||||
|
||||
// Write to logger
|
||||
logger.Printf("Running command:\nsudo kernelstub -a \"%s\"", kernel_args)
|
||||
|
||||
// Run the command
|
||||
command.Run("sudo", "kernelstub", "-a", kernel_args)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue