This commit is contained in:
Adrian 2025-01-24 19:35:43 -06:00
parent 8c54eac167
commit 30385f8ae3
1 changed files with 0 additions and 3 deletions

3
usb.go
View File

@ -21,10 +21,8 @@ const kvmGadgetPath = "/sys/kernel/config/usb_gadget/jetkvm"
const configC1Path = "/sys/kernel/config/usb_gadget/jetkvm/configs/c.1" const configC1Path = "/sys/kernel/config/usb_gadget/jetkvm/configs/c.1"
func mountConfigFS() error { func mountConfigFS() error {
logger.Infof("Checking for gadgetPath: %s ...", gadgetPath)
_, err := os.Stat(gadgetPath) _, err := os.Stat(gadgetPath)
if os.IsNotExist(err) { if os.IsNotExist(err) {
logger.Infof("running mount command...")
err = exec.Command("mount", "-t", "configfs", "none", configFSPath).Run() err = exec.Command("mount", "-t", "configfs", "none", configFSPath).Run()
if err != nil { if err != nil {
return fmt.Errorf("failed to mount configfs: %w", err) return fmt.Errorf("failed to mount configfs: %w", err)
@ -32,7 +30,6 @@ func mountConfigFS() error {
} else { } else {
return fmt.Errorf("unable to access usb gadget path: %w", err) return fmt.Errorf("unable to access usb gadget path: %w", err)
} }
logger.Infof("Successfully mounted usb gadget at %s", gadgetPath)
return nil return nil
} }