genode/tool/run/log/serial

43 lines
847 B
Plaintext
Raw Normal View History

2015-01-08 21:08:48 +00:00
##
# Get the output of the target machine via serial connection
#
# \param --log-serial-cmd Cmd that is executed to capture the output
#
source [genode_dir]/tool/run/log.inc
set default_serial_cmd "picocom -b 115200 /dev/ttyUSB0"
proc log_serial_cmd { } {
global default_serial_cmd
return [get_cmd_arg --log-serial-cmd $default_serial_cmd]
}
##
# Log output of the test machine via serial device
#
proc run_log { wait_for_re timeout_value } {
global output_spawn_id
set timeout 60
2015-01-08 21:08:48 +00:00
while {true} {
eval spawn [log_serial_cmd]
set output_spawn_id $spawn_id
expect {
"Genode \[0-9]\[0-9]\.\[0-9]\[0-9]" {
wait_for_output $wait_for_re $timeout_value $output_spawn_id;
return true;
}
eof { continue; }
timeout {
puts stderr "Boot process timed out";
close;
return false;
}
}
}
}