@@ -55,8 +55,9 @@ type Config struct {
55
55
56
56
hidPath string
57
57
58
- status bool
59
- hab bool
58
+ status bool
59
+ consoleLogs bool
60
+ hab bool
60
61
61
62
otaELF string
62
63
otaSig string
@@ -79,6 +80,7 @@ func init() {
79
80
80
81
flag .StringVar (& conf .hidPath , "d" , "" , "HID path of witness device to act upon (use -s to list devices)" )
81
82
flag .BoolVar (& conf .status , "s" , false , "get witness status" )
83
+ flag .BoolVar (& conf .consoleLogs , "l" , false , "get witness console/debug logs" )
82
84
flag .BoolVar (& conf .hab , "H" , false , "set HAB fuses" )
83
85
flag .StringVar (& conf .otaELF , "o" , "" , "trusted applet payload" )
84
86
flag .StringVar (& conf .otaSig , "O" , "" , "trusted applet signature" )
@@ -160,6 +162,15 @@ func main() {
160
162
}
161
163
log .Printf ("%s\n \n " , s .Print ())
162
164
}
165
+ case conf .consoleLogs :
166
+ for _ , d := range conf .devs {
167
+ log .Printf ("👁️🗨️ @ %s" , d .usb .Path )
168
+ s , err := d .consoleLogs ()
169
+ if err != nil {
170
+ log .Printf ("Failed to get console logs on %q: %c" , d .usb .Path , err )
171
+ }
172
+ log .Printf ("%s\n \n " , s )
173
+ }
163
174
case len (conf .otaELF ) > 0 || len (conf .otaSig ) > 0 :
164
175
if len (conf .devs ) != 1 {
165
176
log .Fatal ("Please specify which device to OTA using -d" )
0 commit comments