diff options
Diffstat (limited to 'util/autoport/log_maker.go')
-rw-r--r-- | util/autoport/log_maker.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/util/autoport/log_maker.go b/util/autoport/log_maker.go index e2440b4891..dbe5f808c9 100644 --- a/util/autoport/log_maker.go +++ b/util/autoport/log_maker.go @@ -103,4 +103,23 @@ func MakeLogs(outDir string) { defer out.Close() io.Copy(out, in) } + + out, err := os.Create(outDir + "/input_bustypes.log") + if err != nil { + log.Fatal(err) + } + defer out.Close() + + ClassInputDir := "/sys/class/input/" + files, _ = ioutil.ReadDir(ClassInputDir) + for _, f := range files { + if strings.HasPrefix(f.Name(), "input") && !f.Mode().IsRegular() { /* Allow both dirs and symlinks. */ + in, err := os.Open(ClassInputDir + f.Name() + "/id/bustype") + defer in.Close() + if err != nil { + log.Fatal(err) + } + io.Copy(out, in) + } + } } |