genode/tool/run/log/serial

43 lines
848 B
Plaintext

##
# 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 210
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;
}
}
}
}