This commit is contained in:
John 2025-05-16 12:03:27 +01:00 committed by GitHub
commit 3c96cee12a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -200,6 +200,14 @@ func (u *UsbGadget) Init() error {
u.log.Error().Err(err).Msg("failed to mount configfs, usb stack might not function properly") u.log.Error().Err(err).Msg("failed to mount configfs, usb stack might not function properly")
} }
if _, err := os.Stat(u.configC1Path); err == nil {
u.log.Error().Str("configC1Path", u.configC1Path).Msg("removing existing config path")
err := os.RemoveAll(u.configC1Path);
if err != nil {
u.log.Error().Err(err).Msg("failed to remove existing config path")
}
}
if err := os.MkdirAll(u.configC1Path, 0755); err != nil { if err := os.MkdirAll(u.configC1Path, 0755); err != nil {
u.log.Error().Err(err).Msg("failed to create config path") u.log.Error().Err(err).Msg("failed to create config path")
} }